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 |
|---|---|---|---|---|---|---|---|---|---|---|
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/message/StringFormatterMessageFactory.java | StringFormatterMessageFactory.newMessage | @Override
public Message newMessage(final String message, final Object... params) {
"""
Creates {@link StringFormattedMessage} instances.
@param message The message pattern.
@param params The parameters to the message.
@return The Message.
@see MessageFactory#newMessage(String, Object...)
"""
... | java | @Override
public Message newMessage(final String message, final Object... params) {
return new StringFormattedMessage(message, params);
} | [
"@",
"Override",
"public",
"Message",
"newMessage",
"(",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"params",
")",
"{",
"return",
"new",
"StringFormattedMessage",
"(",
"message",
",",
"params",
")",
";",
"}"
] | Creates {@link StringFormattedMessage} instances.
@param message The message pattern.
@param params The parameters to the message.
@return The Message.
@see MessageFactory#newMessage(String, Object...) | [
"Creates",
"{",
"@link",
"StringFormattedMessage",
"}",
"instances",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/StringFormatterMessageFactory.java#L60-L63 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/access/defaultdisseminator/DefaultDisseminatorImpl.java | DefaultDisseminatorImpl.viewObjectProfile | public MIMETypedStream viewObjectProfile() throws ServerException {
"""
Returns an HTML rendering of the object profile which contains key
metadata from the object, plus URLs for the object's Dissemination Index
and Item Index. The data is returned as HTML in a presentation-oriented
format. This is accomplished... | java | public MIMETypedStream viewObjectProfile() throws ServerException {
try {
ObjectProfile profile =
m_access.getObjectProfile(context,
reader.GetObjectPID(),
asOfDateTime);
Reade... | [
"public",
"MIMETypedStream",
"viewObjectProfile",
"(",
")",
"throws",
"ServerException",
"{",
"try",
"{",
"ObjectProfile",
"profile",
"=",
"m_access",
".",
"getObjectProfile",
"(",
"context",
",",
"reader",
".",
"GetObjectPID",
"(",
")",
",",
"asOfDateTime",
")",
... | Returns an HTML rendering of the object profile which contains key
metadata from the object, plus URLs for the object's Dissemination Index
and Item Index. The data is returned as HTML in a presentation-oriented
format. This is accomplished by doing an XSLT transform on the XML that
is obtained from getObjectProfile in... | [
"Returns",
"an",
"HTML",
"rendering",
"of",
"the",
"object",
"profile",
"which",
"contains",
"key",
"metadata",
"from",
"the",
"object",
"plus",
"URLs",
"for",
"the",
"object",
"s",
"Dissemination",
"Index",
"and",
"Item",
"Index",
".",
"The",
"data",
"is",
... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/access/defaultdisseminator/DefaultDisseminatorImpl.java#L102-L145 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Transform3D.java | Transform3D.setTranslation | public void setTranslation(double x, double y, double z) {
"""
Set the position.
<p>
This function changes only the elements of
the matrix related to the translation.
The scaling and the shearing are not changed.
<p>
After a call to this function, the matrix will
contains (? means any value):
<pre>
[ ? ... | java | public void setTranslation(double x, double y, double z) {
this.m03 = x;
this.m13 = y;
this.m23 = z;
} | [
"public",
"void",
"setTranslation",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"this",
".",
"m03",
"=",
"x",
";",
"this",
".",
"m13",
"=",
"y",
";",
"this",
".",
"m23",
"=",
"z",
";",
"}"
] | Set the position.
<p>
This function changes only the elements of
the matrix related to the translation.
The scaling and the shearing are not changed.
<p>
After a call to this function, the matrix will
contains (? means any value):
<pre>
[ ? ? x ]
[ ? ? y ]
[ ? ? z ]
[ ? ? ? ]
</p... | [
"Set",
"the",
"position",
".",
"<p",
">",
"This",
"function",
"changes",
"only",
"the",
"elements",
"of",
"the",
"matrix",
"related",
"to",
"the",
"translation",
".",
"The",
"scaling",
"and",
"the",
"shearing",
"are",
"not",
"changed",
".",
"<p",
">",
"A... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Transform3D.java#L136-L140 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRulePersistenceImpl.java | CPRulePersistenceImpl.findAll | @Override
public List<CPRule> findAll(int start, int end) {
"""
Returns a range of all the cp rules.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</cod... | java | @Override
public List<CPRule> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPRule",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the cp rules.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code>... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"rules",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRulePersistenceImpl.java#L1467-L1470 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/searchindex/CmsFieldsList.java | CmsFieldsList.fillDetailField | private void fillDetailField(CmsListItem item, String detailId) {
"""
Fills details of the field into the given item. <p>
@param item the list item to fill
@param detailId the id for the detail to fill
"""
StringBuffer html = new StringBuffer();
// search for the corresponding A_CmsSearchI... | java | private void fillDetailField(CmsListItem item, String detailId) {
StringBuffer html = new StringBuffer();
// search for the corresponding A_CmsSearchIndex:
String idxFieldName = (String)item.get(LIST_COLUMN_NAME);
List<CmsSearchField> fields = OpenCms.getSearchManager().getFieldConfigu... | [
"private",
"void",
"fillDetailField",
"(",
"CmsListItem",
"item",
",",
"String",
"detailId",
")",
"{",
"StringBuffer",
"html",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"// search for the corresponding A_CmsSearchIndex:",
"String",
"idxFieldName",
"=",
"(",
"String",... | Fills details of the field into the given item. <p>
@param item the list item to fill
@param detailId the id for the detail to fill | [
"Fills",
"details",
"of",
"the",
"field",
"into",
"the",
"given",
"item",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/searchindex/CmsFieldsList.java#L681-L713 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUESubspace.java | CLIQUESubspace.rightNeighbor | protected CLIQUEUnit rightNeighbor(CLIQUEUnit unit, int dim) {
"""
Returns the right neighbor of the given unit in the specified dimension.
@param unit the unit to determine the right neighbor for
@param dim the dimension
@return the right neighbor of the given unit in the specified dimension
"""
for(... | java | protected CLIQUEUnit rightNeighbor(CLIQUEUnit unit, int dim) {
for(CLIQUEUnit u : denseUnits) {
if(u.containsRightNeighbor(unit, dim)) {
return u;
}
}
return null;
} | [
"protected",
"CLIQUEUnit",
"rightNeighbor",
"(",
"CLIQUEUnit",
"unit",
",",
"int",
"dim",
")",
"{",
"for",
"(",
"CLIQUEUnit",
"u",
":",
"denseUnits",
")",
"{",
"if",
"(",
"u",
".",
"containsRightNeighbor",
"(",
"unit",
",",
"dim",
")",
")",
"{",
"return"... | Returns the right neighbor of the given unit in the specified dimension.
@param unit the unit to determine the right neighbor for
@param dim the dimension
@return the right neighbor of the given unit in the specified dimension | [
"Returns",
"the",
"right",
"neighbor",
"of",
"the",
"given",
"unit",
"in",
"the",
"specified",
"dimension",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUESubspace.java#L162-L169 |
JOML-CI/JOML | src/org/joml/Quaterniond.java | Quaterniond.lookAlong | public Quaterniond lookAlong(double dirX, double dirY, double dirZ, double upX, double upY, double upZ, Quaterniond dest) {
"""
/* (non-Javadoc)
@see org.joml.Quaterniondc#lookAlong(double, double, double, double, double, double, org.joml.Quaterniond)
"""
// Normalize direction
double invDirLe... | java | public Quaterniond lookAlong(double dirX, double dirY, double dirZ, double upX, double upY, double upZ, Quaterniond dest) {
// Normalize direction
double invDirLength = 1.0 / Math.sqrt(dirX * dirX + dirY * dirY + dirZ * dirZ);
double dirnX = -dirX * invDirLength;
double dirnY = -dirY * i... | [
"public",
"Quaterniond",
"lookAlong",
"(",
"double",
"dirX",
",",
"double",
"dirY",
",",
"double",
"dirZ",
",",
"double",
"upX",
",",
"double",
"upY",
",",
"double",
"upZ",
",",
"Quaterniond",
"dest",
")",
"{",
"// Normalize direction",
"double",
"invDirLength... | /* (non-Javadoc)
@see org.joml.Quaterniondc#lookAlong(double, double, double, double, double, double, org.joml.Quaterniond) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaterniond.java#L1712-L1774 |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/IceAgent.java | IceAgent.selectCandidatePair | private CandidatePair selectCandidatePair(IceComponent component, DatagramChannel channel) {
"""
Attempts to select a candidate pair on a ICE component.<br>
A candidate pair is only selected if the local candidate channel is
registered with the provided Selection Key.
@param component
The component that hold... | java | private CandidatePair selectCandidatePair(IceComponent component, DatagramChannel channel) {
for (LocalCandidateWrapper localCandidate : component.getLocalCandidates()) {
if (channel.equals(localCandidate.getChannel())) {
return component.setCandidatePair(channel);
}
}
return null;
} | [
"private",
"CandidatePair",
"selectCandidatePair",
"(",
"IceComponent",
"component",
",",
"DatagramChannel",
"channel",
")",
"{",
"for",
"(",
"LocalCandidateWrapper",
"localCandidate",
":",
"component",
".",
"getLocalCandidates",
"(",
")",
")",
"{",
"if",
"(",
"chan... | Attempts to select a candidate pair on a ICE component.<br>
A candidate pair is only selected if the local candidate channel is
registered with the provided Selection Key.
@param component
The component that holds the gathered candidates.
@param key
The key of the datagram channel of the elected candidate.
@return Ret... | [
"Attempts",
"to",
"select",
"a",
"candidate",
"pair",
"on",
"a",
"ICE",
"component",
".",
"<br",
">",
"A",
"candidate",
"pair",
"is",
"only",
"selected",
"if",
"the",
"local",
"candidate",
"channel",
"is",
"registered",
"with",
"the",
"provided",
"Selection"... | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/IceAgent.java#L320-L327 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/MtoNBroker.java | MtoNBroker.storeMtoNImplementor | public void storeMtoNImplementor(CollectionDescriptor cod, Object realObject, Object otherObj, Collection mnKeys) {
"""
Stores new values of a M:N association in a indirection table.
@param cod The {@link org.apache.ojb.broker.metadata.CollectionDescriptor} for the m:n relation
@param realObject The rea... | java | public void storeMtoNImplementor(CollectionDescriptor cod, Object realObject, Object otherObj, Collection mnKeys)
{
ClassDescriptor cld = pb.getDescriptorRepository().getDescriptorFor(realObject.getClass());
ValueContainer[] pkValues = pb.serviceBrokerHelper().getKeyValues(cld, realObject);
... | [
"public",
"void",
"storeMtoNImplementor",
"(",
"CollectionDescriptor",
"cod",
",",
"Object",
"realObject",
",",
"Object",
"otherObj",
",",
"Collection",
"mnKeys",
")",
"{",
"ClassDescriptor",
"cld",
"=",
"pb",
".",
"getDescriptorRepository",
"(",
")",
".",
"getDes... | Stores new values of a M:N association in a indirection table.
@param cod The {@link org.apache.ojb.broker.metadata.CollectionDescriptor} for the m:n relation
@param realObject The real object
@param otherObj The referenced object
@param mnKeys The all {@link org.apache.ojb.broker.core.MtoNBroker.Key} mat... | [
"Stores",
"new",
"values",
"of",
"a",
"M",
":",
"N",
"association",
"in",
"a",
"indirection",
"table",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/MtoNBroker.java#L83-L126 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/cache/ObjectCachePerClassImpl.java | ObjectCachePerClassImpl.getCachePerClass | private ObjectCache getCachePerClass(Class objectClass, int methodCall) {
"""
Gets the cache for the given class
@param objectClass The class to look up the cache for
@return The cache
"""
ObjectCache cache = (ObjectCache) cachesByClass.get(objectClass.getName());
if (cache == null && Abs... | java | private ObjectCache getCachePerClass(Class objectClass, int methodCall)
{
ObjectCache cache = (ObjectCache) cachesByClass.get(objectClass.getName());
if (cache == null && AbstractMetaCache.METHOD_CACHE == methodCall
&& !cachesByClass.containsKey(objectClass.getName()))
{... | [
"private",
"ObjectCache",
"getCachePerClass",
"(",
"Class",
"objectClass",
",",
"int",
"methodCall",
")",
"{",
"ObjectCache",
"cache",
"=",
"(",
"ObjectCache",
")",
"cachesByClass",
".",
"get",
"(",
"objectClass",
".",
"getName",
"(",
")",
")",
";",
"if",
"(... | Gets the cache for the given class
@param objectClass The class to look up the cache for
@return The cache | [
"Gets",
"the",
"cache",
"for",
"the",
"given",
"class"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/cache/ObjectCachePerClassImpl.java#L107-L117 |
jglobus/JGlobus | myproxy/src/main/java/org/globus/myproxy/MyProxy.java | MyProxy.get | public GSSCredential get(String username,
String passphrase,
int lifetime)
throws MyProxyException {
"""
Retrieves delegated credentials from MyProxy server Anonymously
(without local credentials)
Notes: Performs simple verification of private/p... | java | public GSSCredential get(String username,
String passphrase,
int lifetime)
throws MyProxyException {
return get(null, username, passphrase, lifetime);
} | [
"public",
"GSSCredential",
"get",
"(",
"String",
"username",
",",
"String",
"passphrase",
",",
"int",
"lifetime",
")",
"throws",
"MyProxyException",
"{",
"return",
"get",
"(",
"null",
",",
"username",
",",
"passphrase",
",",
"lifetime",
")",
";",
"}"
] | Retrieves delegated credentials from MyProxy server Anonymously
(without local credentials)
Notes: Performs simple verification of private/public keys of
the delegated credential. Should be improved later.
And only checks for RSA keys.
@param username
The username of the credentials to retrieve.
@param passphrase
T... | [
"Retrieves",
"delegated",
"credentials",
"from",
"MyProxy",
"server",
"Anonymously",
"(",
"without",
"local",
"credentials",
")"
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/myproxy/src/main/java/org/globus/myproxy/MyProxy.java#L897-L902 |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/metamodel/AbstractProperty.java | AbstractProperty.encodeField | public VALUETO encodeField(ENTITY entity, Optional<CassandraOptions> cassandraOptions) {
"""
Encode the field of the given entity into CQL-compatible value using Achilles codec system and a CassandraOptions
containing a runtime SchemaNameProvider. Use the
<br/>
<br/>
<pre class="code"><code class="java">
Cass... | java | public VALUETO encodeField(ENTITY entity, Optional<CassandraOptions> cassandraOptions) {
return encodeFromJava(getJavaValue(entity), cassandraOptions);
} | [
"public",
"VALUETO",
"encodeField",
"(",
"ENTITY",
"entity",
",",
"Optional",
"<",
"CassandraOptions",
">",
"cassandraOptions",
")",
"{",
"return",
"encodeFromJava",
"(",
"getJavaValue",
"(",
"entity",
")",
",",
"cassandraOptions",
")",
";",
"}"
] | Encode the field of the given entity into CQL-compatible value using Achilles codec system and a CassandraOptions
containing a runtime SchemaNameProvider. Use the
<br/>
<br/>
<pre class="code"><code class="java">
CassandraOptions.withSchemaNameProvider(SchemaNameProvider provider)
</code></pre>
<br/>
static method to b... | [
"Encode",
"the",
"field",
"of",
"the",
"given",
"entity",
"into",
"CQL",
"-",
"compatible",
"value",
"using",
"Achilles",
"codec",
"system",
"and",
"a",
"CassandraOptions",
"containing",
"a",
"runtime",
"SchemaNameProvider",
".",
"Use",
"the",
"<br",
"/",
">",... | train | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/metamodel/AbstractProperty.java#L188-L190 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.buttonBar | public String buttonBar(int segment, String attributes) {
"""
Returns the html for a button bar.<p>
@param segment the HTML segment (START / END)
@param attributes optional attributes for the table tag
@return a button bar html start / end segment
"""
if (segment == HTML_START) {
St... | java | public String buttonBar(int segment, String attributes) {
if (segment == HTML_START) {
String result = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"";
if (attributes != null) {
result += " " + attributes;
}
return result + "><tr>\n";
... | [
"public",
"String",
"buttonBar",
"(",
"int",
"segment",
",",
"String",
"attributes",
")",
"{",
"if",
"(",
"segment",
"==",
"HTML_START",
")",
"{",
"String",
"result",
"=",
"\"<table cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" border=\\\"0\\\"\"",
";",
"if",
"(",
"at... | Returns the html for a button bar.<p>
@param segment the HTML segment (START / END)
@param attributes optional attributes for the table tag
@return a button bar html start / end segment | [
"Returns",
"the",
"html",
"for",
"a",
"button",
"bar",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L1279-L1290 |
osglworks/java-tool | src/main/java/org/osgl/util/IO.java | IO.writeContent | @Deprecated
public static void writeContent(CharSequence content, File file, String encoding) {
"""
Write string content to a file with encoding specified.
This is deprecated. Please use {@link #write(CharSequence, File, String)} instead
"""
write(content, file, encoding);
} | java | @Deprecated
public static void writeContent(CharSequence content, File file, String encoding) {
write(content, file, encoding);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"writeContent",
"(",
"CharSequence",
"content",
",",
"File",
"file",
",",
"String",
"encoding",
")",
"{",
"write",
"(",
"content",
",",
"file",
",",
"encoding",
")",
";",
"}"
] | Write string content to a file with encoding specified.
This is deprecated. Please use {@link #write(CharSequence, File, String)} instead | [
"Write",
"string",
"content",
"to",
"a",
"file",
"with",
"encoding",
"specified",
"."
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/IO.java#L1702-L1705 |
samskivert/samskivert | src/main/java/com/samskivert/swing/util/RetryableTask.java | RetryableTask.invokeTask | public void invokeTask (Component parent, String retryMessage)
throws Exception {
"""
Invokes the supplied task and catches any thrown exceptions. In the
event of an exception, the provided message is displayed to the
user and the are allowed to retry the task or allow it to fail.
"""
while (... | java | public void invokeTask (Component parent, String retryMessage)
throws Exception
{
while (true) {
try {
invoke();
return;
} catch (Exception e) {
Object[] options = new Object[] {
"Retry operation", "Abort op... | [
"public",
"void",
"invokeTask",
"(",
"Component",
"parent",
",",
"String",
"retryMessage",
")",
"throws",
"Exception",
"{",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"invoke",
"(",
")",
";",
"return",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{... | Invokes the supplied task and catches any thrown exceptions. In the
event of an exception, the provided message is displayed to the
user and the are allowed to retry the task or allow it to fail. | [
"Invokes",
"the",
"supplied",
"task",
"and",
"catches",
"any",
"thrown",
"exceptions",
".",
"In",
"the",
"event",
"of",
"an",
"exception",
"the",
"provided",
"message",
"is",
"displayed",
"to",
"the",
"user",
"and",
"the",
"are",
"allowed",
"to",
"retry",
... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/RetryableTask.java#L33-L53 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/xpath/MapBasedXPathFunctionResolver.java | MapBasedXPathFunctionResolver.removeFunction | @Nonnull
public EChange removeFunction (@Nonnull final QName aName, @Nonnegative final int nArity) {
"""
Remove the function with the specified name.
@param aName
The name to be removed. May not be <code>null</code>.
@param nArity
The number of parameters of the function. Must be ≥ 0.
@return {@link EC... | java | @Nonnull
public EChange removeFunction (@Nonnull final QName aName, @Nonnegative final int nArity)
{
final XPathFunctionKey aKey = new XPathFunctionKey (aName, nArity);
return removeFunction (aKey);
} | [
"@",
"Nonnull",
"public",
"EChange",
"removeFunction",
"(",
"@",
"Nonnull",
"final",
"QName",
"aName",
",",
"@",
"Nonnegative",
"final",
"int",
"nArity",
")",
"{",
"final",
"XPathFunctionKey",
"aKey",
"=",
"new",
"XPathFunctionKey",
"(",
"aName",
",",
"nArity"... | Remove the function with the specified name.
@param aName
The name to be removed. May not be <code>null</code>.
@param nArity
The number of parameters of the function. Must be ≥ 0.
@return {@link EChange} | [
"Remove",
"the",
"function",
"with",
"the",
"specified",
"name",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/xpath/MapBasedXPathFunctionResolver.java#L152-L157 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ThrottlerCalculator.java | ThrottlerCalculator.getThrottlingDelay | DelayResult getThrottlingDelay() {
"""
Calculates the amount of time needed to delay based on the configured throttlers. The computed result is not additive,
as there is no benefit to adding delays from various Throttle Calculators together. For example, a cache throttling
delay will have increased batching as a... | java | DelayResult getThrottlingDelay() {
// These delays are not additive. There's no benefit to adding a batching delay on top of a throttling delay, since
// a throttling delay will have increased batching as a side effect.
int maxDelay = 0;
boolean maximum = false;
for (Throttler t ... | [
"DelayResult",
"getThrottlingDelay",
"(",
")",
"{",
"// These delays are not additive. There's no benefit to adding a batching delay on top of a throttling delay, since",
"// a throttling delay will have increased batching as a side effect.",
"int",
"maxDelay",
"=",
"0",
";",
"boolean",
"m... | Calculates the amount of time needed to delay based on the configured throttlers. The computed result is not additive,
as there is no benefit to adding delays from various Throttle Calculators together. For example, a cache throttling
delay will have increased batching as a side effect, so there's no need to include th... | [
"Calculates",
"the",
"amount",
"of",
"time",
"needed",
"to",
"delay",
"based",
"on",
"the",
"configured",
"throttlers",
".",
"The",
"computed",
"result",
"is",
"not",
"additive",
"as",
"there",
"is",
"no",
"benefit",
"to",
"adding",
"delays",
"from",
"variou... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ThrottlerCalculator.java#L91-L109 |
infinispan/infinispan | jcache/embedded/src/main/java/org/infinispan/jcache/annotation/CacheLookupHelper.java | CacheLookupHelper.getCacheKeyGenerator | public static CacheKeyGenerator getCacheKeyGenerator(BeanManager beanManager, Class<? extends CacheKeyGenerator> methodCacheKeyGeneratorClass, CacheDefaults cacheDefaultsAnnotation) {
"""
Resolves and creates an instance of {@link javax.cache.annotation.CacheKeyGenerator}. To resolve the cache key generator class ... | java | public static CacheKeyGenerator getCacheKeyGenerator(BeanManager beanManager, Class<? extends CacheKeyGenerator> methodCacheKeyGeneratorClass, CacheDefaults cacheDefaultsAnnotation) {
assertNotNull(beanManager, "beanManager parameter must not be null");
Class<? extends CacheKeyGenerator> cacheKeyGeneratorC... | [
"public",
"static",
"CacheKeyGenerator",
"getCacheKeyGenerator",
"(",
"BeanManager",
"beanManager",
",",
"Class",
"<",
"?",
"extends",
"CacheKeyGenerator",
">",
"methodCacheKeyGeneratorClass",
",",
"CacheDefaults",
"cacheDefaultsAnnotation",
")",
"{",
"assertNotNull",
"(",
... | Resolves and creates an instance of {@link javax.cache.annotation.CacheKeyGenerator}. To resolve the cache key generator class the
algorithm defined in JCACHE specification is used.
@param beanManager the bean manager instance.
@param methodCacheKeyGeneratorClass the {@link javax.cache.annotation.Cach... | [
"Resolves",
"and",
"creates",
"an",
"instance",
"of",
"{",
"@link",
"javax",
".",
"cache",
".",
"annotation",
".",
"CacheKeyGenerator",
"}",
".",
"To",
"resolve",
"the",
"cache",
"key",
"generator",
"class",
"the",
"algorithm",
"defined",
"in",
"JCACHE",
"sp... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/jcache/embedded/src/main/java/org/infinispan/jcache/annotation/CacheLookupHelper.java#L69-L96 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/EncryptedPutObjectRequest.java | EncryptedPutObjectRequest.setMaterialsDescription | public void setMaterialsDescription(Map<String, String> materialsDescription) {
"""
sets the materials description for the encryption materials to be used with the current PutObjectRequest.
@param materialsDescription the materialsDescription to set
"""
this.materialsDescription = materialsDescription... | java | public void setMaterialsDescription(Map<String, String> materialsDescription) {
this.materialsDescription = materialsDescription == null
? null
: Collections.unmodifiableMap(new HashMap<String,String>(materialsDescription))
;
} | [
"public",
"void",
"setMaterialsDescription",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"materialsDescription",
")",
"{",
"this",
".",
"materialsDescription",
"=",
"materialsDescription",
"==",
"null",
"?",
"null",
":",
"Collections",
".",
"unmodifiableMap",
"... | sets the materials description for the encryption materials to be used with the current PutObjectRequest.
@param materialsDescription the materialsDescription to set | [
"sets",
"the",
"materials",
"description",
"for",
"the",
"encryption",
"materials",
"to",
"be",
"used",
"with",
"the",
"current",
"PutObjectRequest",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/EncryptedPutObjectRequest.java#L67-L72 |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/EventMessenger.java | EventMessenger.sendTo | public void sendTo(String topicURI, Object event,
Set<String> eligibleWebSocketSessionIds) {
"""
Send an {@link EventMessage} to every client that is currently subscribed to the
given topicURI and is listed in the eligibleSessionIds set. If no session of the
provided set is subscribed to the topicURI nothing ... | java | public void sendTo(String topicURI, Object event,
Set<String> eligibleWebSocketSessionIds) {
EventMessage eventMessage = new EventMessage(topicURI, event);
eventMessage.setEligibleWebSocketSessionIds(eligibleWebSocketSessionIds);
send(eventMessage);
} | [
"public",
"void",
"sendTo",
"(",
"String",
"topicURI",
",",
"Object",
"event",
",",
"Set",
"<",
"String",
">",
"eligibleWebSocketSessionIds",
")",
"{",
"EventMessage",
"eventMessage",
"=",
"new",
"EventMessage",
"(",
"topicURI",
",",
"event",
")",
";",
"eventM... | Send an {@link EventMessage} to every client that is currently subscribed to the
given topicURI and is listed in the eligibleSessionIds set. If no session of the
provided set is subscribed to the topicURI nothing happens.
@param topicURI the name of the topic
@param event the payload of the {@link EventMessage}
@param... | [
"Send",
"an",
"{",
"@link",
"EventMessage",
"}",
"to",
"every",
"client",
"that",
"is",
"currently",
"subscribed",
"to",
"the",
"given",
"topicURI",
"and",
"is",
"listed",
"in",
"the",
"eligibleSessionIds",
"set",
".",
"If",
"no",
"session",
"of",
"the",
"... | train | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/EventMessenger.java#L116-L121 |
apache/groovy | subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java | DateTimeExtensions.isUptoEligible | private static boolean isUptoEligible(Temporal from, Temporal to) {
"""
Returns true if the {@code from} can be iterated up to {@code to}.
"""
TemporalAmount amount = rightShift(from, to);
if (amount instanceof Period) {
return isNonnegative((Period) amount);
} else if (amou... | java | private static boolean isUptoEligible(Temporal from, Temporal to) {
TemporalAmount amount = rightShift(from, to);
if (amount instanceof Period) {
return isNonnegative((Period) amount);
} else if (amount instanceof Duration) {
return isNonnegative((Duration) amount);
... | [
"private",
"static",
"boolean",
"isUptoEligible",
"(",
"Temporal",
"from",
",",
"Temporal",
"to",
")",
"{",
"TemporalAmount",
"amount",
"=",
"rightShift",
"(",
"from",
",",
"to",
")",
";",
"if",
"(",
"amount",
"instanceof",
"Period",
")",
"{",
"return",
"i... | Returns true if the {@code from} can be iterated up to {@code to}. | [
"Returns",
"true",
"if",
"the",
"{"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java#L169-L179 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscConfigurationsInner.java | DscConfigurationsInner.createOrUpdateAsync | public Observable<DscConfigurationInner> createOrUpdateAsync(String resourceGroupName, String automationAccountName, String configurationName, DscConfigurationCreateOrUpdateParameters parameters) {
"""
Create the configuration identified by configuration name.
@param resourceGroupName Name of an Azure Resource ... | java | public Observable<DscConfigurationInner> createOrUpdateAsync(String resourceGroupName, String automationAccountName, String configurationName, DscConfigurationCreateOrUpdateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, configurationName, paramet... | [
"public",
"Observable",
"<",
"DscConfigurationInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"configurationName",
",",
"DscConfigurationCreateOrUpdateParameters",
"parameters",
")",
"{",
"return",... | Create the configuration identified by configuration name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param configurationName The create or update parameters for configuration.
@param parameters The create or update parameters for configu... | [
"Create",
"the",
"configuration",
"identified",
"by",
"configuration",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscConfigurationsInner.java#L320-L327 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java | ServerUpdater.addRolesToUser | public ServerUpdater addRolesToUser(User user, Collection<Role> roles) {
"""
Queues a collection of roles to be assigned to the user.
@param user The server member the role should be added to.
@param roles The roles which should be added to the server member.
@return The current instance in order to chain cal... | java | public ServerUpdater addRolesToUser(User user, Collection<Role> roles) {
delegate.addRolesToUser(user, roles);
return this;
} | [
"public",
"ServerUpdater",
"addRolesToUser",
"(",
"User",
"user",
",",
"Collection",
"<",
"Role",
">",
"roles",
")",
"{",
"delegate",
".",
"addRolesToUser",
"(",
"user",
",",
"roles",
")",
";",
"return",
"this",
";",
"}"
] | Queues a collection of roles to be assigned to the user.
@param user The server member the role should be added to.
@param roles The roles which should be added to the server member.
@return The current instance in order to chain call methods. | [
"Queues",
"a",
"collection",
"of",
"roles",
"to",
"be",
"assigned",
"to",
"the",
"user",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java#L479-L482 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java | TypeHandlerUtils.convertBlob | public static Object convertBlob(Connection conn, InputStream input) throws SQLException {
"""
Transfers data from InputStream into sql.Blob
@param conn connection for which sql.Blob object would be created
@param input InputStream
@return sql.Blob from InputStream
@throws SQLException
"""
retur... | java | public static Object convertBlob(Connection conn, InputStream input) throws SQLException {
return convertBlob(conn, toByteArray(input));
} | [
"public",
"static",
"Object",
"convertBlob",
"(",
"Connection",
"conn",
",",
"InputStream",
"input",
")",
"throws",
"SQLException",
"{",
"return",
"convertBlob",
"(",
"conn",
",",
"toByteArray",
"(",
"input",
")",
")",
";",
"}"
] | Transfers data from InputStream into sql.Blob
@param conn connection for which sql.Blob object would be created
@param input InputStream
@return sql.Blob from InputStream
@throws SQLException | [
"Transfers",
"data",
"from",
"InputStream",
"into",
"sql",
".",
"Blob"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java#L95-L97 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java | TypeConverter.convertToBoolean | public static boolean convertToBoolean (@Nonnull final Object aSrcValue) {
"""
Convert the passed source value to boolean
@param aSrcValue
The source value. May not be <code>null</code>.
@return The converted value.
@throws TypeConverterException
if the source value is <code>null</code> or if no converter w... | java | public static boolean convertToBoolean (@Nonnull final Object aSrcValue)
{
if (aSrcValue == null)
throw new TypeConverterException (boolean.class, EReason.NULL_SOURCE_NOT_ALLOWED);
final Boolean aValue = convert (aSrcValue, Boolean.class);
return aValue.booleanValue ();
} | [
"public",
"static",
"boolean",
"convertToBoolean",
"(",
"@",
"Nonnull",
"final",
"Object",
"aSrcValue",
")",
"{",
"if",
"(",
"aSrcValue",
"==",
"null",
")",
"throw",
"new",
"TypeConverterException",
"(",
"boolean",
".",
"class",
",",
"EReason",
".",
"NULL_SOUR... | Convert the passed source value to boolean
@param aSrcValue
The source value. May not be <code>null</code>.
@return The converted value.
@throws TypeConverterException
if the source value is <code>null</code> or if no converter was
found or if the converter returned a <code>null</code> object.
@throws RuntimeException... | [
"Convert",
"the",
"passed",
"source",
"value",
"to",
"boolean"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java#L114-L120 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java | ByteConverter.int4 | public static int int4(byte[] bytes, int idx) {
"""
Parses an int value from the byte array.
@param bytes The byte array to parse.
@param idx The starting index of the parse in the byte array.
@return parsed int value.
"""
return
((bytes[idx] & 255) << 24)
+ ((bytes[idx + 1] & 255)... | java | public static int int4(byte[] bytes, int idx) {
return
((bytes[idx] & 255) << 24)
+ ((bytes[idx + 1] & 255) << 16)
+ ((bytes[idx + 2] & 255) << 8)
+ ((bytes[idx + 3] & 255));
} | [
"public",
"static",
"int",
"int4",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"idx",
")",
"{",
"return",
"(",
"(",
"bytes",
"[",
"idx",
"]",
"&",
"255",
")",
"<<",
"24",
")",
"+",
"(",
"(",
"bytes",
"[",
"idx",
"+",
"1",
"]",
"&",
"255",
"... | Parses an int value from the byte array.
@param bytes The byte array to parse.
@param idx The starting index of the parse in the byte array.
@return parsed int value. | [
"Parses",
"an",
"int",
"value",
"from",
"the",
"byte",
"array",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java#L45-L51 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java | ShapeGenerator.createScrollButtonTogetherIncrease | public Shape createScrollButtonTogetherIncrease(int x, int y, int w, int h) {
"""
Return a path for a scroll bar increase button. This is used when the
buttons are placed together at one end of the scroll bar.
@param x the X coordinate of the upper-left corner of the button
@param y the Y coordinate of the ... | java | public Shape createScrollButtonTogetherIncrease(int x, int y, int w, int h) {
return createRectangle(x, y, w, h);
} | [
"public",
"Shape",
"createScrollButtonTogetherIncrease",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"w",
",",
"int",
"h",
")",
"{",
"return",
"createRectangle",
"(",
"x",
",",
"y",
",",
"w",
",",
"h",
")",
";",
"}"
] | Return a path for a scroll bar increase button. This is used when the
buttons are placed together at one end of the scroll bar.
@param x the X coordinate of the upper-left corner of the button
@param y the Y coordinate of the upper-left corner of the button
@param w the width of the button
@param h the height of t... | [
"Return",
"a",
"path",
"for",
"a",
"scroll",
"bar",
"increase",
"button",
".",
"This",
"is",
"used",
"when",
"the",
"buttons",
"are",
"placed",
"together",
"at",
"one",
"end",
"of",
"the",
"scroll",
"bar",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L712-L714 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java | DeletingWhileIterating.breakFollows | private boolean breakFollows(Loop loop, boolean needsPop) {
"""
looks to see if the following instruction is a GOTO, preceded by potentially a pop
@param loop
the loop structure we are checking
@param needsPop
whether we expect to see a pop next
@return whether a GOTO is found
"""
byte[] code... | java | private boolean breakFollows(Loop loop, boolean needsPop) {
byte[] code = getCode().getCode();
int nextPC = getNextPC();
if (needsPop) {
int popOp = CodeByteUtils.getbyte(code, nextPC++);
if (popOp != Const.POP) {
return false;
}
}
... | [
"private",
"boolean",
"breakFollows",
"(",
"Loop",
"loop",
",",
"boolean",
"needsPop",
")",
"{",
"byte",
"[",
"]",
"code",
"=",
"getCode",
"(",
")",
".",
"getCode",
"(",
")",
";",
"int",
"nextPC",
"=",
"getNextPC",
"(",
")",
";",
"if",
"(",
"needsPop... | looks to see if the following instruction is a GOTO, preceded by potentially a pop
@param loop
the loop structure we are checking
@param needsPop
whether we expect to see a pop next
@return whether a GOTO is found | [
"looks",
"to",
"see",
"if",
"the",
"following",
"instruction",
"is",
"a",
"GOTO",
"preceded",
"by",
"potentially",
"a",
"pop"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java#L346-L367 |
Crab2died/Excel4J | src/main/java/com/github/crab2died/ExcelUtils.java | ExcelUtils.exportObjects2Excel | public void exportObjects2Excel(String templatePath, List<?> data, Class clazz, OutputStream os)
throws Excel4JException {
"""
基于Excel模板与注解{@link com.github.crab2died.annotation.ExcelField}导出Excel
@param templatePath Excel模板路径
@param data 待导出数据的集合
@param clazz 映射对象Class
@param os ... | java | public void exportObjects2Excel(String templatePath, List<?> data, Class clazz, OutputStream os)
throws Excel4JException {
exportObjects2Excel(templatePath, 0, data, null, clazz, true, os);
} | [
"public",
"void",
"exportObjects2Excel",
"(",
"String",
"templatePath",
",",
"List",
"<",
"?",
">",
"data",
",",
"Class",
"clazz",
",",
"OutputStream",
"os",
")",
"throws",
"Excel4JException",
"{",
"exportObjects2Excel",
"(",
"templatePath",
",",
"0",
",",
"da... | 基于Excel模板与注解{@link com.github.crab2died.annotation.ExcelField}导出Excel
@param templatePath Excel模板路径
@param data 待导出数据的集合
@param clazz 映射对象Class
@param os 生成的Excel待输出数据流
@throws Excel4JException 异常
@author Crab2Died | [
"基于Excel模板与注解",
"{",
"@link",
"com",
".",
"github",
".",
"crab2died",
".",
"annotation",
".",
"ExcelField",
"}",
"导出Excel"
] | train | https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L606-L610 |
roboconf/roboconf-platform | core/roboconf-dm/src/main/java/net/roboconf/dm/internal/utils/ConfigurationUtils.java | ConfigurationUtils.loadApplicationBindings | public static void loadApplicationBindings( Application app ) {
"""
Loads the application bindings into an application.
@param app a non-null application
@param configurationDirectory the DM's configuration directory
"""
File descDir = new File( app.getDirectory(), Constants.PROJECT_DIR_DESC );
File app... | java | public static void loadApplicationBindings( Application app ) {
File descDir = new File( app.getDirectory(), Constants.PROJECT_DIR_DESC );
File appBindingsFile = new File( descDir, APP_BINDINGS_FILE );
Logger logger = Logger.getLogger( ConfigurationUtils.class.getName());
Properties props = Utils.readProperti... | [
"public",
"static",
"void",
"loadApplicationBindings",
"(",
"Application",
"app",
")",
"{",
"File",
"descDir",
"=",
"new",
"File",
"(",
"app",
".",
"getDirectory",
"(",
")",
",",
"Constants",
".",
"PROJECT_DIR_DESC",
")",
";",
"File",
"appBindingsFile",
"=",
... | Loads the application bindings into an application.
@param app a non-null application
@param configurationDirectory the DM's configuration directory | [
"Loads",
"the",
"application",
"bindings",
"into",
"an",
"application",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/utils/ConfigurationUtils.java#L181-L194 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.getWorkplaceExplorerLink | public static String getWorkplaceExplorerLink(final CmsObject cms, final String explorerRootPath) {
"""
Creates a link for the OpenCms workplace that will reload the whole workplace, switch to the explorer view, the
site of the given explorerRootPath and show the folder given in the explorerRootPath.
<p>
@par... | java | public static String getWorkplaceExplorerLink(final CmsObject cms, final String explorerRootPath) {
// split the root site:
String targetSiteRoot = OpenCms.getSiteManager().getSiteRoot(explorerRootPath);
if (targetSiteRoot == null) {
if (OpenCms.getSiteManager().startsWithShared(exp... | [
"public",
"static",
"String",
"getWorkplaceExplorerLink",
"(",
"final",
"CmsObject",
"cms",
",",
"final",
"String",
"explorerRootPath",
")",
"{",
"// split the root site:",
"String",
"targetSiteRoot",
"=",
"OpenCms",
".",
"getSiteManager",
"(",
")",
".",
"getSiteRoot"... | Creates a link for the OpenCms workplace that will reload the whole workplace, switch to the explorer view, the
site of the given explorerRootPath and show the folder given in the explorerRootPath.
<p>
@param cms
the cms object
@param explorerRootPath
a root relative folder link (has to end with '/').
@return a link... | [
"Creates",
"a",
"link",
"for",
"the",
"OpenCms",
"workplace",
"that",
"will",
"reload",
"the",
"whole",
"workplace",
"switch",
"to",
"the",
"explorer",
"view",
"the",
"site",
"of",
"the",
"given",
"explorerRootPath",
"and",
"show",
"the",
"folder",
"given",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L773-L814 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java | EmbeddedNeo4jEntityQueries.createEmbedded | public Node createEmbedded(GraphDatabaseService executionEngine, Object[] columnValues) {
"""
Create a single node representing an embedded element.
@param executionEngine the {@link GraphDatabaseService} used to run the query
@param columnValues the values in {@link org.hibernate.ogm.model.key.spi.EntityKey#g... | java | public Node createEmbedded(GraphDatabaseService executionEngine, Object[] columnValues) {
Map<String, Object> params = params( columnValues );
Result result = executionEngine.execute( getCreateEmbeddedNodeQuery(), params );
return singleResult( result );
} | [
"public",
"Node",
"createEmbedded",
"(",
"GraphDatabaseService",
"executionEngine",
",",
"Object",
"[",
"]",
"columnValues",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
"=",
"params",
"(",
"columnValues",
")",
";",
"Result",
"result",
"=",
... | Create a single node representing an embedded element.
@param executionEngine the {@link GraphDatabaseService} used to run the query
@param columnValues the values in {@link org.hibernate.ogm.model.key.spi.EntityKey#getColumnValues()}
@return the corresponding node; | [
"Create",
"a",
"single",
"node",
"representing",
"an",
"embedded",
"element",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java#L66-L70 |
BioPAX/Paxtools | normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java | MiriamLink.getURI | public static String getURI(String name, String id) {
"""
Retrieves the unique MIRIAM URI of a specific entity (example: "urn:miriam:obo.go:GO%3A0045202").
@param name - name, URI/URL, or ID of a data type (examples: "ChEBI", "MIR:00000005")
@param id identifier of an entity within the data type (examples: "GO... | java | public static String getURI(String name, String id)
{
Datatype datatype = getDatatype(name);
String db = datatype.getName();
if(checkRegExp(id, db)) {
try {
return getOfficialDataTypeURI(datatype) + ":" + URLEncoder.encode(id, "UTF-8");
} catch (UnsupportedEncodingException e) {
thro... | [
"public",
"static",
"String",
"getURI",
"(",
"String",
"name",
",",
"String",
"id",
")",
"{",
"Datatype",
"datatype",
"=",
"getDatatype",
"(",
"name",
")",
";",
"String",
"db",
"=",
"datatype",
".",
"getName",
"(",
")",
";",
"if",
"(",
"checkRegExp",
"... | Retrieves the unique MIRIAM URI of a specific entity (example: "urn:miriam:obo.go:GO%3A0045202").
@param name - name, URI/URL, or ID of a data type (examples: "ChEBI", "MIR:00000005")
@param id identifier of an entity within the data type (examples: "GO:0045202", "P62158")
@return unique standard MIRIAM URI of a given... | [
"Retrieves",
"the",
"unique",
"MIRIAM",
"URI",
"of",
"a",
"specific",
"entity",
"(",
"example",
":",
"urn",
":",
"miriam",
":",
"obo",
".",
"go",
":",
"GO%3A0045202",
")",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java#L192-L206 |
deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/v2/ModelParameterServer.java | ModelParameterServer.configure | public void configure(@NonNull VoidConfiguration configuration, @NonNull Transport transport, @NonNull UpdaterParametersProvider updaterProvider) {
"""
This method stores provided entities for MPS internal use
@param configuration
@param transport
@param isMasterNode
"""
this.transport = transport... | java | public void configure(@NonNull VoidConfiguration configuration, @NonNull Transport transport, @NonNull UpdaterParametersProvider updaterProvider) {
this.transport = transport;
this.masterMode = false;
this.configuration = configuration;
this.updaterParametersProvider = updaterProvider;
... | [
"public",
"void",
"configure",
"(",
"@",
"NonNull",
"VoidConfiguration",
"configuration",
",",
"@",
"NonNull",
"Transport",
"transport",
",",
"@",
"NonNull",
"UpdaterParametersProvider",
"updaterProvider",
")",
"{",
"this",
".",
"transport",
"=",
"transport",
";",
... | This method stores provided entities for MPS internal use
@param configuration
@param transport
@param isMasterNode | [
"This",
"method",
"stores",
"provided",
"entities",
"for",
"MPS",
"internal",
"use"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/v2/ModelParameterServer.java#L166-L171 |
Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/utils/UtilMongoDB.java | UtilMongoDB.subDocumentListCase | private static <T> Object subDocumentListCase(Type type, List<T> bsonOject)
throws IllegalAccessException, InstantiationException, InvocationTargetException {
"""
Sub document list case.
@param <T> the type parameter
@param type the type
@param bsonOject the bson oject
@return the obje... | java | private static <T> Object subDocumentListCase(Type type, List<T> bsonOject)
throws IllegalAccessException, InstantiationException, InvocationTargetException {
ParameterizedType listType = (ParameterizedType) type;
Class<?> listClass = (Class<?>) listType.getActualTypeArguments()[0];
... | [
"private",
"static",
"<",
"T",
">",
"Object",
"subDocumentListCase",
"(",
"Type",
"type",
",",
"List",
"<",
"T",
">",
"bsonOject",
")",
"throws",
"IllegalAccessException",
",",
"InstantiationException",
",",
"InvocationTargetException",
"{",
"ParameterizedType",
"li... | Sub document list case.
@param <T> the type parameter
@param type the type
@param bsonOject the bson oject
@return the object
@throws IllegalAccessException the illegal access exception
@throws InstantiationException the instantiation exception
@throws InvocationTargetException the invocation target e... | [
"Sub",
"document",
"list",
"case",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/utils/UtilMongoDB.java#L133-L145 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.listDataLakeStoreAccountsWithServiceResponseAsync | public Observable<ServiceResponse<Page<DataLakeStoreAccountInfoInner>>> listDataLakeStoreAccountsWithServiceResponseAsync(final String resourceGroupName, final String accountName) {
"""
Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link... | java | public Observable<ServiceResponse<Page<DataLakeStoreAccountInfoInner>>> listDataLakeStoreAccountsWithServiceResponseAsync(final String resourceGroupName, final String accountName) {
return listDataLakeStoreAccountsSinglePageAsync(resourceGroupName, accountName)
.concatMap(new Func1<ServiceResponse<P... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"DataLakeStoreAccountInfoInner",
">",
">",
">",
"listDataLakeStoreAccountsWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
")",
"{",
"return",
... | Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.
@param accountName The name of the Data Lake Analytics... | [
"Gets",
"the",
"first",
"page",
"of",
"Data",
"Lake",
"Store",
"accounts",
"linked",
"to",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
".",
"The",
"response",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"if",
"any",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java#L1581-L1593 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/block/component/ColorComponent.java | ColorComponent.getColor | public static EnumDyeColor getColor(IBlockAccess world, BlockPos pos) {
"""
Gets the {@link EnumDyeColor color} for the {@link Block} at world coords.
@param world the world
@param pos the pos
@return the EnumDyeColor, null if the block is not {@link ColorComponent}
"""
return world != null && pos != nu... | java | public static EnumDyeColor getColor(IBlockAccess world, BlockPos pos)
{
return world != null && pos != null ? getColor(world.getBlockState(pos)) : EnumDyeColor.WHITE;
} | [
"public",
"static",
"EnumDyeColor",
"getColor",
"(",
"IBlockAccess",
"world",
",",
"BlockPos",
"pos",
")",
"{",
"return",
"world",
"!=",
"null",
"&&",
"pos",
"!=",
"null",
"?",
"getColor",
"(",
"world",
".",
"getBlockState",
"(",
"pos",
")",
")",
":",
"E... | Gets the {@link EnumDyeColor color} for the {@link Block} at world coords.
@param world the world
@param pos the pos
@return the EnumDyeColor, null if the block is not {@link ColorComponent} | [
"Gets",
"the",
"{",
"@link",
"EnumDyeColor",
"color",
"}",
"for",
"the",
"{",
"@link",
"Block",
"}",
"at",
"world",
"coords",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/block/component/ColorComponent.java#L203-L206 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/cellconverter/impl/AbstractDateCellConverterFactory.java | AbstractDateCellConverterFactory.parseString | protected T parseString(final DateFormat formatter, final String text) throws ParseException {
"""
文字列をパースして対応するオブジェクトに変換する
@param formatter フォーマッタ
@param text パース対象の文字列
@return パースした結果
@throws ParseException
"""
Date date = formatter.parse(text);
return convertTypeValue(date);
} | java | protected T parseString(final DateFormat formatter, final String text) throws ParseException {
Date date = formatter.parse(text);
return convertTypeValue(date);
} | [
"protected",
"T",
"parseString",
"(",
"final",
"DateFormat",
"formatter",
",",
"final",
"String",
"text",
")",
"throws",
"ParseException",
"{",
"Date",
"date",
"=",
"formatter",
".",
"parse",
"(",
"text",
")",
";",
"return",
"convertTypeValue",
"(",
"date",
... | 文字列をパースして対応するオブジェクトに変換する
@param formatter フォーマッタ
@param text パース対象の文字列
@return パースした結果
@throws ParseException | [
"文字列をパースして対応するオブジェクトに変換する"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/cellconverter/impl/AbstractDateCellConverterFactory.java#L90-L93 |
actorapp/actor-platform | actor-sdk/sdk-core/runtime/runtime-android/src/main/java/im/actor/runtime/android/crypto/PRNGFixes.java | PRNGFixes.getDeviceSerialNumber | private static String getDeviceSerialNumber() {
"""
Gets the hardware serial number of this device.
@return serial number or {@code null} if not available.
"""
// We're using the Reflection API because Build.SERIAL is only available
// since API Level 9 (Gingerbread, Android 2.3).
tr... | java | private static String getDeviceSerialNumber() {
// We're using the Reflection API because Build.SERIAL is only available
// since API Level 9 (Gingerbread, Android 2.3).
try {
return (String) Build.class.getField("SERIAL").get(null);
} catch (Exception ignored) {
... | [
"private",
"static",
"String",
"getDeviceSerialNumber",
"(",
")",
"{",
"// We're using the Reflection API because Build.SERIAL is only available",
"// since API Level 9 (Gingerbread, Android 2.3).",
"try",
"{",
"return",
"(",
"String",
")",
"Build",
".",
"class",
".",
"getField... | Gets the hardware serial number of this device.
@return serial number or {@code null} if not available. | [
"Gets",
"the",
"hardware",
"serial",
"number",
"of",
"this",
"device",
"."
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/runtime/runtime-android/src/main/java/im/actor/runtime/android/crypto/PRNGFixes.java#L326-L334 |
groovy/groovy-core | src/main/groovy/xml/QName.java | QName.valueOf | public static QName valueOf(String s) {
"""
Returns a QName holding the value of the specified String.
<p>
The string must be in the form returned by the QName.toString()
method, i.e. "{namespaceURI}localPart", with the "{namespaceURI}"
part being optional.
<p>
This method doesn't do a full validation of the... | java | public static QName valueOf(String s) {
if ((s == null) || s.equals("")) {
throw new IllegalArgumentException("invalid QName literal");
}
if (s.charAt(0) == '{') {
int i = s.indexOf('}');
if (i == -1) {
throw new IllegalArgumentException("in... | [
"public",
"static",
"QName",
"valueOf",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"(",
"s",
"==",
"null",
")",
"||",
"s",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"invalid QName literal\"",
")",
";",
... | Returns a QName holding the value of the specified String.
<p>
The string must be in the form returned by the QName.toString()
method, i.e. "{namespaceURI}localPart", with the "{namespaceURI}"
part being optional.
<p>
This method doesn't do a full validation of the resulting QName.
In particular, it doesn't check that ... | [
"Returns",
"a",
"QName",
"holding",
"the",
"value",
"of",
"the",
"specified",
"String",
".",
"<p",
">",
"The",
"string",
"must",
"be",
"in",
"the",
"form",
"returned",
"by",
"the",
"QName",
".",
"toString",
"()",
"method",
"i",
".",
"e",
".",
"{",
"n... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/xml/QName.java#L251-L272 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/xml/RaXmlGen.java | RaXmlGen.writeRequireConfigPropsXml | void writeRequireConfigPropsXml(List<ConfigPropType> props, Writer out, int indent) throws IOException {
"""
Output required config props xml part
@param props config properties
@param out Writer
@param indent space number
@throws IOException ioException
"""
if (props == null || props.size() ==... | java | void writeRequireConfigPropsXml(List<ConfigPropType> props, Writer out, int indent) throws IOException
{
if (props == null || props.size() == 0)
return;
for (ConfigPropType prop : props)
{
if (prop.isRequired())
{
writeIndent(out, indent);
out.writ... | [
"void",
"writeRequireConfigPropsXml",
"(",
"List",
"<",
"ConfigPropType",
">",
"props",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"if",
"(",
"props",
"==",
"null",
"||",
"props",
".",
"size",
"(",
")",
"==",
"0",
")",... | Output required config props xml part
@param props config properties
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"required",
"config",
"props",
"xml",
"part"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/xml/RaXmlGen.java#L211-L233 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/sax/Excel07SaxReader.java | Excel07SaxReader.fillBlankCell | private void fillBlankCell(String preCoordinate, String curCoordinate, boolean isEnd) {
"""
填充空白单元格,如果前一个单元格大于后一个,不需要填充<br>
@param preCoordinate 前一个单元格坐标
@param curCoordinate 当前单元格坐标
@param isEnd 是否为最后一个单元格
"""
if (false == curCoordinate.equals(preCoordinate)) {
int len = ExcelSaxUtil.countNullCell... | java | private void fillBlankCell(String preCoordinate, String curCoordinate, boolean isEnd) {
if (false == curCoordinate.equals(preCoordinate)) {
int len = ExcelSaxUtil.countNullCell(preCoordinate, curCoordinate);
if (isEnd) {
len++;
}
while (len-- > 0) {
rowCellList.add(curCell++, "");
}
... | [
"private",
"void",
"fillBlankCell",
"(",
"String",
"preCoordinate",
",",
"String",
"curCoordinate",
",",
"boolean",
"isEnd",
")",
"{",
"if",
"(",
"false",
"==",
"curCoordinate",
".",
"equals",
"(",
"preCoordinate",
")",
")",
"{",
"int",
"len",
"=",
"ExcelSax... | 填充空白单元格,如果前一个单元格大于后一个,不需要填充<br>
@param preCoordinate 前一个单元格坐标
@param curCoordinate 当前单元格坐标
@param isEnd 是否为最后一个单元格 | [
"填充空白单元格,如果前一个单元格大于后一个,不需要填充<br",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/sax/Excel07SaxReader.java#L347-L357 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.disableScheduling | public void disableScheduling(String poolId, String nodeId) {
"""
Disables task scheduling on the specified compute node.
You can disable task scheduling on a node only if its current scheduling state is enabled.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the comp... | java | public void disableScheduling(String poolId, String nodeId) {
disableSchedulingWithServiceResponseAsync(poolId, nodeId).toBlocking().single().body();
} | [
"public",
"void",
"disableScheduling",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
")",
"{",
"disableSchedulingWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeId",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"(",
")",
";... | Disables task scheduling on the specified compute node.
You can disable task scheduling on a node only if its current scheduling state is enabled.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node on which you want to disable task scheduling.
@throws IllegalArgum... | [
"Disables",
"task",
"scheduling",
"on",
"the",
"specified",
"compute",
"node",
".",
"You",
"can",
"disable",
"task",
"scheduling",
"on",
"a",
"node",
"only",
"if",
"its",
"current",
"scheduling",
"state",
"is",
"enabled",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L1502-L1504 |
zaproxy/zaproxy | src/org/parosproxy/paros/network/HttpSender.java | HttpSender.sendAndReceiveImpl | private void sendAndReceiveImpl(HttpMessage message, HttpRequestConfig requestConfig) throws IOException {
"""
Helper method that sends the request of the given HTTP {@code message} with the given configurations.
<p>
No redirections are followed (see {@link #followRedirections(HttpMessage, HttpRequestConfig)}).
... | java | private void sendAndReceiveImpl(HttpMessage message, HttpRequestConfig requestConfig) throws IOException {
if (log.isDebugEnabled()) {
log.debug("Sending " + message.getRequestHeader().getMethod() + " " + message.getRequestHeader().getURI());
}
message.setTimeSentMillis(System.cu... | [
"private",
"void",
"sendAndReceiveImpl",
"(",
"HttpMessage",
"message",
",",
"HttpRequestConfig",
"requestConfig",
")",
"throws",
"IOException",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Sending \"",
"+",
"m... | Helper method that sends the request of the given HTTP {@code message} with the given configurations.
<p>
No redirections are followed (see {@link #followRedirections(HttpMessage, HttpRequestConfig)}).
@param message the message that will be sent.
@param requestConfig the request configurations.
@throws IOException if... | [
"Helper",
"method",
"that",
"sends",
"the",
"request",
"of",
"the",
"given",
"HTTP",
"{",
"@code",
"message",
"}",
"with",
"the",
"given",
"configurations",
".",
"<p",
">",
"No",
"redirections",
"are",
"followed",
"(",
"see",
"{",
"@link",
"#followRedirectio... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/HttpSender.java#L901-L932 |
netty/netty | transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java | ServerBootstrap.childOption | public <T> ServerBootstrap childOption(ChannelOption<T> childOption, T value) {
"""
Allow to specify a {@link ChannelOption} which is used for the {@link Channel} instances once they get created
(after the acceptor accepted the {@link Channel}). Use a value of {@code null} to remove a previous set
{@link Channel... | java | public <T> ServerBootstrap childOption(ChannelOption<T> childOption, T value) {
if (childOption == null) {
throw new NullPointerException("childOption");
}
if (value == null) {
synchronized (childOptions) {
childOptions.remove(childOption);
}
... | [
"public",
"<",
"T",
">",
"ServerBootstrap",
"childOption",
"(",
"ChannelOption",
"<",
"T",
">",
"childOption",
",",
"T",
"value",
")",
"{",
"if",
"(",
"childOption",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"childOption\"",
")",... | Allow to specify a {@link ChannelOption} which is used for the {@link Channel} instances once they get created
(after the acceptor accepted the {@link Channel}). Use a value of {@code null} to remove a previous set
{@link ChannelOption}. | [
"Allow",
"to",
"specify",
"a",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java#L97-L111 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeValidator.java | TypeValidator.expectITemplateArraySupertype | void expectITemplateArraySupertype(Node n, JSType type, String msg) {
"""
Expect the type to be an ITemplateArray or supertype of ITemplateArray.
"""
if (!getNativeType(I_TEMPLATE_ARRAY_TYPE).isSubtypeOf(type)) {
mismatch(n, msg, type, I_TEMPLATE_ARRAY_TYPE);
}
} | java | void expectITemplateArraySupertype(Node n, JSType type, String msg) {
if (!getNativeType(I_TEMPLATE_ARRAY_TYPE).isSubtypeOf(type)) {
mismatch(n, msg, type, I_TEMPLATE_ARRAY_TYPE);
}
} | [
"void",
"expectITemplateArraySupertype",
"(",
"Node",
"n",
",",
"JSType",
"type",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"!",
"getNativeType",
"(",
"I_TEMPLATE_ARRAY_TYPE",
")",
".",
"isSubtypeOf",
"(",
"type",
")",
")",
"{",
"mismatch",
"(",
"n",
",",... | Expect the type to be an ITemplateArray or supertype of ITemplateArray. | [
"Expect",
"the",
"type",
"to",
"be",
"an",
"ITemplateArray",
"or",
"supertype",
"of",
"ITemplateArray",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L353-L357 |
datastax/java-driver | query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java | SchemaBuilder.dropAggregate | @NonNull
public static Drop dropAggregate(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier aggregateName) {
"""
Starts an DROP AGGREGATE query for the given aggregate name for the given keyspace name.
"""
return new DefaultDrop(keyspace, aggregateName, "AGGREGATE");
} | java | @NonNull
public static Drop dropAggregate(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier aggregateName) {
return new DefaultDrop(keyspace, aggregateName, "AGGREGATE");
} | [
"@",
"NonNull",
"public",
"static",
"Drop",
"dropAggregate",
"(",
"@",
"Nullable",
"CqlIdentifier",
"keyspace",
",",
"@",
"NonNull",
"CqlIdentifier",
"aggregateName",
")",
"{",
"return",
"new",
"DefaultDrop",
"(",
"keyspace",
",",
"aggregateName",
",",
"\"AGGREGAT... | Starts an DROP AGGREGATE query for the given aggregate name for the given keyspace name. | [
"Starts",
"an",
"DROP",
"AGGREGATE",
"query",
"for",
"the",
"given",
"aggregate",
"name",
"for",
"the",
"given",
"keyspace",
"name",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L589-L593 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_voipLine_options_hardwares_GET | public ArrayList<OvhVoIPHardware> packName_voipLine_options_hardwares_GET(String packName) throws IOException {
"""
Get available hardwares
REST: GET /pack/xdsl/{packName}/voipLine/options/hardwares
@param packName [required] The internal name of your pack
"""
String qPath = "/pack/xdsl/{packName}/voipLi... | java | public ArrayList<OvhVoIPHardware> packName_voipLine_options_hardwares_GET(String packName) throws IOException {
String qPath = "/pack/xdsl/{packName}/voipLine/options/hardwares";
StringBuilder sb = path(qPath, packName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t5);
} | [
"public",
"ArrayList",
"<",
"OvhVoIPHardware",
">",
"packName_voipLine_options_hardwares_GET",
"(",
"String",
"packName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/pack/xdsl/{packName}/voipLine/options/hardwares\"",
";",
"StringBuilder",
"sb",
"=",
"pat... | Get available hardwares
REST: GET /pack/xdsl/{packName}/voipLine/options/hardwares
@param packName [required] The internal name of your pack | [
"Get",
"available",
"hardwares"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L301-L306 |
att/AAF | authz/authz-cass/src/main/java/com/att/dao/aaf/hl/Function.java | Function.addUserRole | public Result<Void> addUserRole(AuthzTrans trans,UserRoleDAO.Data urData) {
"""
Add a User to Role
1) Role must exist 2) User must be a known Credential (i.e. mechID ok if
Credential) or known Organizational User
@param trans
@param org
@param urData
@return
@throws DAOException
"""
Result<Void> r... | java | public Result<Void> addUserRole(AuthzTrans trans,UserRoleDAO.Data urData) {
Result<Void> rv;
if(Question.ADMIN.equals(urData.rname)) {
rv = mayAddAdmin(trans, urData.ns, urData.user);
} else if(Question.OWNER.equals(urData.rname)) {
rv = mayAddOwner(trans, urData.ns, urData.user);
} else {
rv = checkVa... | [
"public",
"Result",
"<",
"Void",
">",
"addUserRole",
"(",
"AuthzTrans",
"trans",
",",
"UserRoleDAO",
".",
"Data",
"urData",
")",
"{",
"Result",
"<",
"Void",
">",
"rv",
";",
"if",
"(",
"Question",
".",
"ADMIN",
".",
"equals",
"(",
"urData",
".",
"rname"... | Add a User to Role
1) Role must exist 2) User must be a known Credential (i.e. mechID ok if
Credential) or known Organizational User
@param trans
@param org
@param urData
@return
@throws DAOException | [
"Add",
"a",
"User",
"to",
"Role"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-cass/src/main/java/com/att/dao/aaf/hl/Function.java#L1246-L1279 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.queryBlockByHash | public BlockInfo queryBlockByHash(Collection<Peer> peers, byte[] blockHash, User userContext) throws InvalidArgumentException, ProposalException {
"""
Query a peer in this channel for a Block by the block hash.
@param peers the Peers to query.
@param blockHash the hash of the Block in the chain.
@para... | java | public BlockInfo queryBlockByHash(Collection<Peer> peers, byte[] blockHash, User userContext) throws InvalidArgumentException, ProposalException {
checkChannelState();
checkPeers(peers);
userContextCheck(userContext);
if (blockHash == null) {
throw new InvalidArgumentExcept... | [
"public",
"BlockInfo",
"queryBlockByHash",
"(",
"Collection",
"<",
"Peer",
">",
"peers",
",",
"byte",
"[",
"]",
"blockHash",
",",
"User",
"userContext",
")",
"throws",
"InvalidArgumentException",
",",
"ProposalException",
"{",
"checkChannelState",
"(",
")",
";",
... | Query a peer in this channel for a Block by the block hash.
@param peers the Peers to query.
@param blockHash the hash of the Block in the chain.
@param userContext the user context
@return the {@link BlockInfo} with the given block Hash
@throws InvalidArgumentException if the channel is shutdown or any of the... | [
"Query",
"a",
"peer",
"in",
"this",
"channel",
"for",
"a",
"Block",
"by",
"the",
"block",
"hash",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L2715-L2741 |
infinispan/infinispan | counter/src/main/java/org/infinispan/counter/impl/weak/WeakCounterImpl.java | WeakCounterImpl.removeWeakCounter | public static void removeWeakCounter(Cache<WeakCounterKey, CounterValue> cache, CounterConfiguration configuration,
String counterName) {
"""
It removes a weak counter from the {@code cache}, identified by the {@code counterName}.
@param cache The {@link Cache} to remove the counter from.
@par... | java | public static void removeWeakCounter(Cache<WeakCounterKey, CounterValue> cache, CounterConfiguration configuration,
String counterName) {
ByteString counterNameByteString = ByteString.fromString(counterName);
for (int i = 0; i < configuration.concurrencyLevel(); ++i) {
cache.remove(new Wea... | [
"public",
"static",
"void",
"removeWeakCounter",
"(",
"Cache",
"<",
"WeakCounterKey",
",",
"CounterValue",
">",
"cache",
",",
"CounterConfiguration",
"configuration",
",",
"String",
"counterName",
")",
"{",
"ByteString",
"counterNameByteString",
"=",
"ByteString",
"."... | It removes a weak counter from the {@code cache}, identified by the {@code counterName}.
@param cache The {@link Cache} to remove the counter from.
@param configuration The counter's configuration.
@param counterName The counter's name. | [
"It",
"removes",
"a",
"weak",
"counter",
"from",
"the",
"{",
"@code",
"cache",
"}",
"identified",
"by",
"the",
"{",
"@code",
"counterName",
"}",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/counter/src/main/java/org/infinispan/counter/impl/weak/WeakCounterImpl.java#L113-L119 |
pmayweg/sonar-groovy | sonar-groovy-plugin/src/main/java/org/sonar/plugins/groovy/jacoco/JaCoCoReportReader.java | JaCoCoReportReader.readJacocoReport | public JaCoCoReportReader readJacocoReport(IExecutionDataVisitor executionDataVisitor, ISessionInfoVisitor sessionInfoStore) {
"""
Read JaCoCo report determining the format to be used.
@param executionDataVisitor visitor to store execution data.
@param sessionInfoStore visitor to store info session.
@return tru... | java | public JaCoCoReportReader readJacocoReport(IExecutionDataVisitor executionDataVisitor, ISessionInfoVisitor sessionInfoStore) {
if (jacocoExecutionData == null) {
return this;
}
JaCoCoExtensions.logger().info("Analysing {}", jacocoExecutionData);
try (InputStream inputStream = new BufferedInputStr... | [
"public",
"JaCoCoReportReader",
"readJacocoReport",
"(",
"IExecutionDataVisitor",
"executionDataVisitor",
",",
"ISessionInfoVisitor",
"sessionInfoStore",
")",
"{",
"if",
"(",
"jacocoExecutionData",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"JaCoCoExtensions",
... | Read JaCoCo report determining the format to be used.
@param executionDataVisitor visitor to store execution data.
@param sessionInfoStore visitor to store info session.
@return true if binary format is the latest one.
@throws IOException in case of error or binary format not supported. | [
"Read",
"JaCoCo",
"report",
"determining",
"the",
"format",
"to",
"be",
"used",
"."
] | train | https://github.com/pmayweg/sonar-groovy/blob/2d78d6578304601613db928795d81de340e6fa34/sonar-groovy-plugin/src/main/java/org/sonar/plugins/groovy/jacoco/JaCoCoReportReader.java#L56-L78 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java | VelocityUtil.toWriter | public static void toWriter(String templateFileName, VelocityContext context, Writer writer) {
"""
生成内容写入流<br>
会自动关闭Writer
@param templateFileName 模板文件名
@param context 上下文
@param writer 流
"""
assertInit();
final Template template = Velocity.getTemplate(templateFileName);
merge(template, contex... | java | public static void toWriter(String templateFileName, VelocityContext context, Writer writer) {
assertInit();
final Template template = Velocity.getTemplate(templateFileName);
merge(template, context, writer);
} | [
"public",
"static",
"void",
"toWriter",
"(",
"String",
"templateFileName",
",",
"VelocityContext",
"context",
",",
"Writer",
"writer",
")",
"{",
"assertInit",
"(",
")",
";",
"final",
"Template",
"template",
"=",
"Velocity",
".",
"getTemplate",
"(",
"templateFile... | 生成内容写入流<br>
会自动关闭Writer
@param templateFileName 模板文件名
@param context 上下文
@param writer 流 | [
"生成内容写入流<br",
">",
"会自动关闭Writer"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java#L199-L204 |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/price/Price.java | Price.createFromGrossAmount | @Nonnull
public static Price createFromGrossAmount (@Nonnull final ECurrency eCurrency,
@Nonnull final BigDecimal aGrossAmount,
@Nonnull final IVATItem aVATItem,
@Nonnegative final in... | java | @Nonnull
public static Price createFromGrossAmount (@Nonnull final ECurrency eCurrency,
@Nonnull final BigDecimal aGrossAmount,
@Nonnull final IVATItem aVATItem,
@Nonnegative final in... | [
"@",
"Nonnull",
"public",
"static",
"Price",
"createFromGrossAmount",
"(",
"@",
"Nonnull",
"final",
"ECurrency",
"eCurrency",
",",
"@",
"Nonnull",
"final",
"BigDecimal",
"aGrossAmount",
",",
"@",
"Nonnull",
"final",
"IVATItem",
"aVATItem",
",",
"@",
"Nonnegative",... | Create a price from a gross amount.
@param eCurrency
Currency to use. May not be <code>null</code>.
@param aGrossAmount
The gross amount to use. May not be <code>null</code>.
@param aVATItem
The VAT item to use. May not be <code>null</code>.
@param nScale
The scaling to be used for the resulting amount, in case
<code>... | [
"Create",
"a",
"price",
"from",
"a",
"gross",
"amount",
"."
] | train | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/price/Price.java#L290-L306 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/QueryByCriteria.java | QueryByCriteria.setPathClass | public void setPathClass(String aPath, Class aClass) {
"""
Set the Class for a path. Used for relationships to extents.<br>
SqlStatment will use this class when resolving the path.
Without this hint SqlStatment will use the base class the
relationship points to ie: Article instead of CdArticle.
Using this meth... | java | public void setPathClass(String aPath, Class aClass)
{
List pathClasses = new ArrayList();
pathClasses.add(aClass);
m_pathClasses.put(aPath, pathClasses);
} | [
"public",
"void",
"setPathClass",
"(",
"String",
"aPath",
",",
"Class",
"aClass",
")",
"{",
"List",
"pathClasses",
"=",
"new",
"ArrayList",
"(",
")",
";",
"pathClasses",
".",
"add",
"(",
"aClass",
")",
";",
"m_pathClasses",
".",
"put",
"(",
"aPath",
",",... | Set the Class for a path. Used for relationships to extents.<br>
SqlStatment will use this class when resolving the path.
Without this hint SqlStatment will use the base class the
relationship points to ie: Article instead of CdArticle.
Using this method is the same as adding just one hint
@param aPath the path segmen... | [
"Set",
"the",
"Class",
"for",
"a",
"path",
".",
"Used",
"for",
"relationships",
"to",
"extents",
".",
"<br",
">",
"SqlStatment",
"will",
"use",
"this",
"class",
"when",
"resolving",
"the",
"path",
".",
"Without",
"this",
"hint",
"SqlStatment",
"will",
"use... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/QueryByCriteria.java#L216-L221 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/splitter/DistcpFileSplitter.java | DistcpFileSplitter.mergeSplits | private static WorkUnitState mergeSplits(FileSystem fs, CopyableFile file, Collection<WorkUnitState> workUnits,
Path parentPath) throws IOException {
"""
Merges all the splits for a given file.
Should be called on the target/destination file system (after blocks have been copied to targetFs).
@param fs {@l... | java | private static WorkUnitState mergeSplits(FileSystem fs, CopyableFile file, Collection<WorkUnitState> workUnits,
Path parentPath) throws IOException {
log.info(String.format("File %s was written in %d parts. Merging.", file.getDestination(), workUnits.size()));
Path[] parts = new Path[workUnits.size()];
... | [
"private",
"static",
"WorkUnitState",
"mergeSplits",
"(",
"FileSystem",
"fs",
",",
"CopyableFile",
"file",
",",
"Collection",
"<",
"WorkUnitState",
">",
"workUnits",
",",
"Path",
"parentPath",
")",
"throws",
"IOException",
"{",
"log",
".",
"info",
"(",
"String",... | Merges all the splits for a given file.
Should be called on the target/destination file system (after blocks have been copied to targetFs).
@param fs {@link FileSystem} where file parts exist.
@param file {@link CopyableFile} to merge.
@param workUnits {@link WorkUnitState}s for all parts of this file.
@param parentPat... | [
"Merges",
"all",
"the",
"splits",
"for",
"a",
"given",
"file",
".",
"Should",
"be",
"called",
"on",
"the",
"target",
"/",
"destination",
"file",
"system",
"(",
"after",
"blocks",
"have",
"been",
"copied",
"to",
"targetFs",
")",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/splitter/DistcpFileSplitter.java#L186-L207 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Scroller.java | Scroller.scrollView | public boolean scrollView(final View view, int direction) {
"""
Scrolls a ScrollView.
@param direction the direction to be scrolled
@return {@code true} if scrolling occurred, false if it did not
"""
if(view == null){
return false;
}
int height = view.getHeight();
height--;
int scrollTo = -1;... | java | public boolean scrollView(final View view, int direction){
if(view == null){
return false;
}
int height = view.getHeight();
height--;
int scrollTo = -1;
if (direction == DOWN) {
scrollTo = height;
}
else if (direction == UP) {
scrollTo = -height;
}
int originalY = view.getScrollY();
f... | [
"public",
"boolean",
"scrollView",
"(",
"final",
"View",
"view",
",",
"int",
"direction",
")",
"{",
"if",
"(",
"view",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"int",
"height",
"=",
"view",
".",
"getHeight",
"(",
")",
";",
"height",
"--",... | Scrolls a ScrollView.
@param direction the direction to be scrolled
@return {@code true} if scrolling occurred, false if it did not | [
"Scrolls",
"a",
"ScrollView",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Scroller.java#L105-L136 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/UserApi.java | UserApi.updateUser | public User updateUser(User user, CharSequence password) throws GitLabApiException {
"""
<p>Modifies an existing user. Only administrators can change attributes of a user.</p>
<pre><code>GitLab Endpoint: PUT /users</code></pre>
<p>The following properties of the provided User instance can be set during updat... | java | public User updateUser(User user, CharSequence password) throws GitLabApiException {
Form form = userToForm(user, null, password, false, false);
Response response = put(Response.Status.OK, form.asMap(), "users", user.getId());
return (response.readEntity(User.class));
} | [
"public",
"User",
"updateUser",
"(",
"User",
"user",
",",
"CharSequence",
"password",
")",
"throws",
"GitLabApiException",
"{",
"Form",
"form",
"=",
"userToForm",
"(",
"user",
",",
"null",
",",
"password",
",",
"false",
",",
"false",
")",
";",
"Response",
... | <p>Modifies an existing user. Only administrators can change attributes of a user.</p>
<pre><code>GitLab Endpoint: PUT /users</code></pre>
<p>The following properties of the provided User instance can be set during update:<pre><code> email (required) - Email
username (required) - Username
name (required) - Name
skype... | [
"<p",
">",
"Modifies",
"an",
"existing",
"user",
".",
"Only",
"administrators",
"can",
"change",
"attributes",
"of",
"a",
"user",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/UserApi.java#L492-L496 |
looly/hutool | hutool-log/src/main/java/cn/hutool/log/GlobalLogFactory.java | GlobalLogFactory.set | public static LogFactory set(Class<? extends LogFactory> logFactoryClass) {
"""
自定义日志实现
@see Slf4jLogFactory
@see Log4jLogFactory
@see Log4j2LogFactory
@see ApacheCommonsLogFactory
@see JdkLogFactory
@see ConsoleLogFactory
@param logFactoryClass 日志工厂类
@return 自定义的日志工厂类
"""
try {
return set(l... | java | public static LogFactory set(Class<? extends LogFactory> logFactoryClass) {
try {
return set(logFactoryClass.newInstance());
} catch (Exception e) {
throw new IllegalArgumentException("Can not instance LogFactory class!", e);
}
} | [
"public",
"static",
"LogFactory",
"set",
"(",
"Class",
"<",
"?",
"extends",
"LogFactory",
">",
"logFactoryClass",
")",
"{",
"try",
"{",
"return",
"set",
"(",
"logFactoryClass",
".",
"newInstance",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
... | 自定义日志实现
@see Slf4jLogFactory
@see Log4jLogFactory
@see Log4j2LogFactory
@see ApacheCommonsLogFactory
@see JdkLogFactory
@see ConsoleLogFactory
@param logFactoryClass 日志工厂类
@return 自定义的日志工厂类 | [
"自定义日志实现"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-log/src/main/java/cn/hutool/log/GlobalLogFactory.java#L50-L56 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java | SqlDateTimeUtils.dateSub | public static String dateSub(long ts, int days, TimeZone tz) {
"""
Do subtraction on date string.
@param ts the timestamp.
@param days days count you want to subtract.
@param tz time zone of the date time string
@return datetime string.
"""
ZoneId zoneId = tz.toZoneId();
Instant instant = Instant.... | java | public static String dateSub(long ts, int days, TimeZone tz) {
ZoneId zoneId = tz.toZoneId();
Instant instant = Instant.ofEpochMilli(ts);
ZonedDateTime zdt = ZonedDateTime.ofInstant(instant, zoneId);
long resultTs = zdt.minusDays(days).toInstant().toEpochMilli();
return dateFormat(resultTs, DATE_FORMAT_STRING... | [
"public",
"static",
"String",
"dateSub",
"(",
"long",
"ts",
",",
"int",
"days",
",",
"TimeZone",
"tz",
")",
"{",
"ZoneId",
"zoneId",
"=",
"tz",
".",
"toZoneId",
"(",
")",
";",
"Instant",
"instant",
"=",
"Instant",
".",
"ofEpochMilli",
"(",
"ts",
")",
... | Do subtraction on date string.
@param ts the timestamp.
@param days days count you want to subtract.
@param tz time zone of the date time string
@return datetime string. | [
"Do",
"subtraction",
"on",
"date",
"string",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L771-L777 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WLinkRenderer.java | WLinkRenderer.paintAjaxTrigger | private void paintAjaxTrigger(final WLink link, final XmlStringBuilder xml) {
"""
Paint the AJAX trigger if the link has an action.
@param link the link component being rendered
@param xml the XmlStringBuilder to paint to.
"""
AjaxTarget[] actionTargets = link.getActionTargets();
// Start tag
xml.ap... | java | private void paintAjaxTrigger(final WLink link, final XmlStringBuilder xml) {
AjaxTarget[] actionTargets = link.getActionTargets();
// Start tag
xml.appendTagOpen("ui:ajaxtrigger");
xml.appendAttribute("triggerId", link.getId());
xml.appendClose();
if (actionTargets != null && actionTargets.length > 0) {
... | [
"private",
"void",
"paintAjaxTrigger",
"(",
"final",
"WLink",
"link",
",",
"final",
"XmlStringBuilder",
"xml",
")",
"{",
"AjaxTarget",
"[",
"]",
"actionTargets",
"=",
"link",
".",
"getActionTargets",
"(",
")",
";",
"// Start tag",
"xml",
".",
"appendTagOpen",
... | Paint the AJAX trigger if the link has an action.
@param link the link component being rendered
@param xml the XmlStringBuilder to paint to. | [
"Paint",
"the",
"AJAX",
"trigger",
"if",
"the",
"link",
"has",
"an",
"action",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WLinkRenderer.java#L130-L154 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/bolt/AmBaseBolt.java | AmBaseBolt.emitWithOnlyAnchorAndGroupingStream | protected void emitWithOnlyAnchorAndGroupingStream(StreamMessage message, String groupingKey,
String streamId) {
"""
Use anchor function(child message failed. notify fail to parent message.), and not use this class's key history function.<br>
Send message to downstream component with grouping key.<br>... | java | protected void emitWithOnlyAnchorAndGroupingStream(StreamMessage message, String groupingKey,
String streamId)
{
getCollector().emit(streamId, this.getExecutingTuple(), new Values(groupingKey, message));
} | [
"protected",
"void",
"emitWithOnlyAnchorAndGroupingStream",
"(",
"StreamMessage",
"message",
",",
"String",
"groupingKey",
",",
"String",
"streamId",
")",
"{",
"getCollector",
"(",
")",
".",
"emit",
"(",
"streamId",
",",
"this",
".",
"getExecutingTuple",
"(",
")",... | Use anchor function(child message failed. notify fail to parent message.), and not use this class's key history function.<br>
Send message to downstream component with grouping key.<br>
Use following situation.
<ol>
<li>Not use this class's key history function.</li>
<li>Use storm's fault detect function.</li>
</ol>
@... | [
"Use",
"anchor",
"function",
"(",
"child",
"message",
"failed",
".",
"notify",
"fail",
"to",
"parent",
"message",
".",
")",
"and",
"not",
"use",
"this",
"class",
"s",
"key",
"history",
"function",
".",
"<br",
">",
"Send",
"message",
"to",
"downstream",
"... | train | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/bolt/AmBaseBolt.java#L723-L727 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/DoubleField.java | DoubleField.getSQLFromField | public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException {
"""
Move the physical binary data to this SQL parameter row.
@param statement The SQL prepare statement.
@param iType the type of SQL statement.
@param iParamColumn The column in the prepared statement to... | java | public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException
{
if (this.isNull())
{
if ((this.isNullable()) && (iType != DBConstants.SQL_SELECT_TYPE))
statement.setNull(iParamColumn, Types.DOUBLE);
else
... | [
"public",
"void",
"getSQLFromField",
"(",
"PreparedStatement",
"statement",
",",
"int",
"iType",
",",
"int",
"iParamColumn",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"this",
".",
"isNull",
"(",
")",
")",
"{",
"if",
"(",
"(",
"this",
".",
"isNullable"... | Move the physical binary data to this SQL parameter row.
@param statement The SQL prepare statement.
@param iType the type of SQL statement.
@param iParamColumn The column in the prepared statement to set the data.
@exception SQLException From SQL calls. | [
"Move",
"the",
"physical",
"binary",
"data",
"to",
"this",
"SQL",
"parameter",
"row",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/DoubleField.java#L143-L154 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java | PathOverlay.addGreatCircle | public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint) {
"""
Draw a great circle.
Calculate a point for every 100km along the path.
@param startPoint start point of the great circle
@param endPoint end point of the great circle
"""
// get the great circle path length in meter... | java | public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint) {
// get the great circle path length in meters
final int greatCircleLength = (int) startPoint.distanceToAsDouble(endPoint);
// add one point for every 100kms of the great circle path
final int numberOfPoints... | [
"public",
"void",
"addGreatCircle",
"(",
"final",
"GeoPoint",
"startPoint",
",",
"final",
"GeoPoint",
"endPoint",
")",
"{",
"//\tget the great circle path length in meters",
"final",
"int",
"greatCircleLength",
"=",
"(",
"int",
")",
"startPoint",
".",
"distanceToAsDoubl... | Draw a great circle.
Calculate a point for every 100km along the path.
@param startPoint start point of the great circle
@param endPoint end point of the great circle | [
"Draw",
"a",
"great",
"circle",
".",
"Calculate",
"a",
"point",
"for",
"every",
"100km",
"along",
"the",
"path",
"."
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java#L109-L117 |
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.listPrebuiltsWithServiceResponseAsync | public Observable<ServiceResponse<List<PrebuiltEntityExtractor>>> listPrebuiltsWithServiceResponseAsync(UUID appId, String versionId, ListPrebuiltsOptionalParameter listPrebuiltsOptionalParameter) {
"""
Gets information about the prebuilt entity models.
@param appId The application ID.
@param versionId The ver... | java | public Observable<ServiceResponse<List<PrebuiltEntityExtractor>>> listPrebuiltsWithServiceResponseAsync(UUID appId, String versionId, ListPrebuiltsOptionalParameter listPrebuiltsOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpo... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"PrebuiltEntityExtractor",
">",
">",
">",
"listPrebuiltsWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"ListPrebuiltsOptionalParameter",
"listPrebuiltsOptionalParameter",
")... | Gets information about the prebuilt entity models.
@param appId The application ID.
@param versionId The version ID.
@param listPrebuiltsOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return ... | [
"Gets",
"information",
"about",
"the",
"prebuilt",
"entity",
"models",
"."
] | 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#L2228-L2242 |
theHilikus/JRoboCom | jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/Player.java | Player.startRobot | public void startRobot(Robot newRobot) {
"""
Starts the thread of a robot in the player's thread group
@param newRobot the robot to start
"""
newRobot.getData().setActiveState(DEFAULT_START_STATE);
Thread newThread = new Thread(robotsThreads, newRobot, "Bot-" + newRobot.getSerialNumber());
newThread.star... | java | public void startRobot(Robot newRobot) {
newRobot.getData().setActiveState(DEFAULT_START_STATE);
Thread newThread = new Thread(robotsThreads, newRobot, "Bot-" + newRobot.getSerialNumber());
newThread.start(); // jumpstarts the robot
} | [
"public",
"void",
"startRobot",
"(",
"Robot",
"newRobot",
")",
"{",
"newRobot",
".",
"getData",
"(",
")",
".",
"setActiveState",
"(",
"DEFAULT_START_STATE",
")",
";",
"Thread",
"newThread",
"=",
"new",
"Thread",
"(",
"robotsThreads",
",",
"newRobot",
",",
"\... | Starts the thread of a robot in the player's thread group
@param newRobot the robot to start | [
"Starts",
"the",
"thread",
"of",
"a",
"robot",
"in",
"the",
"player",
"s",
"thread",
"group"
] | train | https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/Player.java#L207-L212 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java | ContentSpecParser.parseFilesMetaData | protected FileList parseFilesMetaData(final ParserData parserData, final String value, final int lineNumber,
final String line) throws ParsingException {
"""
Parse an "Additional Files" metadata component into a List of {@link org.jboss.pressgang.ccms.contentspec.File} objects.
@param parserData
@p... | java | protected FileList parseFilesMetaData(final ParserData parserData, final String value, final int lineNumber,
final String line) throws ParsingException {
int startingPos = StringUtilities.indexOf(value, '[');
if (startingPos != -1) {
final List<File> files = new LinkedList<File>(... | [
"protected",
"FileList",
"parseFilesMetaData",
"(",
"final",
"ParserData",
"parserData",
",",
"final",
"String",
"value",
",",
"final",
"int",
"lineNumber",
",",
"final",
"String",
"line",
")",
"throws",
"ParsingException",
"{",
"int",
"startingPos",
"=",
"StringU... | Parse an "Additional Files" metadata component into a List of {@link org.jboss.pressgang.ccms.contentspec.File} objects.
@param parserData
@param value The value of the key value pair
@param lineNumber The line number of the additional files key
@param line The full line of the key value pair
@return A list... | [
"Parse",
"an",
"Additional",
"Files",
"metadata",
"component",
"into",
"a",
"List",
"of",
"{",
"@link",
"org",
".",
"jboss",
".",
"pressgang",
".",
"ccms",
".",
"contentspec",
".",
"File",
"}",
"objects",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L858-L878 |
anotheria/moskito | moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java | AbstractInterceptor.getAnnotationFromContext | protected static <T extends Annotation> T getAnnotationFromContext(InvocationContext context, Class<T> clazz) {
"""
Finds given annotation from {@link InvocationContext} (actually from method or class).
@param context {@link InvocationContext}
@param clazz annotation class
@param <T> type of the annotation
@... | java | protected static <T extends Annotation> T getAnnotationFromContext(InvocationContext context, Class<T> clazz) {
T result = context.getMethod().getAnnotation(clazz);
return result != null ? result : context.getTarget().getClass().getAnnotation(clazz);
} | [
"protected",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"getAnnotationFromContext",
"(",
"InvocationContext",
"context",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"T",
"result",
"=",
"context",
".",
"getMethod",
"(",
")",
".",
"getAnnotatio... | Finds given annotation from {@link InvocationContext} (actually from method or class).
@param context {@link InvocationContext}
@param clazz annotation class
@param <T> type of the annotation
@return annotation instance | [
"Finds",
"given",
"annotation",
"from",
"{",
"@link",
"InvocationContext",
"}",
"(",
"actually",
"from",
"method",
"or",
"class",
")",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java#L124-L127 |
JodaOrg/joda-money | src/main/java/org/joda/money/BigMoney.java | BigMoney.dividedBy | public BigMoney dividedBy(BigDecimal valueToDivideBy, RoundingMode roundingMode) {
"""
Returns a copy of this monetary value divided by the specified value
using the specified rounding mode to adjust the scale.
<p>
The result has the same scale as this instance.
For example, 'USD 1.13' divided by '2.5' and rou... | java | public BigMoney dividedBy(BigDecimal valueToDivideBy, RoundingMode roundingMode) {
MoneyUtils.checkNotNull(valueToDivideBy, "Divisor must not be null");
MoneyUtils.checkNotNull(roundingMode, "RoundingMode must not be null");
if (valueToDivideBy.compareTo(BigDecimal.ONE) == 0) {
r... | [
"public",
"BigMoney",
"dividedBy",
"(",
"BigDecimal",
"valueToDivideBy",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"MoneyUtils",
".",
"checkNotNull",
"(",
"valueToDivideBy",
",",
"\"Divisor must not be null\"",
")",
";",
"MoneyUtils",
".",
"checkNotNull",
"(",
"r... | Returns a copy of this monetary value divided by the specified value
using the specified rounding mode to adjust the scale.
<p>
The result has the same scale as this instance.
For example, 'USD 1.13' divided by '2.5' and rounding down gives 'USD 0.45'
(amount rounded down from 0.452).
<p>
This instance is immutable and... | [
"Returns",
"a",
"copy",
"of",
"this",
"monetary",
"value",
"divided",
"by",
"the",
"specified",
"value",
"using",
"the",
"specified",
"rounding",
"mode",
"to",
"adjust",
"the",
"scale",
".",
"<p",
">",
"The",
"result",
"has",
"the",
"same",
"scale",
"as",
... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/BigMoney.java#L1372-L1380 |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/io/Mutator.java | Mutator.subSetOf | public static Schema subSetOf(String newName, Schema schema, String... subSetFields) {
"""
Creates a subset of the input Schema exactly with the fields whose names are specified.
The name of the schema is also specified as a parameter.
"""
List<Field> newSchema = new ArrayList<Field>();
for(String subSetF... | java | public static Schema subSetOf(String newName, Schema schema, String... subSetFields) {
List<Field> newSchema = new ArrayList<Field>();
for(String subSetField: subSetFields) {
newSchema.add(schema.getField(subSetField));
}
return new Schema(newName, newSchema);
} | [
"public",
"static",
"Schema",
"subSetOf",
"(",
"String",
"newName",
",",
"Schema",
"schema",
",",
"String",
"...",
"subSetFields",
")",
"{",
"List",
"<",
"Field",
">",
"newSchema",
"=",
"new",
"ArrayList",
"<",
"Field",
">",
"(",
")",
";",
"for",
"(",
... | Creates a subset of the input Schema exactly with the fields whose names are specified.
The name of the schema is also specified as a parameter. | [
"Creates",
"a",
"subset",
"of",
"the",
"input",
"Schema",
"exactly",
"with",
"the",
"fields",
"whose",
"names",
"are",
"specified",
".",
"The",
"name",
"of",
"the",
"schema",
"is",
"also",
"specified",
"as",
"a",
"parameter",
"."
] | train | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/io/Mutator.java#L60-L66 |
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.addEntity | public UUID addEntity(UUID appId, String versionId, AddEntityOptionalParameter addEntityOptionalParameter) {
"""
Adds an entity extractor to the application.
@param appId The application ID.
@param versionId The version ID.
@param addEntityOptionalParameter the object representing the optional parameters to b... | java | public UUID addEntity(UUID appId, String versionId, AddEntityOptionalParameter addEntityOptionalParameter) {
return addEntityWithServiceResponseAsync(appId, versionId, addEntityOptionalParameter).toBlocking().single().body();
} | [
"public",
"UUID",
"addEntity",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"AddEntityOptionalParameter",
"addEntityOptionalParameter",
")",
"{",
"return",
"addEntityWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"addEntityOptionalParameter",
")... | Adds an entity extractor to the application.
@param appId The application ID.
@param versionId The version ID.
@param addEntityOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorRespo... | [
"Adds",
"an",
"entity",
"extractor",
"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#L932-L934 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/BiLevelCacheMap.java | BiLevelCacheMap.put | public Object put(Object key, Object value) {
"""
If key is already in cacheL1, the new value will show with a delay,
since merge L2->L1 may not happen immediately. To force the merge sooner,
call <code>size()<code>.
"""
synchronized (_cacheL2)
{
_cacheL2.put(key, value);
... | java | public Object put(Object key, Object value)
{
synchronized (_cacheL2)
{
_cacheL2.put(key, value);
// not really a miss, but merge to avoid big increase in L2 size
// (it cannot be reallocated, it is final)
mergeIfNeeded();
}
return va... | [
"public",
"Object",
"put",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"synchronized",
"(",
"_cacheL2",
")",
"{",
"_cacheL2",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"// not really a miss, but merge to avoid big increase in L2 size",
"// (it ca... | If key is already in cacheL1, the new value will show with a delay,
since merge L2->L1 may not happen immediately. To force the merge sooner,
call <code>size()<code>. | [
"If",
"key",
"is",
"already",
"in",
"cacheL1",
"the",
"new",
"value",
"will",
"show",
"with",
"a",
"delay",
"since",
"merge",
"L2",
"-",
">",
"L1",
"may",
"not",
"happen",
"immediately",
".",
"To",
"force",
"the",
"merge",
"sooner",
"call",
"<code",
">... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/BiLevelCacheMap.java#L162-L174 |
apache/groovy | src/main/groovy/groovy/util/ObjectGraphBuilder.java | ObjectGraphBuilder.setNewInstanceResolver | public void setNewInstanceResolver(final Object newInstanceResolver) {
"""
Sets the current NewInstanceResolver.<br>
It will assign DefaultNewInstanceResolver if null.<br>
It accepts a NewInstanceResolver instance or a Closure.
"""
if (newInstanceResolver instanceof NewInstanceResolver) {
... | java | public void setNewInstanceResolver(final Object newInstanceResolver) {
if (newInstanceResolver instanceof NewInstanceResolver) {
this.newInstanceResolver = (NewInstanceResolver) newInstanceResolver;
} else if (newInstanceResolver instanceof Closure) {
final ObjectGraphBuilder sel... | [
"public",
"void",
"setNewInstanceResolver",
"(",
"final",
"Object",
"newInstanceResolver",
")",
"{",
"if",
"(",
"newInstanceResolver",
"instanceof",
"NewInstanceResolver",
")",
"{",
"this",
".",
"newInstanceResolver",
"=",
"(",
"NewInstanceResolver",
")",
"newInstanceRe... | Sets the current NewInstanceResolver.<br>
It will assign DefaultNewInstanceResolver if null.<br>
It accepts a NewInstanceResolver instance or a Closure. | [
"Sets",
"the",
"current",
"NewInstanceResolver",
".",
"<br",
">",
"It",
"will",
"assign",
"DefaultNewInstanceResolver",
"if",
"null",
".",
"<br",
">",
"It",
"accepts",
"a",
"NewInstanceResolver",
"instance",
"or",
"a",
"Closure",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/ObjectGraphBuilder.java#L263-L279 |
chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java | JaxbUtils.unmarshal | public static <T> T unmarshal(Class<T> cl, Source s) throws JAXBException {
"""
Convert the contents of a Source to an object of a given class.
@param cl Type of object
@param s Source to be used
@return Object of the given type
"""
JAXBContext ctx = JAXBContext.newInstance(cl);
Unmarshaller u =... | java | public static <T> T unmarshal(Class<T> cl, Source s) throws JAXBException {
JAXBContext ctx = JAXBContext.newInstance(cl);
Unmarshaller u = ctx.createUnmarshaller();
return u.unmarshal(s, cl).getValue();
} | [
"public",
"static",
"<",
"T",
">",
"T",
"unmarshal",
"(",
"Class",
"<",
"T",
">",
"cl",
",",
"Source",
"s",
")",
"throws",
"JAXBException",
"{",
"JAXBContext",
"ctx",
"=",
"JAXBContext",
".",
"newInstance",
"(",
"cl",
")",
";",
"Unmarshaller",
"u",
"="... | Convert the contents of a Source to an object of a given class.
@param cl Type of object
@param s Source to be used
@return Object of the given type | [
"Convert",
"the",
"contents",
"of",
"a",
"Source",
"to",
"an",
"object",
"of",
"a",
"given",
"class",
"."
] | train | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java#L286-L290 |
iobeam/iobeam-client-java | src/main/java/com/iobeam/api/client/Iobeam.java | Iobeam.registerDeviceAsync | public void registerDeviceAsync(String deviceId, RegisterCallback callback) {
"""
Registers a device asynchronously with the provided device ID.
See {@link #registerDeviceAsync(Device, RegisterCallback)} for more details.
@param deviceId Desired device ID.
@param callback Callback for result of the registra... | java | public void registerDeviceAsync(String deviceId, RegisterCallback callback) {
final Device d = new Device.Builder(projectId).id(deviceId).build();
registerDeviceAsync(d, callback);
} | [
"public",
"void",
"registerDeviceAsync",
"(",
"String",
"deviceId",
",",
"RegisterCallback",
"callback",
")",
"{",
"final",
"Device",
"d",
"=",
"new",
"Device",
".",
"Builder",
"(",
"projectId",
")",
".",
"id",
"(",
"deviceId",
")",
".",
"build",
"(",
")",... | Registers a device asynchronously with the provided device ID.
See {@link #registerDeviceAsync(Device, RegisterCallback)} for more details.
@param deviceId Desired device ID.
@param callback Callback for result of the registration.
@throws ApiException Thrown if the iobeam client is not initialized. | [
"Registers",
"a",
"device",
"asynchronously",
"with",
"the",
"provided",
"device",
"ID",
"."
] | train | https://github.com/iobeam/iobeam-client-java/blob/06e7aeb2a313503392358a3671de7d28628d0e33/src/main/java/com/iobeam/api/client/Iobeam.java#L572-L575 |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imageutils/TiffUtil.java | TiffUtil.readOrientationFromTIFF | public static int readOrientationFromTIFF(InputStream is, int length) throws IOException {
"""
Reads orientation information from TIFF data.
@param is the input stream of TIFF data
@param length length of the TIFF data
@return orientation information (1/3/6/8 on success, 0 if not found)
"""
// read tiff... | java | public static int readOrientationFromTIFF(InputStream is, int length) throws IOException {
// read tiff header
TiffHeader tiffHeader = new TiffHeader();
length = readTiffHeader(is, length, tiffHeader);
// move to the first IFD
// offset is relative to the beginning of the TIFF data
// and we al... | [
"public",
"static",
"int",
"readOrientationFromTIFF",
"(",
"InputStream",
"is",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"// read tiff header",
"TiffHeader",
"tiffHeader",
"=",
"new",
"TiffHeader",
"(",
")",
";",
"length",
"=",
"readTiffHeader",
"(... | Reads orientation information from TIFF data.
@param is the input stream of TIFF data
@param length length of the TIFF data
@return orientation information (1/3/6/8 on success, 0 if not found) | [
"Reads",
"orientation",
"information",
"from",
"TIFF",
"data",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imageutils/TiffUtil.java#L54-L74 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/date/GosuDateUtil.java | GosuDateUtil.addMonths | public static Date addMonths(Date date, int iMonths) {
"""
Adds the specified (signed) amount of months to the given date. For
example, to subtract 5 months from the current date, you can
achieve it by calling: <code>addMonths(Date, -5)</code>.
@param date The time.
@param iMonths The amount of months to ... | java | public static Date addMonths(Date date, int iMonths) {
Calendar dateTime = dateToCalendar(date);
dateTime.add(Calendar.MONTH, iMonths);
return dateTime.getTime();
} | [
"public",
"static",
"Date",
"addMonths",
"(",
"Date",
"date",
",",
"int",
"iMonths",
")",
"{",
"Calendar",
"dateTime",
"=",
"dateToCalendar",
"(",
"date",
")",
";",
"dateTime",
".",
"add",
"(",
"Calendar",
".",
"MONTH",
",",
"iMonths",
")",
";",
"return"... | Adds the specified (signed) amount of months to the given date. For
example, to subtract 5 months from the current date, you can
achieve it by calling: <code>addMonths(Date, -5)</code>.
@param date The time.
@param iMonths The amount of months to add.
@return A new date with the months added. | [
"Adds",
"the",
"specified",
"(",
"signed",
")",
"amount",
"of",
"months",
"to",
"the",
"given",
"date",
".",
"For",
"example",
"to",
"subtract",
"5",
"months",
"from",
"the",
"current",
"date",
"you",
"can",
"achieve",
"it",
"by",
"calling",
":",
"<code"... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/date/GosuDateUtil.java#L109-L113 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/PeriodFormatter.java | PeriodFormatter.printTo | public void printTo(Writer out, ReadablePeriod period) throws IOException {
"""
Prints a ReadablePeriod to a Writer.
@param out the formatted period is written out
@param period the period to format, not null
"""
checkPrinter();
checkPeriod(period);
getPrinter().printTo(o... | java | public void printTo(Writer out, ReadablePeriod period) throws IOException {
checkPrinter();
checkPeriod(period);
getPrinter().printTo(out, period, iLocale);
} | [
"public",
"void",
"printTo",
"(",
"Writer",
"out",
",",
"ReadablePeriod",
"period",
")",
"throws",
"IOException",
"{",
"checkPrinter",
"(",
")",
";",
"checkPeriod",
"(",
"period",
")",
";",
"getPrinter",
"(",
")",
".",
"printTo",
"(",
"out",
",",
"period",... | Prints a ReadablePeriod to a Writer.
@param out the formatted period is written out
@param period the period to format, not null | [
"Prints",
"a",
"ReadablePeriod",
"to",
"a",
"Writer",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/PeriodFormatter.java#L226-L231 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.generateFormBeanName | private static String generateFormBeanName( Class formBeanClass, HttpServletRequest request ) {
"""
Create the name for a form bean type.
@param formBeanClass the class whose type will determine the name.
@param request the current HttpServletRequest, which contains a reference to the current Struts module.
@... | java | private static String generateFormBeanName( Class formBeanClass, HttpServletRequest request )
{
ModuleConfig moduleConfig = RequestUtils.getRequestModuleConfig( request );
String formBeanClassName = formBeanClass.getName();
//
// A form-bean wasn't found for this type, so we... | [
"private",
"static",
"String",
"generateFormBeanName",
"(",
"Class",
"formBeanClass",
",",
"HttpServletRequest",
"request",
")",
"{",
"ModuleConfig",
"moduleConfig",
"=",
"RequestUtils",
".",
"getRequestModuleConfig",
"(",
"request",
")",
";",
"String",
"formBeanClassNa... | Create the name for a form bean type.
@param formBeanClass the class whose type will determine the name.
@param request the current HttpServletRequest, which contains a reference to the current Struts module.
@return the name found in the Struts module, or, if none is found, a name that is either:
<ul>
<li>a camel-cas... | [
"Create",
"the",
"name",
"for",
"a",
"form",
"bean",
"type",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L759-L787 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.createProjectForGroup | public GitlabProject createProjectForGroup(String name, GitlabGroup group) throws IOException {
"""
Creates a group Project
@param name The name of the project
@param group The group for which the project should be crated
@return The GitLab Project
@throws IOException on gitlab api call error
"""
... | java | public GitlabProject createProjectForGroup(String name, GitlabGroup group) throws IOException {
return createProjectForGroup(name, group, null);
} | [
"public",
"GitlabProject",
"createProjectForGroup",
"(",
"String",
"name",
",",
"GitlabGroup",
"group",
")",
"throws",
"IOException",
"{",
"return",
"createProjectForGroup",
"(",
"name",
",",
"group",
",",
"null",
")",
";",
"}"
] | Creates a group Project
@param name The name of the project
@param group The group for which the project should be crated
@return The GitLab Project
@throws IOException on gitlab api call error | [
"Creates",
"a",
"group",
"Project"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L1202-L1204 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableWriteItems.java | TableWriteItems.withHashOnlyKeysToDelete | public TableWriteItems withHashOnlyKeysToDelete(String hashKeyName,
Object... hashKeyValues) {
"""
Used to specify multiple hash-only primary keys to be deleted from the
current table.
@param hashKeyName
hash-only key name
@param hashKeyValues
a list of hash key values
"""
if (hashKe... | java | public TableWriteItems withHashOnlyKeysToDelete(String hashKeyName,
Object... hashKeyValues) {
if (hashKeyName == null)
throw new IllegalArgumentException();
PrimaryKey[] primaryKeys = new PrimaryKey[hashKeyValues.length];
for (int i=0; i < hashKeyValues.length; i++)
... | [
"public",
"TableWriteItems",
"withHashOnlyKeysToDelete",
"(",
"String",
"hashKeyName",
",",
"Object",
"...",
"hashKeyValues",
")",
"{",
"if",
"(",
"hashKeyName",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"PrimaryKey",
"[",
"]",
... | Used to specify multiple hash-only primary keys to be deleted from the
current table.
@param hashKeyName
hash-only key name
@param hashKeyValues
a list of hash key values | [
"Used",
"to",
"specify",
"multiple",
"hash",
"-",
"only",
"primary",
"keys",
"to",
"be",
"deleted",
"from",
"the",
"current",
"table",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableWriteItems.java#L83-L91 |
google/closure-compiler | src/com/google/javascript/jscomp/CheckSuspiciousCode.java | CheckSuspiciousCode.checkLeftOperandOfLogicalOperator | private void checkLeftOperandOfLogicalOperator(NodeTraversal t, Node n) {
"""
Check for the LHS of a logical operator (&& and ||) being deterministically truthy or
falsy, using both syntactic and type information. This is always suspicious (though for
different reasons: "truthy and" means the LHS is alwa... | java | private void checkLeftOperandOfLogicalOperator(NodeTraversal t, Node n) {
if (n.isOr() || n.isAnd()) {
String operator = n.isOr() ? "||" : "&&";
TernaryValue v = getBooleanValueWithTypes(n.getFirstChild());
if (v != TernaryValue.UNKNOWN) {
String result = v == TernaryValue.TRUE ? "truthy" ... | [
"private",
"void",
"checkLeftOperandOfLogicalOperator",
"(",
"NodeTraversal",
"t",
",",
"Node",
"n",
")",
"{",
"if",
"(",
"n",
".",
"isOr",
"(",
")",
"||",
"n",
".",
"isAnd",
"(",
")",
")",
"{",
"String",
"operator",
"=",
"n",
".",
"isOr",
"(",
")",
... | Check for the LHS of a logical operator (&& and ||) being deterministically truthy or
falsy, using both syntactic and type information. This is always suspicious (though for
different reasons: "truthy and" means the LHS is always ignored and should be removed, "falsy
and" means the RHS is dead code, and vice ve... | [
"Check",
"for",
"the",
"LHS",
"of",
"a",
"logical",
"operator",
"(",
"&",
";",
"&",
";",
"and",
"||",
")",
"being",
"deterministically",
"truthy",
"or",
"falsy",
"using",
"both",
"syntactic",
"and",
"type",
"information",
".",
"This",
"is",
"always",... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckSuspiciousCode.java#L174-L183 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/prune_policy.java | prune_policy.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
prune_policy_responses result = (prune_policy_responses) service.get_pa... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
prune_policy_responses result = (prune_policy_responses) service.get_payload_formatter().string_to_resource(prune_policy_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcod... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"prune_policy_responses",
"result",
"=",
"(",
"prune_policy_responses",
")",
"service",
".",
"get_payload_form... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/prune_policy.java#L223-L240 |
hector-client/hector | core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java | HFactory.createColumnFamilyDefinition | public static ColumnFamilyDefinition createColumnFamilyDefinition(
String keyspace, String cfName, ComparatorType comparatorType) {
"""
Create a column family for a given keyspace without comparator type.
Example: String keyspace = "testKeyspace"; String column1 = "testcolumn";
ColumnFamilyDefinition colum... | java | public static ColumnFamilyDefinition createColumnFamilyDefinition(
String keyspace, String cfName, ComparatorType comparatorType) {
return new ThriftCfDef(keyspace, cfName, comparatorType);
} | [
"public",
"static",
"ColumnFamilyDefinition",
"createColumnFamilyDefinition",
"(",
"String",
"keyspace",
",",
"String",
"cfName",
",",
"ComparatorType",
"comparatorType",
")",
"{",
"return",
"new",
"ThriftCfDef",
"(",
"keyspace",
",",
"cfName",
",",
"comparatorType",
... | Create a column family for a given keyspace without comparator type.
Example: String keyspace = "testKeyspace"; String column1 = "testcolumn";
ColumnFamilyDefinition columnFamily1 =
HFactory.createColumnFamilyDefinition(keyspace, column1,
ComparatorType.UTF8TYPE); List<ColumnFamilyDefinition> columns = new
ArrayList<Co... | [
"Create",
"a",
"column",
"family",
"for",
"a",
"given",
"keyspace",
"without",
"comparator",
"type",
".",
"Example",
":",
"String",
"keyspace",
"=",
"testKeyspace",
";",
"String",
"column1",
"=",
"testcolumn",
";",
"ColumnFamilyDefinition",
"columnFamily1",
"=",
... | train | https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java#L735-L738 |
jenkinsci/email-ext-plugin | src/main/java/hudson/plugins/emailext/plugins/content/ScriptContent.java | ScriptContent.renderTemplate | private String renderTemplate(Run<?, ?> build, FilePath workspace, TaskListener listener, InputStream templateStream)
throws IOException {
"""
Renders the template using a SimpleTemplateEngine
@param build the build to act on
@param templateStream the template file stream
@return the rendered temp... | java | private String renderTemplate(Run<?, ?> build, FilePath workspace, TaskListener listener, InputStream templateStream)
throws IOException {
String result;
final Map<String, Object> binding = new HashMap<>();
ExtendedEmailPublisherDescriptor descriptor = Jenkins.getAc... | [
"private",
"String",
"renderTemplate",
"(",
"Run",
"<",
"?",
",",
"?",
">",
"build",
",",
"FilePath",
"workspace",
",",
"TaskListener",
"listener",
",",
"InputStream",
"templateStream",
")",
"throws",
"IOException",
"{",
"String",
"result",
";",
"final",
"Map"... | Renders the template using a SimpleTemplateEngine
@param build the build to act on
@param templateStream the template file stream
@return the rendered template content
@throws IOException | [
"Renders",
"the",
"template",
"using",
"a",
"SimpleTemplateEngine"
] | train | https://github.com/jenkinsci/email-ext-plugin/blob/21fbd402665848a18205b26751424149e51e86e4/src/main/java/hudson/plugins/emailext/plugins/content/ScriptContent.java#L114-L176 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.ByteArray | public JBBPDslBuilder ByteArray(final String name, final String sizeExpression) {
"""
Add named byte array which size calculated through expression.
@param name name of the array, it can be null for anonymous fields
@param sizeExpression expression to be used to calculate array length, must not be nu... | java | public JBBPDslBuilder ByteArray(final String name, final String sizeExpression) {
final Item item = new Item(BinType.BYTE_ARRAY, name, this.byteOrder);
item.sizeExpression = assertExpressionChars(sizeExpression);
this.addItem(item);
return this;
} | [
"public",
"JBBPDslBuilder",
"ByteArray",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"sizeExpression",
")",
"{",
"final",
"Item",
"item",
"=",
"new",
"Item",
"(",
"BinType",
".",
"BYTE_ARRAY",
",",
"name",
",",
"this",
".",
"byteOrder",
")",
";... | Add named byte array which size calculated through expression.
@param name name of the array, it can be null for anonymous fields
@param sizeExpression expression to be used to calculate array length, must not be null or empty.
@return the builder instance, must not be null | [
"Add",
"named",
"byte",
"array",
"which",
"size",
"calculated",
"through",
"expression",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L871-L876 |
Azure/azure-sdk-for-java | compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/DisksInner.java | DisksInner.beginGrantAccessAsync | public Observable<AccessUriInner> beginGrantAccessAsync(String resourceGroupName, String diskName, GrantAccessData grantAccessData) {
"""
Grants access to a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be chang... | java | public Observable<AccessUriInner> beginGrantAccessAsync(String resourceGroupName, String diskName, GrantAccessData grantAccessData) {
return beginGrantAccessWithServiceResponseAsync(resourceGroupName, diskName, grantAccessData).map(new Func1<ServiceResponse<AccessUriInner>, AccessUriInner>() {
@Over... | [
"public",
"Observable",
"<",
"AccessUriInner",
">",
"beginGrantAccessAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"diskName",
",",
"GrantAccessData",
"grantAccessData",
")",
"{",
"return",
"beginGrantAccessWithServiceResponseAsync",
"(",
"resourceGroupName",
"... | Grants access to a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
@param grantAcc... | [
"Grants",
"access",
"to",
"a",
"disk",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/DisksInner.java#L1055-L1062 |
apache/groovy | subprojects/groovy-sql/src/main/java/groovy/sql/GroovyRowResult.java | GroovyRowResult.put | @SuppressWarnings("unchecked")
public Object put(Object key, Object value) {
"""
Associates the specified value with the specified property name in this result.
@param key the property name for the result
@param value the property value for the result
@return the previous value associated with <tt>key</tt... | java | @SuppressWarnings("unchecked")
public Object put(Object key, Object value) {
// avoid different case keys being added by explicit remove
Object orig = remove(key);
result.put(key, value);
return orig;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Object",
"put",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"// avoid different case keys being added by explicit remove",
"Object",
"orig",
"=",
"remove",
"(",
"key",
")",
";",
"result",
"... | Associates the specified value with the specified property name in this result.
@param key the property name for the result
@param value the property value for the result
@return the previous value associated with <tt>key</tt>, or
<tt>null</tt> if there was no mapping for <tt>key</tt>.
(A <tt>null</tt> return can also... | [
"Associates",
"the",
"specified",
"value",
"with",
"the",
"specified",
"property",
"name",
"in",
"this",
"result",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/GroovyRowResult.java#L175-L181 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/content/PropertyTypeUrl.java | PropertyTypeUrl.getPropertyTypeUrl | public static MozuUrl getPropertyTypeUrl(String propertyTypeName, String responseFields) {
"""
Get Resource Url for GetPropertyType
@param propertyTypeName The name of the property type.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JS... | java | public static MozuUrl getPropertyTypeUrl(String propertyTypeName, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/content/propertytypes/{propertyTypeName}?responseFields={responseFields}");
formatter.formatUrl("propertyTypeName", propertyTypeName);
formatter.formatUrl("responseFields... | [
"public",
"static",
"MozuUrl",
"getPropertyTypeUrl",
"(",
"String",
"propertyTypeName",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/content/propertytypes/{propertyTypeName}?responseFields={responseFields}\"",
... | Get Resource Url for GetPropertyType
@param propertyTypeName The name of the property type.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this p... | [
"Get",
"Resource",
"Url",
"for",
"GetPropertyType"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/content/PropertyTypeUrl.java#L38-L44 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/DiscontinuousAnnotation.java | DiscontinuousAnnotation.setValue | public void setValue(int i, Annotation v) {
"""
indexed setter for value - sets an indexed value - Annotations to be chained.
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (DiscontinuousAnnotation_Type.featOkTst && ((DiscontinuousAnnotation_Type)jcasType).cas... | java | public void setValue(int i, Annotation v) {
if (DiscontinuousAnnotation_Type.featOkTst && ((DiscontinuousAnnotation_Type)jcasType).casFeat_value == null)
jcasType.jcas.throwFeatMissing("value", "de.julielab.jules.types.DiscontinuousAnnotation");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefVal... | [
"public",
"void",
"setValue",
"(",
"int",
"i",
",",
"Annotation",
"v",
")",
"{",
"if",
"(",
"DiscontinuousAnnotation_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DiscontinuousAnnotation_Type",
")",
"jcasType",
")",
".",
"casFeat_value",
"==",
"null",
")",
"jcasTy... | indexed setter for value - sets an indexed value - Annotations to be chained.
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"value",
"-",
"sets",
"an",
"indexed",
"value",
"-",
"Annotations",
"to",
"be",
"chained",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/DiscontinuousAnnotation.java#L116-L120 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzleConnection.java | DrizzleConnection.setSavepoint | public Savepoint setSavepoint(final String name) throws SQLException {
"""
Creates a savepoint with the given name in the current transaction and returns the new <code>Savepoint</code>
object that represents it.
<p/>
<p> if setSavepoint is invoked outside of an active transaction, a transaction will be started ... | java | public Savepoint setSavepoint(final String name) throws SQLException {
final Savepoint drizzleSavepoint = new DrizzleSavepoint(name, savepointCount++);
try {
protocol.setSavepoint(drizzleSavepoint.toString());
} catch (QueryException e) {
throw SQLExceptionMapper.get(e);
... | [
"public",
"Savepoint",
"setSavepoint",
"(",
"final",
"String",
"name",
")",
"throws",
"SQLException",
"{",
"final",
"Savepoint",
"drizzleSavepoint",
"=",
"new",
"DrizzleSavepoint",
"(",
"name",
",",
"savepointCount",
"++",
")",
";",
"try",
"{",
"protocol",
".",
... | Creates a savepoint with the given name in the current transaction and returns the new <code>Savepoint</code>
object that represents it.
<p/>
<p> if setSavepoint is invoked outside of an active transaction, a transaction will be started at this newly
created savepoint.
@param name a <code>String</code> containing the ... | [
"Creates",
"a",
"savepoint",
"with",
"the",
"given",
"name",
"in",
"the",
"current",
"transaction",
"and",
"returns",
"the",
"new",
"<code",
">",
"Savepoint<",
"/",
"code",
">",
"object",
"that",
"represents",
"it",
".",
"<p",
"/",
">",
"<p",
">",
"if",
... | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleConnection.java#L616-L625 |
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.getPatternAnyEntityRolesAsync | public Observable<List<EntityRole>> getPatternAnyEntityRolesAsync(UUID appId, String versionId, UUID entityId) {
"""
Get All Entity Roles for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity Id
@throws IllegalArgumentException thrown if parameters fail ... | java | public Observable<List<EntityRole>> getPatternAnyEntityRolesAsync(UUID appId, String versionId, UUID entityId) {
return getPatternAnyEntityRolesWithServiceResponseAsync(appId, versionId, entityId).map(new Func1<ServiceResponse<List<EntityRole>>, List<EntityRole>>() {
@Override
public Lis... | [
"public",
"Observable",
"<",
"List",
"<",
"EntityRole",
">",
">",
"getPatternAnyEntityRolesAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
")",
"{",
"return",
"getPatternAnyEntityRolesWithServiceResponseAsync",
"(",
"appId",
",",
"... | Get All Entity Roles for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity Id
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<EntityRole> object | [
"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#L9086-L9093 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.scoreExamples | public INDArray scoreExamples(DataSet data, boolean addRegularizationTerms) {
"""
Calculate the score for each example in a DataSet individually. Unlike {@link #score(DataSet)} and {@link #score(DataSet, boolean)}
this method does not average/sum over examples. This method allows for examples to be scored individ... | java | public INDArray scoreExamples(DataSet data, boolean addRegularizationTerms) {
try{
return scoreExamplesHelper(data, addRegularizationTerms);
} catch (OutOfMemoryError e){
CrashReportingUtil.writeMemoryCrashDump(this, e);
throw e;
}
} | [
"public",
"INDArray",
"scoreExamples",
"(",
"DataSet",
"data",
",",
"boolean",
"addRegularizationTerms",
")",
"{",
"try",
"{",
"return",
"scoreExamplesHelper",
"(",
"data",
",",
"addRegularizationTerms",
")",
";",
"}",
"catch",
"(",
"OutOfMemoryError",
"e",
")",
... | Calculate the score for each example in a DataSet individually. Unlike {@link #score(DataSet)} and {@link #score(DataSet, boolean)}
this method does not average/sum over examples. This method allows for examples to be scored individually (at test time only), which
may be useful for example for autoencoder architectures... | [
"Calculate",
"the",
"score",
"for",
"each",
"example",
"in",
"a",
"DataSet",
"individually",
".",
"Unlike",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L2555-L2562 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/recordstore/BasicRecordStoreLoader.java | BasicRecordStoreLoader.loadValuesInternal | private void loadValuesInternal(List<Data> keys, boolean replaceExistingValues) throws Exception {
"""
Loads the values for the provided keys and invokes partition operations
to put the loaded entries into the partition record store. The method
will block until all entries have been put into the partition record... | java | private void loadValuesInternal(List<Data> keys, boolean replaceExistingValues) throws Exception {
if (!replaceExistingValues) {
Future removeKeysFuture = removeExistingKeys(keys);
removeKeysFuture.get();
}
removeUnloadableKeys(keys);
if (keys.isEmpty()) {
... | [
"private",
"void",
"loadValuesInternal",
"(",
"List",
"<",
"Data",
">",
"keys",
",",
"boolean",
"replaceExistingValues",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"replaceExistingValues",
")",
"{",
"Future",
"removeKeysFuture",
"=",
"removeExistingKeys",
"(... | Loads the values for the provided keys and invokes partition operations
to put the loaded entries into the partition record store. The method
will block until all entries have been put into the partition record store.
<p>
Unloadable keys will be removed before loading the values. Also, if
{@code replaceExistingValues} ... | [
"Loads",
"the",
"values",
"for",
"the",
"provided",
"keys",
"and",
"invokes",
"partition",
"operations",
"to",
"put",
"the",
"loaded",
"entries",
"into",
"the",
"partition",
"record",
"store",
".",
"The",
"method",
"will",
"block",
"until",
"all",
"entries",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/recordstore/BasicRecordStoreLoader.java#L129-L142 |
libgdx/gdx-ai | gdx-ai/src/com/badlogic/gdx/ai/fsm/DefaultStateMachine.java | DefaultStateMachine.handleMessage | @Override
public boolean handleMessage (Telegram telegram) {
"""
Handles received telegrams. The telegram is first routed to the current state. If the current state does not deal with the
message, it's routed to the global state's message handler.
@param telegram the received telegram
@return true if telegra... | java | @Override
public boolean handleMessage (Telegram telegram) {
// First see if the current state is valid and that it can handle the message
if (currentState != null && currentState.onMessage(owner, telegram)) {
return true;
}
// If not, and if a global state has been implemented, send
// the message to t... | [
"@",
"Override",
"public",
"boolean",
"handleMessage",
"(",
"Telegram",
"telegram",
")",
"{",
"// First see if the current state is valid and that it can handle the message",
"if",
"(",
"currentState",
"!=",
"null",
"&&",
"currentState",
".",
"onMessage",
"(",
"owner",
",... | Handles received telegrams. The telegram is first routed to the current state. If the current state does not deal with the
message, it's routed to the global state's message handler.
@param telegram the received telegram
@return true if telegram has been successfully handled; false otherwise. | [
"Handles",
"received",
"telegrams",
".",
"The",
"telegram",
"is",
"first",
"routed",
"to",
"the",
"current",
"state",
".",
"If",
"the",
"current",
"state",
"does",
"not",
"deal",
"with",
"the",
"message",
"it",
"s",
"routed",
"to",
"the",
"global",
"state"... | train | https://github.com/libgdx/gdx-ai/blob/2d1523a97193a45e18e11a4837c6800d08f177c5/gdx-ai/src/com/badlogic/gdx/ai/fsm/DefaultStateMachine.java#L158-L173 |
Red5/red5-server-common | src/main/java/org/red5/server/scope/Scope.java | Scope.hasChildScope | public boolean hasChildScope(ScopeType type, String name) {
"""
Check whether scope has child scope with given name and type
@param type Child scope type
@param name Child scope name
@return true if scope has child node with given name and type, false otherwise
"""
log.debug("Has child scope? {} ... | java | public boolean hasChildScope(ScopeType type, String name) {
log.debug("Has child scope? {} in {}", name, this);
return children.getBasicScope(type, name) != null;
} | [
"public",
"boolean",
"hasChildScope",
"(",
"ScopeType",
"type",
",",
"String",
"name",
")",
"{",
"log",
".",
"debug",
"(",
"\"Has child scope? {} in {}\"",
",",
"name",
",",
"this",
")",
";",
"return",
"children",
".",
"getBasicScope",
"(",
"type",
",",
"nam... | Check whether scope has child scope with given name and type
@param type Child scope type
@param name Child scope name
@return true if scope has child node with given name and type, false otherwise | [
"Check",
"whether",
"scope",
"has",
"child",
"scope",
"with",
"given",
"name",
"and",
"type"
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/scope/Scope.java#L818-L821 |
networknt/light-rest-4j | openapi-validator/src/main/java/com/networknt/openapi/ResponseValidator.java | ResponseValidator.getOpenApiOperation | private OpenApiOperation getOpenApiOperation(String uri, String httpMethod) throws URISyntaxException {
"""
locate operation based on uri and httpMethod
@param uri original uri of the request
@param httpMethod http method of the request
@return OpenApiOperation the wrapper of an api operation
"""
St... | java | private OpenApiOperation getOpenApiOperation(String uri, String httpMethod) throws URISyntaxException {
String uriWithoutQuery = new URI(uri).getPath();
NormalisedPath requestPath = new ApiNormalisedPath(uriWithoutQuery);
Optional<NormalisedPath> maybeApiPath = OpenApiHelper.findMatchingApiPath(... | [
"private",
"OpenApiOperation",
"getOpenApiOperation",
"(",
"String",
"uri",
",",
"String",
"httpMethod",
")",
"throws",
"URISyntaxException",
"{",
"String",
"uriWithoutQuery",
"=",
"new",
"URI",
"(",
"uri",
")",
".",
"getPath",
"(",
")",
";",
"NormalisedPath",
"... | locate operation based on uri and httpMethod
@param uri original uri of the request
@param httpMethod http method of the request
@return OpenApiOperation the wrapper of an api operation | [
"locate",
"operation",
"based",
"on",
"uri",
"and",
"httpMethod"
] | train | https://github.com/networknt/light-rest-4j/blob/06b15128e6101351e617284a636ef5d632e6b1fe/openapi-validator/src/main/java/com/networknt/openapi/ResponseValidator.java#L173-L186 |
overturetool/overture | core/parser/src/main/java/org/overture/parser/lex/BacktrackInputReader.java | BacktrackInputReader.readerFactory | public static InputStreamReader readerFactory(File file, String charset)
throws IOException {
"""
Create an InputStreamReader from a File, depending on the filename.
@param file
@param charset
@return
@throws IOException
"""
String name = file.getName();
if (name.toLowerCase().endsWith(".doc"))
... | java | public static InputStreamReader readerFactory(File file, String charset)
throws IOException
{
String name = file.getName();
if (name.toLowerCase().endsWith(".doc"))
{
return new DocStreamReader(new FileInputStream(file), charset);
} else if (name.toLowerCase().endsWith(".docx"))
{
return new DocxSt... | [
"public",
"static",
"InputStreamReader",
"readerFactory",
"(",
"File",
"file",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"String",
"name",
"=",
"file",
".",
"getName",
"(",
")",
";",
"if",
"(",
"name",
".",
"toLowerCase",
"(",
")",
".",
... | Create an InputStreamReader from a File, depending on the filename.
@param file
@param charset
@return
@throws IOException | [
"Create",
"an",
"InputStreamReader",
"from",
"a",
"File",
"depending",
"on",
"the",
"filename",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/parser/src/main/java/org/overture/parser/lex/BacktrackInputReader.java#L208-L226 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bos/BosClient.java | BosClient.getObjectContent | public byte[] getObjectContent(GetObjectRequest request) {
"""
Gets the object content stored in Bos under the specified bucket and key.
@param request The request object containing all the options on how to download the Bos object content.
@return The object content stored in Bos in the specified bucket and k... | java | public byte[] getObjectContent(GetObjectRequest request) {
BosObjectInputStream content = this.getObject(request).getObjectContent();
try {
return IOUtils.toByteArray(content);
} catch (IOException e) {
try {
content.close();
} catch (IOExcepti... | [
"public",
"byte",
"[",
"]",
"getObjectContent",
"(",
"GetObjectRequest",
"request",
")",
"{",
"BosObjectInputStream",
"content",
"=",
"this",
".",
"getObject",
"(",
"request",
")",
".",
"getObjectContent",
"(",
")",
";",
"try",
"{",
"return",
"IOUtils",
".",
... | Gets the object content stored in Bos under the specified bucket and key.
@param request The request object containing all the options on how to download the Bos object content.
@return The object content stored in Bos in the specified bucket and key. | [
"Gets",
"the",
"object",
"content",
"stored",
"in",
"Bos",
"under",
"the",
"specified",
"bucket",
"and",
"key",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bos/BosClient.java#L724-L742 |
landawn/AbacusUtil | src/com/landawn/abacus/dataSource/PoolableConnection.java | PoolableConnection.createStatement | @Override
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
"""
Method createStatement.
@param resultSetType
@param resultSetConcurrency
@return Statement
@throws SQLException
@see java.sql.Connection#createStatement(int, int)
"""
// return... | java | @Override
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
// return new
// NativeStatement(internalConn.createStatement(resultSetType,
// resultSetConcurrency), this);
return internalConn.createStatement(resultSetType, resultSe... | [
"@",
"Override",
"public",
"Statement",
"createStatement",
"(",
"int",
"resultSetType",
",",
"int",
"resultSetConcurrency",
")",
"throws",
"SQLException",
"{",
"// return new\r",
"// NativeStatement(internalConn.createStatement(resultSetType,\r",
"// resultSetConcurrency), this);\r... | Method createStatement.
@param resultSetType
@param resultSetConcurrency
@return Statement
@throws SQLException
@see java.sql.Connection#createStatement(int, int) | [
"Method",
"createStatement",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolableConnection.java#L272-L278 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.