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 |
|---|---|---|---|---|---|---|---|---|---|---|
dickschoeller/gedbrowser | gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/users/UsersWriter.java | UsersWriter.appendRoles | private void appendRoles(final StringBuilder builder, final User user) {
"""
Append roles to the builder.
@param builder the builder
@param user the user whose roles are appended
"""
for (final UserRoleName role : user.getRoles()) {
append(builder, ",", role.name());
}
} | java | private void appendRoles(final StringBuilder builder, final User user) {
for (final UserRoleName role : user.getRoles()) {
append(builder, ",", role.name());
}
} | [
"private",
"void",
"appendRoles",
"(",
"final",
"StringBuilder",
"builder",
",",
"final",
"User",
"user",
")",
"{",
"for",
"(",
"final",
"UserRoleName",
"role",
":",
"user",
".",
"getRoles",
"(",
")",
")",
"{",
"append",
"(",
"builder",
",",
"\",\"",
","... | Append roles to the builder.
@param builder the builder
@param user the user whose roles are appended | [
"Append",
"roles",
"to",
"the",
"builder",
"."
] | train | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/users/UsersWriter.java#L122-L126 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java | BigtableVeneerSettingsFactory.buildSampleRowKeysSettings | private static void buildSampleRowKeysSettings(Builder builder, BigtableOptions options) {
"""
To build BigtableDataSettings#sampleRowKeysSettings with default Retry settings.
"""
RetrySettings retrySettings =
buildIdempotentRetrySettings(builder.sampleRowKeysSettings().getRetrySettings(), options)... | java | private static void buildSampleRowKeysSettings(Builder builder, BigtableOptions options) {
RetrySettings retrySettings =
buildIdempotentRetrySettings(builder.sampleRowKeysSettings().getRetrySettings(), options);
builder.sampleRowKeysSettings()
.setRetrySettings(retrySettings)
.setRetrya... | [
"private",
"static",
"void",
"buildSampleRowKeysSettings",
"(",
"Builder",
"builder",
",",
"BigtableOptions",
"options",
")",
"{",
"RetrySettings",
"retrySettings",
"=",
"buildIdempotentRetrySettings",
"(",
"builder",
".",
"sampleRowKeysSettings",
"(",
")",
".",
"getRet... | To build BigtableDataSettings#sampleRowKeysSettings with default Retry settings. | [
"To",
"build",
"BigtableDataSettings#sampleRowKeysSettings",
"with",
"default",
"Retry",
"settings",
"."
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java#L204-L211 |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBQuery.java | CouchDBQuery.recursivelyPopulateEntities | @Override
protected List recursivelyPopulateEntities(EntityMetadata m, Client client) {
"""
Recursively populate entity.
@param m
the m
@param client
the client
@return the list
"""
List<EnhanceEntity> ls = populateEntities(m, client);
return setRelationEntities(ls, client, m);
} | java | @Override
protected List recursivelyPopulateEntities(EntityMetadata m, Client client)
{
List<EnhanceEntity> ls = populateEntities(m, client);
return setRelationEntities(ls, client, m);
} | [
"@",
"Override",
"protected",
"List",
"recursivelyPopulateEntities",
"(",
"EntityMetadata",
"m",
",",
"Client",
"client",
")",
"{",
"List",
"<",
"EnhanceEntity",
">",
"ls",
"=",
"populateEntities",
"(",
"m",
",",
"client",
")",
";",
"return",
"setRelationEntitie... | Recursively populate entity.
@param m
the m
@param client
the client
@return the list | [
"Recursively",
"populate",
"entity",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBQuery.java#L127-L132 |
michael-rapp/AndroidBottomSheet | library/src/main/java/de/mrapp/android/bottomsheet/adapter/DividableGridAdapter.java | DividableGridAdapter.setItemEnabled | public final void setItemEnabled(final int index, final boolean enabled) {
"""
Sets, whether the item at a specific index should be enabled, or not.
@param index
The index of the item as an {@link Integer} value
@param enabled
True, if the item should be enabled, false otherwise
"""
AbstractItem ... | java | public final void setItemEnabled(final int index, final boolean enabled) {
AbstractItem item = items.get(index);
if (item instanceof Item) {
((Item) item).setEnabled(enabled);
rawItems = null;
notifyOnDataSetChanged();
}
} | [
"public",
"final",
"void",
"setItemEnabled",
"(",
"final",
"int",
"index",
",",
"final",
"boolean",
"enabled",
")",
"{",
"AbstractItem",
"item",
"=",
"items",
".",
"get",
"(",
"index",
")",
";",
"if",
"(",
"item",
"instanceof",
"Item",
")",
"{",
"(",
"... | Sets, whether the item at a specific index should be enabled, or not.
@param index
The index of the item as an {@link Integer} value
@param enabled
True, if the item should be enabled, false otherwise | [
"Sets",
"whether",
"the",
"item",
"at",
"a",
"specific",
"index",
"should",
"be",
"enabled",
"or",
"not",
"."
] | train | https://github.com/michael-rapp/AndroidBottomSheet/blob/6e4690ee9f63b14a7b143d3a3717b5f8a11ca503/library/src/main/java/de/mrapp/android/bottomsheet/adapter/DividableGridAdapter.java#L599-L607 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java | FactoryPointTracker.combined_FH_SURF_KLT | public static <I extends ImageGray<I>>
PointTracker<I> combined_FH_SURF_KLT( PkltConfig kltConfig ,
int reactivateThreshold ,
ConfigFastHessian configDetector ,
ConfigSurfDescribe.Stability configDescribe ,
ConfigSlidingIntegral configOrientation ,
Class<I> i... | java | public static <I extends ImageGray<I>>
PointTracker<I> combined_FH_SURF_KLT( PkltConfig kltConfig ,
int reactivateThreshold ,
ConfigFastHessian configDetector ,
ConfigSurfDescribe.Stability configDescribe ,
ConfigSlidingIntegral configOrientation ,
Class<I> i... | [
"public",
"static",
"<",
"I",
"extends",
"ImageGray",
"<",
"I",
">",
">",
"PointTracker",
"<",
"I",
">",
"combined_FH_SURF_KLT",
"(",
"PkltConfig",
"kltConfig",
",",
"int",
"reactivateThreshold",
",",
"ConfigFastHessian",
"configDetector",
",",
"ConfigSurfDescribe",... | Creates a tracker which detects Fast-Hessian features, describes them with SURF, nominally tracks them using KLT.
@see DescribePointSurf
@see boofcv.abst.feature.tracker.DdaManagerDetectDescribePoint
@param kltConfig Configuration for KLT tracker
@param reactivateThreshold Tracks are reactivated after this many have ... | [
"Creates",
"a",
"tracker",
"which",
"detects",
"Fast",
"-",
"Hessian",
"features",
"describes",
"them",
"with",
"SURF",
"nominally",
"tracks",
"them",
"using",
"KLT",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java#L387-L404 |
icode/ameba | src/main/java/ameba/container/server/Connector.java | Connector.createDefaultConnectors | public static List<Connector> createDefaultConnectors(Map<String, Object> properties) {
"""
<p>createDefaultConnectors.</p>
@param properties a {@link java.util.Map} object.
@return a {@link java.util.List} object.
"""
List<Connector> connectors = Lists.newArrayList();
Map<String, Map<Strin... | java | public static List<Connector> createDefaultConnectors(Map<String, Object> properties) {
List<Connector> connectors = Lists.newArrayList();
Map<String, Map<String, String>> propertiesMap = Maps.newLinkedHashMap();
for (String key : properties.keySet()) {
if (key.startsWith(Connector.C... | [
"public",
"static",
"List",
"<",
"Connector",
">",
"createDefaultConnectors",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"List",
"<",
"Connector",
">",
"connectors",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"Map",
"<",
... | <p>createDefaultConnectors.</p>
@param properties a {@link java.util.Map} object.
@return a {@link java.util.List} object. | [
"<p",
">",
"createDefaultConnectors",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/container/server/Connector.java#L121-L145 |
phoenixnap/springmvc-raml-plugin | src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/helpers/NamingHelper.java | NamingHelper.getResourceName | public static String getResourceName(RamlResource resource, boolean singularize) {
"""
Attempts to infer the name of a resource from a resources's relative URL
@param resource
The raml resource being parsed
@param singularize
indicates if the resource name should be singularized or not
@return A name repres... | java | public static String getResourceName(RamlResource resource, boolean singularize) {
String url = resource.getRelativeUri();
if (StringUtils.hasText(url) && url.contains("/") && (url.lastIndexOf('/') < url.length())) {
return getResourceName(url.substring(url.lastIndexOf('/') + 1), singularize);
}
return nul... | [
"public",
"static",
"String",
"getResourceName",
"(",
"RamlResource",
"resource",
",",
"boolean",
"singularize",
")",
"{",
"String",
"url",
"=",
"resource",
".",
"getRelativeUri",
"(",
")",
";",
"if",
"(",
"StringUtils",
".",
"hasText",
"(",
"url",
")",
"&&"... | Attempts to infer the name of a resource from a resources's relative URL
@param resource
The raml resource being parsed
@param singularize
indicates if the resource name should be singularized or not
@return A name representing this resource or null if one cannot be
inferred | [
"Attempts",
"to",
"infer",
"the",
"name",
"of",
"a",
"resource",
"from",
"a",
"resources",
"s",
"relative",
"URL"
] | train | https://github.com/phoenixnap/springmvc-raml-plugin/blob/6387072317cd771eb7d6f30943f556ac20dd3c84/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/helpers/NamingHelper.java#L242-L250 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/Matrix.java | Matrix.getColumnView | public Vec getColumnView(final int j) {
"""
Obtains a vector that is backed by <i>this</i>, at very little memory
cost. Mutations to this vector will alter the values stored in the
matrix, and vice versa.
@param j the column to obtain a view of
@return a vector backed by the specified row of the matrix
"... | java | public Vec getColumnView(final int j)
{
final Matrix M = this;
return new Vec()
{
private static final long serialVersionUID = 7107290189250645384L;
@Override
public int length()
{
return rows();
}
@Ov... | [
"public",
"Vec",
"getColumnView",
"(",
"final",
"int",
"j",
")",
"{",
"final",
"Matrix",
"M",
"=",
"this",
";",
"return",
"new",
"Vec",
"(",
")",
"{",
"private",
"static",
"final",
"long",
"serialVersionUID",
"=",
"7107290189250645384L",
";",
"@",
"Overrid... | Obtains a vector that is backed by <i>this</i>, at very little memory
cost. Mutations to this vector will alter the values stored in the
matrix, and vice versa.
@param j the column to obtain a view of
@return a vector backed by the specified row of the matrix | [
"Obtains",
"a",
"vector",
"that",
"is",
"backed",
"by",
"<i",
">",
"this<",
"/",
"i",
">",
"at",
"very",
"little",
"memory",
"cost",
".",
"Mutations",
"to",
"this",
"vector",
"will",
"alter",
"the",
"values",
"stored",
"in",
"the",
"matrix",
"and",
"vi... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L628-L674 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java | KeyVaultClientCustomImpl.getSecretAsync | public ServiceFuture<SecretBundle> getSecretAsync(String vaultBaseUrl, String secretName,
final ServiceCallback<SecretBundle> serviceCallback) {
"""
Get a specified secret from a given key vault.
@param vaultBaseUrl
The vault name, e.g. https://myvault.vault.azure.net
@param secretName
The name o... | java | public ServiceFuture<SecretBundle> getSecretAsync(String vaultBaseUrl, String secretName,
final ServiceCallback<SecretBundle> serviceCallback) {
return getSecretAsync(vaultBaseUrl, secretName, "", serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"SecretBundle",
">",
"getSecretAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"secretName",
",",
"final",
"ServiceCallback",
"<",
"SecretBundle",
">",
"serviceCallback",
")",
"{",
"return",
"getSecretAsync",
"(",
"vaultBaseUrl",
... | Get a specified secret from a given key vault.
@param vaultBaseUrl
The vault name, e.g. https://myvault.vault.azure.net
@param secretName
The name of the secret in the given vault
@param serviceCallback
the async ServiceCallback to handle successful and failed
responses.
@return the {@link ServiceFuture} object | [
"Get",
"a",
"specified",
"secret",
"from",
"a",
"given",
"key",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java#L1157-L1160 |
jmeter-maven-plugin/jmeter-maven-plugin | src/main/java/com/lazerycode/jmeter/mojo/ConfigureJMeterMojo.java | ConfigureJMeterMojo.extractConfigSettings | private void extractConfigSettings(Artifact artifact) throws MojoExecutionException {
"""
Extract the configuration settings (not properties files) from the configuration artifact
and load them into the /bin directory
@param artifact Configuration artifact
@throws MojoExecutionException MojoExecutionException... | java | private void extractConfigSettings(Artifact artifact) throws MojoExecutionException {// NOSONAR
try (JarFile configSettings = new JarFile(artifact.getFile())) {
Enumeration<JarEntry> entries = configSettings.entries();
while (entries.hasMoreElements()) {
JarEntry jarFileE... | [
"private",
"void",
"extractConfigSettings",
"(",
"Artifact",
"artifact",
")",
"throws",
"MojoExecutionException",
"{",
"// NOSONAR",
"try",
"(",
"JarFile",
"configSettings",
"=",
"new",
"JarFile",
"(",
"artifact",
".",
"getFile",
"(",
")",
")",
")",
"{",
"Enumer... | Extract the configuration settings (not properties files) from the configuration artifact
and load them into the /bin directory
@param artifact Configuration artifact
@throws MojoExecutionException MojoExecutionException | [
"Extract",
"the",
"configuration",
"settings",
"(",
"not",
"properties",
"files",
")",
"from",
"the",
"configuration",
"artifact",
"and",
"load",
"them",
"into",
"the",
"/",
"bin",
"directory"
] | train | https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/blob/63dc8b49cc6b9542deb681e25a2ada6025ddbf6b/src/main/java/com/lazerycode/jmeter/mojo/ConfigureJMeterMojo.java#L674-L689 |
lonnyj/liquibase-spatial | src/main/java/liquibase/ext/spatial/sqlgenerator/AbstractSpatialInsertGenerator.java | AbstractSpatialInsertGenerator.handleColumnValue | protected Object handleColumnValue(final Object oldValue, final Database database) {
"""
If the old value is a geometry or a Well-Known Text, convert it to the appropriate new value.
Otherwise, this method returns the old value.
@param oldValue
the old value.
@param database
the database instance.
@retur... | java | protected Object handleColumnValue(final Object oldValue, final Database database) {
final Object newValue = WktConversionUtils.handleColumnValue(oldValue, database, this);
return newValue;
} | [
"protected",
"Object",
"handleColumnValue",
"(",
"final",
"Object",
"oldValue",
",",
"final",
"Database",
"database",
")",
"{",
"final",
"Object",
"newValue",
"=",
"WktConversionUtils",
".",
"handleColumnValue",
"(",
"oldValue",
",",
"database",
",",
"this",
")",
... | If the old value is a geometry or a Well-Known Text, convert it to the appropriate new value.
Otherwise, this method returns the old value.
@param oldValue
the old value.
@param database
the database instance.
@return the new value. | [
"If",
"the",
"old",
"value",
"is",
"a",
"geometry",
"or",
"a",
"Well",
"-",
"Known",
"Text",
"convert",
"it",
"to",
"the",
"appropriate",
"new",
"value",
".",
"Otherwise",
"this",
"method",
"returns",
"the",
"old",
"value",
"."
] | train | https://github.com/lonnyj/liquibase-spatial/blob/36ae41b0d3d08bb00a22c856e51ffeed08891c0e/src/main/java/liquibase/ext/spatial/sqlgenerator/AbstractSpatialInsertGenerator.java#L83-L86 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/LogisticDistribution.java | LogisticDistribution.logpdf | public static double logpdf(double val, double loc, double scale) {
"""
log Probability density function.
@param val Value
@param loc Location
@param scale Scale
@return log PDF
"""
val = Math.abs((val - loc) / scale);
double f = 1.0 + FastMath.exp(-val);
return -val - FastMath.log(scale * f ... | java | public static double logpdf(double val, double loc, double scale) {
val = Math.abs((val - loc) / scale);
double f = 1.0 + FastMath.exp(-val);
return -val - FastMath.log(scale * f * f);
} | [
"public",
"static",
"double",
"logpdf",
"(",
"double",
"val",
",",
"double",
"loc",
",",
"double",
"scale",
")",
"{",
"val",
"=",
"Math",
".",
"abs",
"(",
"(",
"val",
"-",
"loc",
")",
"/",
"scale",
")",
";",
"double",
"f",
"=",
"1.0",
"+",
"FastM... | log Probability density function.
@param val Value
@param loc Location
@param scale Scale
@return log PDF | [
"log",
"Probability",
"density",
"function",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/LogisticDistribution.java#L132-L136 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/ArrayListIterate.java | ArrayListIterate.forEach | public static <T> void forEach(ArrayList<T> list, int from, int to, Procedure<? super T> procedure) {
"""
Iterates over the section of the list covered by the specified indexes. The indexes are both inclusive. If the
from is less than the to, the list is iterated in forward order. If the from is greater than th... | java | public static <T> void forEach(ArrayList<T> list, int from, int to, Procedure<? super T> procedure)
{
ListIterate.rangeCheck(from, to, list.size());
if (ArrayListIterate.isOptimizableArrayList(list, to - from + 1))
{
T[] elements = ArrayListIterate.getInternalArray(list);
... | [
"public",
"static",
"<",
"T",
">",
"void",
"forEach",
"(",
"ArrayList",
"<",
"T",
">",
"list",
",",
"int",
"from",
",",
"int",
"to",
",",
"Procedure",
"<",
"?",
"super",
"T",
">",
"procedure",
")",
"{",
"ListIterate",
".",
"rangeCheck",
"(",
"from",
... | Iterates over the section of the list covered by the specified indexes. The indexes are both inclusive. If the
from is less than the to, the list is iterated in forward order. If the from is greater than the to, then the
list is iterated in the reverse order.
<p>
<pre>e.g.
ArrayList<People> people = new ArrayList<Peo... | [
"Iterates",
"over",
"the",
"section",
"of",
"the",
"list",
"covered",
"by",
"the",
"specified",
"indexes",
".",
"The",
"indexes",
"are",
"both",
"inclusive",
".",
"If",
"the",
"from",
"is",
"less",
"than",
"the",
"to",
"the",
"list",
"is",
"iterated",
"i... | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/ArrayListIterate.java#L809-L822 |
vipshop/vjtools | vjtop/src/main/java/com/vip/vjtools/vjtop/VMInfo.java | VMInfo.createDeadVM | public static VMInfo createDeadVM(String pid, VMInfoState state) {
"""
Creates a dead VMInfo, representing a jvm in a given state which cannot
be attached or other monitoring issues occurred.
"""
VMInfo vmInfo = new VMInfo();
vmInfo.state = state;
vmInfo.pid = pid;
return vmInfo;
} | java | public static VMInfo createDeadVM(String pid, VMInfoState state) {
VMInfo vmInfo = new VMInfo();
vmInfo.state = state;
vmInfo.pid = pid;
return vmInfo;
} | [
"public",
"static",
"VMInfo",
"createDeadVM",
"(",
"String",
"pid",
",",
"VMInfoState",
"state",
")",
"{",
"VMInfo",
"vmInfo",
"=",
"new",
"VMInfo",
"(",
")",
";",
"vmInfo",
".",
"state",
"=",
"state",
";",
"vmInfo",
".",
"pid",
"=",
"pid",
";",
"retur... | Creates a dead VMInfo, representing a jvm in a given state which cannot
be attached or other monitoring issues occurred. | [
"Creates",
"a",
"dead",
"VMInfo",
"representing",
"a",
"jvm",
"in",
"a",
"given",
"state",
"which",
"cannot",
"be",
"attached",
"or",
"other",
"monitoring",
"issues",
"occurred",
"."
] | train | https://github.com/vipshop/vjtools/blob/60c743da35913d72f37f2d79afa90ad2bf73cb89/vjtop/src/main/java/com/vip/vjtools/vjtop/VMInfo.java#L151-L156 |
guardtime/ksi-java-sdk | ksi-common/src/main/java/com/guardtime/ksi/hashing/DataHasher.java | DataHasher.addData | public final DataHasher addData(byte[] data, int offset, int length) {
"""
Updates the digest using the specified array of bytes, starting at the specified offset.
@param data the array of bytes.
@param offset the offset to start from in the array of bytes.
@param length the number of bytes to use, starting... | java | public final DataHasher addData(byte[] data, int offset, int length) {
if (outputHash != null) {
throw new IllegalStateException("Output hash has already been calculated");
}
messageDigest.update(data, offset, length);
return this;
} | [
"public",
"final",
"DataHasher",
"addData",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"outputHash",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Output hash has already been calc... | Updates the digest using the specified array of bytes, starting at the specified offset.
@param data the array of bytes.
@param offset the offset to start from in the array of bytes.
@param length the number of bytes to use, starting at the offset.
@return The same {@link DataHasher} object for chaining calls.
@th... | [
"Updates",
"the",
"digest",
"using",
"the",
"specified",
"array",
"of",
"bytes",
"starting",
"at",
"the",
"specified",
"offset",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/hashing/DataHasher.java#L144-L150 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/core/services/MethodServices.java | MethodServices.getNonProxiedMethod | public Method getNonProxiedMethod(Class cls, String methodName, Class<?>... parameterTypes) throws NoSuchMethodException {
"""
Get the method on origin class without proxies
@param cls
@param methodName
@param parameterTypes
@throws NoSuchMethodException
@return
"""
return cls.getMethod(methodName, p... | java | public Method getNonProxiedMethod(Class cls, String methodName, Class<?>... parameterTypes) throws NoSuchMethodException {
return cls.getMethod(methodName, parameterTypes);
} | [
"public",
"Method",
"getNonProxiedMethod",
"(",
"Class",
"cls",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"...",
"parameterTypes",
")",
"throws",
"NoSuchMethodException",
"{",
"return",
"cls",
".",
"getMethod",
"(",
"methodName",
",",
"parameterT... | Get the method on origin class without proxies
@param cls
@param methodName
@param parameterTypes
@throws NoSuchMethodException
@return | [
"Get",
"the",
"method",
"on",
"origin",
"class",
"without",
"proxies"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/core/services/MethodServices.java#L79-L81 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/TempFileProvider.java | TempFileProvider.createTempDir | public TempDir createTempDir(String originalName) throws IOException {
"""
Create a temp directory, into which temporary files may be placed.
@param originalName the original file name
@return the temp directory
@throws IOException for any error
"""
if (!open.get()) {
throw VFSMessages... | java | public TempDir createTempDir(String originalName) throws IOException {
if (!open.get()) {
throw VFSMessages.MESSAGES.tempFileProviderClosed();
}
final String name = createTempName(originalName + "-", "");
final File f = new File(providerRoot, name);
for (int i = 0; i ... | [
"public",
"TempDir",
"createTempDir",
"(",
"String",
"originalName",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"open",
".",
"get",
"(",
")",
")",
"{",
"throw",
"VFSMessages",
".",
"MESSAGES",
".",
"tempFileProviderClosed",
"(",
")",
";",
"}",
"fin... | Create a temp directory, into which temporary files may be placed.
@param originalName the original file name
@return the temp directory
@throws IOException for any error | [
"Create",
"a",
"temp",
"directory",
"into",
"which",
"temporary",
"files",
"may",
"be",
"placed",
"."
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/TempFileProvider.java#L131-L143 |
httl/httl | httl/src/main/java/httl/Engine.java | Engine.getProperty | public boolean getProperty(String key, boolean defaultValue) {
"""
Get config boolean value.
@param key - config key
@param defaultValue - default boolean value
@return config boolean value
@see #getEngine()
"""
String value = getProperty(key, String.class);
return StringUtils.is... | java | public boolean getProperty(String key, boolean defaultValue) {
String value = getProperty(key, String.class);
return StringUtils.isEmpty(value) ? defaultValue : Boolean.parseBoolean(value);
} | [
"public",
"boolean",
"getProperty",
"(",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getProperty",
"(",
"key",
",",
"String",
".",
"class",
")",
";",
"return",
"StringUtils",
".",
"isEmpty",
"(",
"value",
")",
"?",
... | Get config boolean value.
@param key - config key
@param defaultValue - default boolean value
@return config boolean value
@see #getEngine() | [
"Get",
"config",
"boolean",
"value",
"."
] | train | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/Engine.java#L233-L236 |
headius/invokebinder | src/main/java/com/headius/invokebinder/SmartHandle.java | SmartHandle.returnValue | public SmartHandle returnValue(Class<?> type, Object value) {
"""
Replace the return value with the given value, performing no other
processing of the original value.
@param type the type for the new return value
@param value the new value to return
@return a new SmartHandle that returns the given value
... | java | public SmartHandle returnValue(Class<?> type, Object value) {
return new SmartHandle(signature.changeReturn(type), MethodHandles.filterReturnValue(handle, MethodHandles.constant(type, value)));
} | [
"public",
"SmartHandle",
"returnValue",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Object",
"value",
")",
"{",
"return",
"new",
"SmartHandle",
"(",
"signature",
".",
"changeReturn",
"(",
"type",
")",
",",
"MethodHandles",
".",
"filterReturnValue",
"(",
"hand... | Replace the return value with the given value, performing no other
processing of the original value.
@param type the type for the new return value
@param value the new value to return
@return a new SmartHandle that returns the given value | [
"Replace",
"the",
"return",
"value",
"with",
"the",
"given",
"value",
"performing",
"no",
"other",
"processing",
"of",
"the",
"original",
"value",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartHandle.java#L323-L325 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java | PersonGroupPersonsImpl.createAsync | public Observable<Person> createAsync(String personGroupId, CreatePersonGroupPersonsOptionalParameter createOptionalParameter) {
"""
Create a new person in a specified person group.
@param personGroupId Id referencing a particular person group.
@param createOptionalParameter the object representing the optiona... | java | public Observable<Person> createAsync(String personGroupId, CreatePersonGroupPersonsOptionalParameter createOptionalParameter) {
return createWithServiceResponseAsync(personGroupId, createOptionalParameter).map(new Func1<ServiceResponse<Person>, Person>() {
@Override
public Person call(S... | [
"public",
"Observable",
"<",
"Person",
">",
"createAsync",
"(",
"String",
"personGroupId",
",",
"CreatePersonGroupPersonsOptionalParameter",
"createOptionalParameter",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"personGroupId",
",",
"createOptionalParameter",
... | Create a new person in a specified person group.
@param personGroupId Id referencing a particular person group.
@param createOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observab... | [
"Create",
"a",
"new",
"person",
"in",
"a",
"specified",
"person",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java#L155-L162 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/MemberMap.java | MemberMap.cloneAdding | static MemberMap cloneAdding(MemberMap source, MemberImpl... newMembers) {
"""
Creates clone of source {@code MemberMap} additionally including new members.
@param source source map
@param newMembers new members to add
@return clone map
"""
Map<Address, MemberImpl> addressMap = new LinkedHashM... | java | static MemberMap cloneAdding(MemberMap source, MemberImpl... newMembers) {
Map<Address, MemberImpl> addressMap = new LinkedHashMap<>(source.addressToMemberMap);
Map<String, MemberImpl> uuidMap = new LinkedHashMap<>(source.uuidToMemberMap);
for (MemberImpl member : newMembers) {
putM... | [
"static",
"MemberMap",
"cloneAdding",
"(",
"MemberMap",
"source",
",",
"MemberImpl",
"...",
"newMembers",
")",
"{",
"Map",
"<",
"Address",
",",
"MemberImpl",
">",
"addressMap",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
"source",
".",
"addressToMemberMap",
")",
"... | Creates clone of source {@code MemberMap} additionally including new members.
@param source source map
@param newMembers new members to add
@return clone map | [
"Creates",
"clone",
"of",
"source",
"{",
"@code",
"MemberMap",
"}",
"additionally",
"including",
"new",
"members",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/MemberMap.java#L145-L154 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/VoltTypeUtil.java | VoltTypeUtil.getNumericLiteralType | public static VoltType getNumericLiteralType(VoltType vt, String value) {
"""
If the type is NUMERIC from hsqldb, VoltDB has to decide its real type.
It's either INTEGER or DECIMAL according to the SQL Standard.
Thanks for Hsqldb 1.9, FLOAT literal values have been handled well with E sign.
@param vt
@param va... | java | public static VoltType getNumericLiteralType(VoltType vt, String value) {
try {
Long.parseLong(value);
} catch (NumberFormatException e) {
// Our DECIMAL may not be bigger/smaller enough to store the constant value
return VoltType.DECIMAL;
}
return vt;... | [
"public",
"static",
"VoltType",
"getNumericLiteralType",
"(",
"VoltType",
"vt",
",",
"String",
"value",
")",
"{",
"try",
"{",
"Long",
".",
"parseLong",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
")",
"{",
"// Our DECIMAL may not b... | If the type is NUMERIC from hsqldb, VoltDB has to decide its real type.
It's either INTEGER or DECIMAL according to the SQL Standard.
Thanks for Hsqldb 1.9, FLOAT literal values have been handled well with E sign.
@param vt
@param value
@return | [
"If",
"the",
"type",
"is",
"NUMERIC",
"from",
"hsqldb",
"VoltDB",
"has",
"to",
"decide",
"its",
"real",
"type",
".",
"It",
"s",
"either",
"INTEGER",
"or",
"DECIMAL",
"according",
"to",
"the",
"SQL",
"Standard",
".",
"Thanks",
"for",
"Hsqldb",
"1",
".",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/VoltTypeUtil.java#L352-L360 |
banq/jdonframework | src/main/java/com/jdon/controller/WebAppUtil.java | WebAppUtil.callService | public static Object callService(String serviceName, String methodName, Object[] methodParams, HttpServletRequest request) throws Exception {
"""
Command pattern for service invoke sample: browser url:
/aaa.do?method=xxxxx
xxxxx is the service's method, such as:
public interface TestService{ void xxxxx(Even... | java | public static Object callService(String serviceName, String methodName, Object[] methodParams, HttpServletRequest request) throws Exception {
Debug.logVerbose("[JdonFramework] call the method: " + methodName + " for the service: " + serviceName, module);
Object result = null;
try {
MethodMetaArgs methodMet... | [
"public",
"static",
"Object",
"callService",
"(",
"String",
"serviceName",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"methodParams",
",",
"HttpServletRequest",
"request",
")",
"throws",
"Exception",
"{",
"Debug",
".",
"logVerbose",
"(",
"\"[JdonFramewo... | Command pattern for service invoke sample: browser url:
/aaa.do?method=xxxxx
xxxxx is the service's method, such as:
public interface TestService{ void xxxxx(EventModel em); }
@see com.jdon.strutsutil.ServiceMethodAction
@param serviceName
the service name in jdonframework.xml
@param methodName
the method name
@par... | [
"Command",
"pattern",
"for",
"service",
"invoke",
"sample",
":",
"browser",
"url",
":",
"/",
"aaa",
".",
"do?method",
"=",
"xxxxx"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/controller/WebAppUtil.java#L185-L201 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.retrieveTrigger | public OperableTrigger retrieveTrigger(TriggerKey triggerKey, T jedis) throws JobPersistenceException {
"""
Retrieve a trigger from Redis
@param triggerKey the trigger key
@param jedis a thread-safe Redis connection
@return the requested {@link org.quartz.spi.OperableTrigger} if it exists; null if it does not
... | java | public OperableTrigger retrieveTrigger(TriggerKey triggerKey, T jedis) throws JobPersistenceException{
final String triggerHashKey = redisSchema.triggerHashKey(triggerKey);
Map<String, String> triggerMap = jedis.hgetAll(triggerHashKey);
if(triggerMap == null || triggerMap.isEmpty()){
... | [
"public",
"OperableTrigger",
"retrieveTrigger",
"(",
"TriggerKey",
"triggerKey",
",",
"T",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"final",
"String",
"triggerHashKey",
"=",
"redisSchema",
".",
"triggerHashKey",
"(",
"triggerKey",
")",
";",
"Map",
"<"... | Retrieve a trigger from Redis
@param triggerKey the trigger key
@param jedis a thread-safe Redis connection
@return the requested {@link org.quartz.spi.OperableTrigger} if it exists; null if it does not
@throws JobPersistenceException if the job associated with the retrieved trigger does not exist | [
"Retrieve",
"a",
"trigger",
"from",
"Redis"
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L278-L301 |
census-instrumentation/opencensus-java | examples/src/main/java/io/opencensus/examples/grpc/helloworld/HelloWorldClient.java | HelloWorldClient.main | public static void main(String[] args) throws IOException, InterruptedException {
"""
Greet server. If provided, the first element of {@code args} is the name to use in the
greeting.
"""
// Add final keyword to pass checkStyle.
final String user = getStringOrDefaultFromArgs(args, 0, "world");
fina... | java | public static void main(String[] args) throws IOException, InterruptedException {
// Add final keyword to pass checkStyle.
final String user = getStringOrDefaultFromArgs(args, 0, "world");
final String host = getStringOrDefaultFromArgs(args, 1, "localhost");
final int serverPort = getPortOrDefaultFromAr... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"// Add final keyword to pass checkStyle.",
"final",
"String",
"user",
"=",
"getStringOrDefaultFromArgs",
"(",
"args",
",",
"0",
",",... | Greet server. If provided, the first element of {@code args} is the name to use in the
greeting. | [
"Greet",
"server",
".",
"If",
"provided",
"the",
"first",
"element",
"of",
"{"
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/examples/src/main/java/io/opencensus/examples/grpc/helloworld/HelloWorldClient.java#L103-L151 |
QSFT/Doradus | doradus-server/src/examples/java/com/dell/doradus/service/olap/mono/OLAPMonoService.java | OLAPMonoService.addBatch | public BatchResult addBatch(ApplicationDefinition appDef, OlapBatch batch) {
"""
Add the given batch of object updates for the given application. The updates may
be new, updated, or deleted objects. The updates are applied to the application's
mono shard.
@param appDef Application to which update batch is ... | java | public BatchResult addBatch(ApplicationDefinition appDef, OlapBatch batch) {
return OLAPService.instance().addBatch(appDef, MONO_SHARD_NAME, batch);
} | [
"public",
"BatchResult",
"addBatch",
"(",
"ApplicationDefinition",
"appDef",
",",
"OlapBatch",
"batch",
")",
"{",
"return",
"OLAPService",
".",
"instance",
"(",
")",
".",
"addBatch",
"(",
"appDef",
",",
"MONO_SHARD_NAME",
",",
"batch",
")",
";",
"}"
] | Add the given batch of object updates for the given application. The updates may
be new, updated, or deleted objects. The updates are applied to the application's
mono shard.
@param appDef Application to which update batch is applied.
@param batch {@link OlapBatch} of object adds, updates, and/or deletes.
@retu... | [
"Add",
"the",
"given",
"batch",
"of",
"object",
"updates",
"for",
"the",
"given",
"application",
".",
"The",
"updates",
"may",
"be",
"new",
"updated",
"or",
"deleted",
"objects",
".",
"The",
"updates",
"are",
"applied",
"to",
"the",
"application",
"s",
"mo... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/examples/java/com/dell/doradus/service/olap/mono/OLAPMonoService.java#L161-L163 |
GerdHolz/TOVAL | src/de/invation/code/toval/properties/AbstractTypedProperties.java | AbstractTypedProperties.getProperty | public Object getProperty(P property) throws PropertyException {
"""
Extracts the value of the given property.<br>
@param property The property whose value is requested.
@return The property value or <code>null</code> in case there is no entry for the property.
@note Note, that for mandatory properties an exc... | java | public Object getProperty(P property) throws PropertyException{
// System.out.println("Getting property value " + property.getPropertyCharacteristics().getName());
String propertyValueAsString = props.getProperty(property.getPropertyCharacteristics().getName());
// System.out.println("Property value as string:" ... | [
"public",
"Object",
"getProperty",
"(",
"P",
"property",
")",
"throws",
"PropertyException",
"{",
"//\t\tSystem.out.println(\"Getting property value \" + property.getPropertyCharacteristics().getName());\r",
"String",
"propertyValueAsString",
"=",
"props",
".",
"getProperty",
"(",
... | Extracts the value of the given property.<br>
@param property The property whose value is requested.
@return The property value or <code>null</code> in case there is no entry for the property.
@note Note, that for mandatory properties an exception will be thrown in case no corresponding entry can be found.
@throws Pro... | [
"Extracts",
"the",
"value",
"of",
"the",
"given",
"property",
".",
"<br",
">"
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/properties/AbstractTypedProperties.java#L124-L134 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.getRemoteLoginSettingsAsync | public Observable<ComputeNodeGetRemoteLoginSettingsResult> getRemoteLoginSettingsAsync(String poolId, String nodeId) {
"""
Gets the settings required for remote login to a compute node.
Before you can remotely login to a node using the remote login settings, you must create a user account on the node. This API ca... | java | public Observable<ComputeNodeGetRemoteLoginSettingsResult> getRemoteLoginSettingsAsync(String poolId, String nodeId) {
return getRemoteLoginSettingsWithServiceResponseAsync(poolId, nodeId).map(new Func1<ServiceResponseWithHeaders<ComputeNodeGetRemoteLoginSettingsResult, ComputeNodeGetRemoteLoginSettingsHeaders>... | [
"public",
"Observable",
"<",
"ComputeNodeGetRemoteLoginSettingsResult",
">",
"getRemoteLoginSettingsAsync",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
")",
"{",
"return",
"getRemoteLoginSettingsWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeId",
")",
".",
"map... | Gets the settings required for remote login to a compute node.
Before you can remotely login to a node using the remote login settings, you must create a user account on the node. This API can be invoked only on pools created with the virtual machine configuration property. For pools created with a cloud service config... | [
"Gets",
"the",
"settings",
"required",
"for",
"remote",
"login",
"to",
"a",
"compute",
"node",
".",
"Before",
"you",
"can",
"remotely",
"login",
"to",
"a",
"node",
"using",
"the",
"remote",
"login",
"settings",
"you",
"must",
"create",
"a",
"user",
"accoun... | 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#L1956-L1963 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.convertFrom | public static <T extends ImageBase<T>> void convertFrom(BufferedImage src, T dst , boolean orderRgb) {
"""
Converts a buffered image into an image of the specified type.
@param src Input BufferedImage which is to be converted
@param dst The image which it is being converted into
@param orderRgb If applicable,... | java | public static <T extends ImageBase<T>> void convertFrom(BufferedImage src, T dst , boolean orderRgb) {
if( dst instanceof ImageGray) {
ImageGray sb = (ImageGray)dst;
convertFromSingle(src, sb, (Class<ImageGray>) sb.getClass());
} else if( dst instanceof Planar) {
Planar ms = (Planar)dst;
convertFromPlan... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"void",
"convertFrom",
"(",
"BufferedImage",
"src",
",",
"T",
"dst",
",",
"boolean",
"orderRgb",
")",
"{",
"if",
"(",
"dst",
"instanceof",
"ImageGray",
")",
"{",
"ImageGray",
"sb",... | Converts a buffered image into an image of the specified type.
@param src Input BufferedImage which is to be converted
@param dst The image which it is being converted into
@param orderRgb If applicable, should it adjust the ordering of each color band to maintain color consistency | [
"Converts",
"a",
"buffered",
"image",
"into",
"an",
"image",
"of",
"the",
"specified",
"type",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L269-L281 |
venmo/cursor-utils | cursor-utils/src/main/java/com/venmo/cursor/IterableCursorWrapper.java | IterableCursorWrapper.getLong | public long getLong(String columnName, long defaultValue) {
"""
Convenience alias to {@code getLong\(getColumnIndex(columnName))}. If the column does not
exist for the cursor, return {@code defaultValue}.
"""
int index = getColumnIndex(columnName);
if (isValidIndex(index)) {
return... | java | public long getLong(String columnName, long defaultValue) {
int index = getColumnIndex(columnName);
if (isValidIndex(index)) {
return getLong(index);
} else {
return defaultValue;
}
} | [
"public",
"long",
"getLong",
"(",
"String",
"columnName",
",",
"long",
"defaultValue",
")",
"{",
"int",
"index",
"=",
"getColumnIndex",
"(",
"columnName",
")",
";",
"if",
"(",
"isValidIndex",
"(",
"index",
")",
")",
"{",
"return",
"getLong",
"(",
"index",
... | Convenience alias to {@code getLong\(getColumnIndex(columnName))}. If the column does not
exist for the cursor, return {@code defaultValue}. | [
"Convenience",
"alias",
"to",
"{"
] | train | https://github.com/venmo/cursor-utils/blob/52cf91c4253346632fe70b8d7b7eab8bbcc9b248/cursor-utils/src/main/java/com/venmo/cursor/IterableCursorWrapper.java#L90-L97 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/basic/service_stats.java | service_stats.get | public static service_stats get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch statistics of service_stats resource of given name .
"""
service_stats obj = new service_stats();
obj.set_name(name);
service_stats response = (service_stats) obj.stat_resource(service);
ret... | java | public static service_stats get(nitro_service service, String name) throws Exception{
service_stats obj = new service_stats();
obj.set_name(name);
service_stats response = (service_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"service_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"service_stats",
"obj",
"=",
"new",
"service_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"service_s... | Use this API to fetch statistics of service_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"service_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/basic/service_stats.java#L390-L395 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFiltersInner.java | RouteFiltersInner.beginDelete | public void beginDelete(String resourceGroupName, String routeFilterName) {
"""
Deletes the specified route filter.
@param resourceGroupName The name of the resource group.
@param routeFilterName The name of the route filter.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws C... | java | public void beginDelete(String resourceGroupName, String routeFilterName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, routeFilterName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"routeFilterName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"routeFilterName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
... | Deletes the specified route filter.
@param resourceGroupName The name of the resource group.
@param routeFilterName The name of the route filter.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all oth... | [
"Deletes",
"the",
"specified",
"route",
"filter",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFiltersInner.java#L190-L192 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesInner.java | ManagedInstancesInner.beginCreateOrUpdateAsync | public Observable<ManagedInstanceInner> beginCreateOrUpdateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceInner parameters) {
"""
Creates or updates a managed instance.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from ... | java | public Observable<ManagedInstanceInner> beginCreateOrUpdateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).map(new Func1<ServiceResponse<ManagedInstanceInner>, Ma... | [
"public",
"Observable",
"<",
"ManagedInstanceInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"ManagedInstanceInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"... | Creates or updates a managed instance.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param managedInstanceName The name of the managed instance.
@param parameters The requested managed instance resource ... | [
"Creates",
"or",
"updates",
"a",
"managed",
"instance",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesInner.java#L538-L545 |
taimos/dvalin | interconnect/model/src/main/java/de/taimos/dvalin/interconnect/model/service/DaemonScanner.java | DaemonScanner.isAnnotationPresent | public static boolean isAnnotationPresent(final Class<? extends Annotation> annotation, final Method method) {
"""
Checks also the inheritance hierarchy.
@param annotation Annotation
@param method Method
@return Is present?
"""
final Annotation e = DaemonScanner.getAnnotation(annotation, metho... | java | public static boolean isAnnotationPresent(final Class<? extends Annotation> annotation, final Method method) {
final Annotation e = DaemonScanner.getAnnotation(annotation, method);
return e != null;
} | [
"public",
"static",
"boolean",
"isAnnotationPresent",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
",",
"final",
"Method",
"method",
")",
"{",
"final",
"Annotation",
"e",
"=",
"DaemonScanner",
".",
"getAnnotation",
"(",
"annotatio... | Checks also the inheritance hierarchy.
@param annotation Annotation
@param method Method
@return Is present? | [
"Checks",
"also",
"the",
"inheritance",
"hierarchy",
"."
] | train | https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/interconnect/model/src/main/java/de/taimos/dvalin/interconnect/model/service/DaemonScanner.java#L134-L137 |
square/okhttp | okhttp/src/main/java/okhttp3/internal/Util.java | Util.skipAll | public static boolean skipAll(Source source, int duration, TimeUnit timeUnit) throws IOException {
"""
Reads until {@code in} is exhausted or the deadline has been reached. This is careful to not
extend the deadline if one exists already.
"""
long now = System.nanoTime();
long originalDuration = sourc... | java | public static boolean skipAll(Source source, int duration, TimeUnit timeUnit) throws IOException {
long now = System.nanoTime();
long originalDuration = source.timeout().hasDeadline()
? source.timeout().deadlineNanoTime() - now
: Long.MAX_VALUE;
source.timeout().deadlineNanoTime(now + Math.m... | [
"public",
"static",
"boolean",
"skipAll",
"(",
"Source",
"source",
",",
"int",
"duration",
",",
"TimeUnit",
"timeUnit",
")",
"throws",
"IOException",
"{",
"long",
"now",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"long",
"originalDuration",
"=",
"source"... | Reads until {@code in} is exhausted or the deadline has been reached. This is careful to not
extend the deadline if one exists already. | [
"Reads",
"until",
"{"
] | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/okhttp/src/main/java/okhttp3/internal/Util.java#L173-L194 |
palaima/DebugDrawer | debugdrawer/src/main/java/io/palaima/debugdrawer/util/UIUtils.java | UIUtils.getCompatDrawable | public static Drawable getCompatDrawable(Context c, int drawableRes) {
"""
helper method to get the drawable by its resource. specific to the correct android version
@param c
@param drawableRes
@return
"""
Drawable d = null;
try {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES... | java | public static Drawable getCompatDrawable(Context c, int drawableRes) {
Drawable d = null;
try {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
d = c.getResources().getDrawable(drawableRes);
} else {
d = c.getResources().getDrawable(dra... | [
"public",
"static",
"Drawable",
"getCompatDrawable",
"(",
"Context",
"c",
",",
"int",
"drawableRes",
")",
"{",
"Drawable",
"d",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
"<",
"Build",
".",
"VERSION_CODES",
".",
"LO... | helper method to get the drawable by its resource. specific to the correct android version
@param c
@param drawableRes
@return | [
"helper",
"method",
"to",
"get",
"the",
"drawable",
"by",
"its",
"resource",
".",
"specific",
"to",
"the",
"correct",
"android",
"version"
] | train | https://github.com/palaima/DebugDrawer/blob/49b5992a1148757bd740c4a0b7df10ef70ade6d8/debugdrawer/src/main/java/io/palaima/debugdrawer/util/UIUtils.java#L64-L75 |
voldemort/voldemort | src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java | ClientConfigUtil.compareSingleClientConfigAvro | public static Boolean compareSingleClientConfigAvro(String configAvro1, String configAvro2) {
"""
Compares two avro strings which contains single store configs
@param configAvro1
@param configAvro2
@return true if two config avro strings have same content
"""
Properties props1 = readSingleClientCo... | java | public static Boolean compareSingleClientConfigAvro(String configAvro1, String configAvro2) {
Properties props1 = readSingleClientConfigAvro(configAvro1);
Properties props2 = readSingleClientConfigAvro(configAvro2);
if(props1.equals(props2)) {
return true;
} else {
... | [
"public",
"static",
"Boolean",
"compareSingleClientConfigAvro",
"(",
"String",
"configAvro1",
",",
"String",
"configAvro2",
")",
"{",
"Properties",
"props1",
"=",
"readSingleClientConfigAvro",
"(",
"configAvro1",
")",
";",
"Properties",
"props2",
"=",
"readSingleClientC... | Compares two avro strings which contains single store configs
@param configAvro1
@param configAvro2
@return true if two config avro strings have same content | [
"Compares",
"two",
"avro",
"strings",
"which",
"contains",
"single",
"store",
"configs"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L145-L153 |
xwiki/xwiki-rendering | xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/link/AbstractXHTMLLinkTypeRenderer.java | AbstractXHTMLLinkTypeRenderer.addAttributeValue | private String addAttributeValue(String currentValue, String valueToAdd) {
"""
Add an attribute value to an existing attribute. This is useful for example for adding a value to an HTML CLASS
attribute.
@param currentValue the current value of the attribute (can be null)
@param valueToAdd the value to add
@re... | java | private String addAttributeValue(String currentValue, String valueToAdd)
{
String newValue;
if (currentValue == null || currentValue.length() == 0) {
newValue = "";
} else {
newValue = currentValue + " ";
}
return newValue + valueToAdd;
} | [
"private",
"String",
"addAttributeValue",
"(",
"String",
"currentValue",
",",
"String",
"valueToAdd",
")",
"{",
"String",
"newValue",
";",
"if",
"(",
"currentValue",
"==",
"null",
"||",
"currentValue",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"newValue"... | Add an attribute value to an existing attribute. This is useful for example for adding a value to an HTML CLASS
attribute.
@param currentValue the current value of the attribute (can be null)
@param valueToAdd the value to add
@return the current value augmented by the value to add | [
"Add",
"an",
"attribute",
"value",
"to",
"an",
"existing",
"attribute",
".",
"This",
"is",
"useful",
"for",
"example",
"for",
"adding",
"a",
"value",
"to",
"an",
"HTML",
"CLASS",
"attribute",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/link/AbstractXHTMLLinkTypeRenderer.java#L241-L250 |
adobe/htl-tck | src/main/java/io/sightly/tck/html/HTMLExtractor.java | HTMLExtractor.hasAttribute | public static boolean hasAttribute(String url, String markup, String selector, String attributeName) {
"""
Checks if any of the elements matched by the {@code selector} contain the attribute {@code attributeName}. The {@code url} is used
only for caching purposes, to avoid parsing multiple times the markup return... | java | public static boolean hasAttribute(String url, String markup, String selector, String attributeName) {
ensureMarkup(url, markup);
Document document = documents.get(url);
Elements elements = document.select(selector);
return !elements.isEmpty() && elements.hasAttr(attributeName);
} | [
"public",
"static",
"boolean",
"hasAttribute",
"(",
"String",
"url",
",",
"String",
"markup",
",",
"String",
"selector",
",",
"String",
"attributeName",
")",
"{",
"ensureMarkup",
"(",
"url",
",",
"markup",
")",
";",
"Document",
"document",
"=",
"documents",
... | Checks if any of the elements matched by the {@code selector} contain the attribute {@code attributeName}. The {@code url} is used
only for caching purposes, to avoid parsing multiple times the markup returned for the same resource.
@param url the url that identifies the markup
@param markup the mar... | [
"Checks",
"if",
"any",
"of",
"the",
"elements",
"matched",
"by",
"the",
"{",
"@code",
"selector",
"}",
"contain",
"the",
"attribute",
"{",
"@code",
"attributeName",
"}",
".",
"The",
"{",
"@code",
"url",
"}",
"is",
"used",
"only",
"for",
"caching",
"purpo... | train | https://github.com/adobe/htl-tck/blob/2043a9616083c06cefbd685798c9a2b2ac2ea98e/src/main/java/io/sightly/tck/html/HTMLExtractor.java#L90-L95 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java | ClusterManagerMetrics.createTypeToCountMap | private Map<ResourceType, MetricsIntValue> createTypeToCountMap(
Collection<ResourceType> resourceTypes, String actionType) {
"""
Create a map of resource type -> current count.
@param resourceTypes The resource types.
@param actionType A string indicating pending, running etc.
@return The map.
"""
... | java | private Map<ResourceType, MetricsIntValue> createTypeToCountMap(
Collection<ResourceType> resourceTypes, String actionType) {
Map<ResourceType, MetricsIntValue> m =
new HashMap<ResourceType, MetricsIntValue>();
for (ResourceType t : resourceTypes) {
String name = (actionType + "_" + t).toLow... | [
"private",
"Map",
"<",
"ResourceType",
",",
"MetricsIntValue",
">",
"createTypeToCountMap",
"(",
"Collection",
"<",
"ResourceType",
">",
"resourceTypes",
",",
"String",
"actionType",
")",
"{",
"Map",
"<",
"ResourceType",
",",
"MetricsIntValue",
">",
"m",
"=",
"n... | Create a map of resource type -> current count.
@param resourceTypes The resource types.
@param actionType A string indicating pending, running etc.
@return The map. | [
"Create",
"a",
"map",
"of",
"resource",
"type",
"-",
">",
"current",
"count",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java#L345-L355 |
livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/spi/ServiceInfoCache.java | ServiceInfoCache.addAttributes | public Result<T> addAttributes(ServiceInfo.Key key, Attributes attributes) {
"""
Updates an existing ServiceInfo identified by the given Key, adding the given attributes.
@param key the service's key
@param attributes the attributes to add
@return a result whose previous is the service prior the update... | java | public Result<T> addAttributes(ServiceInfo.Key key, Attributes attributes)
{
T previous = null;
T current = null;
lock();
try
{
previous = get(key);
// Updating a service that does not exist must fail (RFC 2608, 9.3)
if (previous == null)
... | [
"public",
"Result",
"<",
"T",
">",
"addAttributes",
"(",
"ServiceInfo",
".",
"Key",
"key",
",",
"Attributes",
"attributes",
")",
"{",
"T",
"previous",
"=",
"null",
";",
"T",
"current",
"=",
"null",
";",
"lock",
"(",
")",
";",
"try",
"{",
"previous",
... | Updates an existing ServiceInfo identified by the given Key, adding the given attributes.
@param key the service's key
@param attributes the attributes to add
@return a result whose previous is the service prior the update and where current is the current service | [
"Updates",
"an",
"existing",
"ServiceInfo",
"identified",
"by",
"the",
"given",
"Key",
"adding",
"the",
"given",
"attributes",
"."
] | train | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/spi/ServiceInfoCache.java#L185-L210 |
hawkular/hawkular-commons | hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java | WebSocketHelper.sendBinaryAsync | public void sendBinaryAsync(Session session, InputStream inputStream, ExecutorService threadPool) {
"""
Sends binary data to a client asynchronously.
@param session the client session where the message will be sent
@param inputStream the binary data to send
@param threadPool where the job will be submitted so... | java | public void sendBinaryAsync(Session session, InputStream inputStream, ExecutorService threadPool) {
if (session == null) {
return;
}
if (inputStream == null) {
throw new IllegalArgumentException("inputStream must not be null");
}
log.debugf("Attempting t... | [
"public",
"void",
"sendBinaryAsync",
"(",
"Session",
"session",
",",
"InputStream",
"inputStream",
",",
"ExecutorService",
"threadPool",
")",
"{",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"inputStream",
"==",
"null",
")",
... | Sends binary data to a client asynchronously.
@param session the client session where the message will be sent
@param inputStream the binary data to send
@param threadPool where the job will be submitted so it can execute asynchronously | [
"Sends",
"binary",
"data",
"to",
"a",
"client",
"asynchronously",
"."
] | train | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java#L113-L134 |
maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/domain/GeoLocation.java | GeoLocation.calculateDistance | public double calculateDistance(double srcLat, double srcLong, double destLat, double destLong) {
"""
/*
@return: Distance in kilometers between this src location and the specified destination
"""
float[] results = new float[1];
Location.distanceBetween(srcLat, srcLong, destLat, destLong, results);
r... | java | public double calculateDistance(double srcLat, double srcLong, double destLat, double destLong) {
float[] results = new float[1];
Location.distanceBetween(srcLat, srcLong, destLat, destLong, results);
return results[0] / 1000;
} | [
"public",
"double",
"calculateDistance",
"(",
"double",
"srcLat",
",",
"double",
"srcLong",
",",
"double",
"destLat",
",",
"double",
"destLong",
")",
"{",
"float",
"[",
"]",
"results",
"=",
"new",
"float",
"[",
"1",
"]",
";",
"Location",
".",
"distanceBetw... | /*
@return: Distance in kilometers between this src location and the specified destination | [
"/",
"*"
] | train | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/domain/GeoLocation.java#L64-L68 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java | FileOperations.listFilesFromTask | public PagedList<NodeFile> listFilesFromTask(String jobId, String taskId) throws BatchErrorException, IOException {
"""
Lists the files in the specified task's directory on its compute node.
@param jobId The ID of the job.
@param taskId The ID of the task.
@return A list of {@link NodeFile} objects.
@throws ... | java | public PagedList<NodeFile> listFilesFromTask(String jobId, String taskId) throws BatchErrorException, IOException {
return listFilesFromTask(jobId, taskId, null, null, null);
} | [
"public",
"PagedList",
"<",
"NodeFile",
">",
"listFilesFromTask",
"(",
"String",
"jobId",
",",
"String",
"taskId",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"return",
"listFilesFromTask",
"(",
"jobId",
",",
"taskId",
",",
"null",
",",
"null"... | Lists the files in the specified task's directory on its compute node.
@param jobId The ID of the job.
@param taskId The ID of the task.
@return A list of {@link NodeFile} objects.
@throws BatchErrorException Exception thrown when an error response is received from the Batch service.
@throws IOException Exception thro... | [
"Lists",
"the",
"files",
"in",
"the",
"specified",
"task",
"s",
"directory",
"on",
"its",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java#L73-L75 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java | BuildTasksInner.beginCreateAsync | public Observable<BuildTaskInner> beginCreateAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskInner buildTaskCreateParameters) {
"""
Creates a build task for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which th... | java | public Observable<BuildTaskInner> beginCreateAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskInner buildTaskCreateParameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskCreateParameters).map(new Func1<ServiceResponse<... | [
"public",
"Observable",
"<",
"BuildTaskInner",
">",
"beginCreateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"buildTaskName",
",",
"BuildTaskInner",
"buildTaskCreateParameters",
")",
"{",
"return",
"beginCreateWithServiceResponse... | Creates a build task for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildTaskName The name of the container registry build task.
@param buildTaskCreat... | [
"Creates",
"a",
"build",
"task",
"for",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java#L570-L577 |
apache/incubator-zipkin | zipkin/src/main/java/zipkin2/internal/Trace.java | Trace.compareEndpoint | static int compareEndpoint(Endpoint left, Endpoint right) {
"""
Put spans with null endpoints first, so that their data can be attached to the first span with
the same ID and endpoint. It is possible that a server can get the same request on a different
port. Not addressing this.
"""
if (left == null) { ... | java | static int compareEndpoint(Endpoint left, Endpoint right) {
if (left == null) { // nulls first
return (right == null) ? 0 : -1;
} else if (right == null) {
return 1;
}
int byService = nullSafeCompareTo(left.serviceName(), right.serviceName(), false);
if (byService != 0) return byService;... | [
"static",
"int",
"compareEndpoint",
"(",
"Endpoint",
"left",
",",
"Endpoint",
"right",
")",
"{",
"if",
"(",
"left",
"==",
"null",
")",
"{",
"// nulls first",
"return",
"(",
"right",
"==",
"null",
")",
"?",
"0",
":",
"-",
"1",
";",
"}",
"else",
"if",
... | Put spans with null endpoints first, so that their data can be attached to the first span with
the same ID and endpoint. It is possible that a server can get the same request on a different
port. Not addressing this. | [
"Put",
"spans",
"with",
"null",
"endpoints",
"first",
"so",
"that",
"their",
"data",
"can",
"be",
"attached",
"to",
"the",
"first",
"span",
"with",
"the",
"same",
"ID",
"and",
"endpoint",
".",
"It",
"is",
"possible",
"that",
"a",
"server",
"can",
"get",
... | train | https://github.com/apache/incubator-zipkin/blob/89b2fab983fc626b3be32ce9d7cf64b3f01f1a87/zipkin/src/main/java/zipkin2/internal/Trace.java#L144-L155 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/RemoveSarlNatureHandler.java | RemoveSarlNatureHandler.doConvert | protected void doConvert(IProject project, IProgressMonitor monitor) throws ExecutionException {
"""
Convert the given project.
@param project the project to convert..
@param monitor the progress monitor.
@throws ExecutionException if something going wrong.
"""
monitor.setTaskName(MessageFormat.format(M... | java | protected void doConvert(IProject project, IProgressMonitor monitor) throws ExecutionException {
monitor.setTaskName(MessageFormat.format(Messages.RemoveSarlNatureHandler_2, project.getName()));
final SubMonitor mon = SubMonitor.convert(monitor, 2);
if (this.configurator.canUnconfigure(project, mon.newChild(1))) ... | [
"protected",
"void",
"doConvert",
"(",
"IProject",
"project",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"ExecutionException",
"{",
"monitor",
".",
"setTaskName",
"(",
"MessageFormat",
".",
"format",
"(",
"Messages",
".",
"RemoveSarlNatureHandler_2",
",",
"p... | Convert the given project.
@param project the project to convert..
@param monitor the progress monitor.
@throws ExecutionException if something going wrong. | [
"Convert",
"the",
"given",
"project",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/RemoveSarlNatureHandler.java#L116-L127 |
wildfly/wildfly-core | jmx/src/main/java/org/jboss/as/jmx/model/ObjectNameAddressUtil.java | ObjectNameAddressUtil.createObjectName | static ObjectName createObjectName(final String domain, final PathAddress pathAddress, ObjectNameCreationContext context) {
"""
Creates an ObjectName representation of a {@link PathAddress}.
@param domain the JMX domain to use for the ObjectName. Cannot be {@code null}
@param pathAddress the address. Cannot be {... | java | static ObjectName createObjectName(final String domain, final PathAddress pathAddress, ObjectNameCreationContext context) {
if (pathAddress.size() == 0) {
return ModelControllerMBeanHelper.createRootObjectName(domain);
}
final StringBuilder sb = new StringBuilder(domain);
sb... | [
"static",
"ObjectName",
"createObjectName",
"(",
"final",
"String",
"domain",
",",
"final",
"PathAddress",
"pathAddress",
",",
"ObjectNameCreationContext",
"context",
")",
"{",
"if",
"(",
"pathAddress",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"Mo... | Creates an ObjectName representation of a {@link PathAddress}.
@param domain the JMX domain to use for the ObjectName. Cannot be {@code null}
@param pathAddress the address. Cannot be {@code null}
@param context contextual objection that allows this method to cache state across invocations. May be {@code null}
@return ... | [
"Creates",
"an",
"ObjectName",
"representation",
"of",
"a",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/jmx/src/main/java/org/jboss/as/jmx/model/ObjectNameAddressUtil.java#L146-L169 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.getAt | public static String getAt(String text, Range range) {
"""
Support the range subscript operator for String
@param text a String
@param range a Range
@return a substring corresponding to the Range
@since 1.0
"""
RangeInfo info = subListBorders(text.length(), range);
String answer = text.s... | java | public static String getAt(String text, Range range) {
RangeInfo info = subListBorders(text.length(), range);
String answer = text.substring(info.from, info.to);
if (info.reverse) {
answer = reverse(answer);
}
return answer;
} | [
"public",
"static",
"String",
"getAt",
"(",
"String",
"text",
",",
"Range",
"range",
")",
"{",
"RangeInfo",
"info",
"=",
"subListBorders",
"(",
"text",
".",
"length",
"(",
")",
",",
"range",
")",
";",
"String",
"answer",
"=",
"text",
".",
"substring",
... | Support the range subscript operator for String
@param text a String
@param range a Range
@return a substring corresponding to the Range
@since 1.0 | [
"Support",
"the",
"range",
"subscript",
"operator",
"for",
"String"
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L1474-L1481 |
cerner/beadledom | pagination/src/main/java/com/cerner/beadledom/pagination/OffsetPaginationLinks.java | OffsetPaginationLinks.prevLink | String prevLink() {
"""
Returns the next prev link; null if no prev page link is available.
"""
if (currentOffset == 0 || currentLimit == 0) {
return null;
}
return urlWithUpdatedPagination(Math.max(0, currentOffset - currentLimit), currentLimit);
} | java | String prevLink() {
if (currentOffset == 0 || currentLimit == 0) {
return null;
}
return urlWithUpdatedPagination(Math.max(0, currentOffset - currentLimit), currentLimit);
} | [
"String",
"prevLink",
"(",
")",
"{",
"if",
"(",
"currentOffset",
"==",
"0",
"||",
"currentLimit",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"return",
"urlWithUpdatedPagination",
"(",
"Math",
".",
"max",
"(",
"0",
",",
"currentOffset",
"-",
"curren... | Returns the next prev link; null if no prev page link is available. | [
"Returns",
"the",
"next",
"prev",
"link",
";",
"null",
"if",
"no",
"prev",
"page",
"link",
"is",
"available",
"."
] | train | https://github.com/cerner/beadledom/blob/75435bced5187d5455b46518fadf85c93cf32014/pagination/src/main/java/com/cerner/beadledom/pagination/OffsetPaginationLinks.java#L110-L116 |
lshift/jamume | src/main/java/net/lshift/java/dispatch/JavaC3.java | JavaC3.isCandidate | private static <X> Predicate<X> isCandidate(final Iterable<List<X>> remainingInputs) {
"""
To be a candidate for the next place in the linearization, you must
be the head of at least one list, and in the tail of none of the lists.
@param remainingInputs the lists we are looking for position in.
@return true if ... | java | private static <X> Predicate<X> isCandidate(final Iterable<List<X>> remainingInputs) {
return new Predicate<X>() {
Predicate<List<X>> headIs(final X c) {
return new Predicate<List<X>>() {
public boolean apply(List<X> input) {
return !input... | [
"private",
"static",
"<",
"X",
">",
"Predicate",
"<",
"X",
">",
"isCandidate",
"(",
"final",
"Iterable",
"<",
"List",
"<",
"X",
">",
">",
"remainingInputs",
")",
"{",
"return",
"new",
"Predicate",
"<",
"X",
">",
"(",
")",
"{",
"Predicate",
"<",
"List... | To be a candidate for the next place in the linearization, you must
be the head of at least one list, and in the tail of none of the lists.
@param remainingInputs the lists we are looking for position in.
@return true if the class is a candidate for next. | [
"To",
"be",
"a",
"candidate",
"for",
"the",
"next",
"place",
"in",
"the",
"linearization",
"you",
"must",
"be",
"the",
"head",
"of",
"at",
"least",
"one",
"list",
"and",
"in",
"the",
"tail",
"of",
"none",
"of",
"the",
"lists",
"."
] | train | https://github.com/lshift/jamume/blob/754d9ab29311601328a2f39928775e4e010305b7/src/main/java/net/lshift/java/dispatch/JavaC3.java#L186-L210 |
graphql-java/java-dataloader | src/main/java/org/dataloader/DataLoader.java | DataLoader.newMappedDataLoaderWithTry | public static <K, V> DataLoader<K, V> newMappedDataLoaderWithTry(MappedBatchLoader<K, Try<V>> batchLoadFunction) {
"""
Creates new DataLoader with the specified batch loader function and default options
(batching, caching and unlimited batch size) where the batch loader function returns a list of
{@link org.data... | java | public static <K, V> DataLoader<K, V> newMappedDataLoaderWithTry(MappedBatchLoader<K, Try<V>> batchLoadFunction) {
return newMappedDataLoaderWithTry(batchLoadFunction, null);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"DataLoader",
"<",
"K",
",",
"V",
">",
"newMappedDataLoaderWithTry",
"(",
"MappedBatchLoader",
"<",
"K",
",",
"Try",
"<",
"V",
">",
">",
"batchLoadFunction",
")",
"{",
"return",
"newMappedDataLoaderWithTry",
"(",
... | Creates new DataLoader with the specified batch loader function and default options
(batching, caching and unlimited batch size) where the batch loader function returns a list of
{@link org.dataloader.Try} objects.
<p>
If its important you to know the exact status of each item in a batch call and whether it threw excep... | [
"Creates",
"new",
"DataLoader",
"with",
"the",
"specified",
"batch",
"loader",
"function",
"and",
"default",
"options",
"(",
"batching",
"caching",
"and",
"unlimited",
"batch",
"size",
")",
"where",
"the",
"batch",
"loader",
"function",
"returns",
"a",
"list",
... | train | https://github.com/graphql-java/java-dataloader/blob/dfdc8133ead10aa723f896b4a1fa4a1cec9a6fbc/src/main/java/org/dataloader/DataLoader.java#L245-L247 |
beihaifeiwu/dolphin | dolphin-common/src/main/java/com/freetmp/common/util/BridgeMethodResolver.java | BridgeMethodResolver.isVisibilityBridgeMethodPair | public static boolean isVisibilityBridgeMethodPair(Method bridgeMethod, Method bridgedMethod) {
"""
Compare the signatures of the bridge method and the method which it bridges. If
the parameter and return types are the same, it is a 'visibility' bridge method
introduced in Java 6 to fix http://bugs.sun.com/view_... | java | public static boolean isVisibilityBridgeMethodPair(Method bridgeMethod, Method bridgedMethod) {
if (bridgeMethod == bridgedMethod) {
return true;
}
return (Arrays.equals(bridgeMethod.getParameterTypes(), bridgedMethod.getParameterTypes()) &&
bridgeMethod.getReturnType().equals(bridgedMethod.getReturnType()... | [
"public",
"static",
"boolean",
"isVisibilityBridgeMethodPair",
"(",
"Method",
"bridgeMethod",
",",
"Method",
"bridgedMethod",
")",
"{",
"if",
"(",
"bridgeMethod",
"==",
"bridgedMethod",
")",
"{",
"return",
"true",
";",
"}",
"return",
"(",
"Arrays",
".",
"equals"... | Compare the signatures of the bridge method and the method which it bridges. If
the parameter and return types are the same, it is a 'visibility' bridge method
introduced in Java 6 to fix http://bugs.sun.com/view_bug.do?bug_id=6342411.
See also http://stas-blogspot.blogspot.com/2010/03/java-bridge-methods-explained.htm... | [
"Compare",
"the",
"signatures",
"of",
"the",
"bridge",
"method",
"and",
"the",
"method",
"which",
"it",
"bridges",
".",
"If",
"the",
"parameter",
"and",
"return",
"types",
"are",
"the",
"same",
"it",
"is",
"a",
"visibility",
"bridge",
"method",
"introduced",... | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/util/BridgeMethodResolver.java#L209-L215 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java | RegionMap.snapToNextHigherInRegionResolution | public Coordinate snapToNextHigherInRegionResolution( double x, double y ) {
"""
Snaps a geographic point to be on the region grid.
<p>
Moves the point given by X and Y to be on the grid of the supplied
region.
</p>
@param x the easting of the arbitrary point.
@param y the northing of the arbitrary point... | java | public Coordinate snapToNextHigherInRegionResolution( double x, double y ) {
double minx = getWest();
double ewres = getXres();
double xsnap = minx + (Math.ceil((x - minx) / ewres) * ewres);
double miny = getSouth();
double nsres = getYres();
double ysnap = miny + (Math... | [
"public",
"Coordinate",
"snapToNextHigherInRegionResolution",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"double",
"minx",
"=",
"getWest",
"(",
")",
";",
"double",
"ewres",
"=",
"getXres",
"(",
")",
";",
"double",
"xsnap",
"=",
"minx",
"+",
"(",
"... | Snaps a geographic point to be on the region grid.
<p>
Moves the point given by X and Y to be on the grid of the supplied
region.
</p>
@param x the easting of the arbitrary point.
@param y the northing of the arbitrary point.
@return the snapped coordinate. | [
"Snaps",
"a",
"geographic",
"point",
"to",
"be",
"on",
"the",
"region",
"grid",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java#L180-L191 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/utils/DiskCacheUtils.java | DiskCacheUtils.findInCache | public static File findInCache(String imageUri, DiskCache diskCache) {
"""
Returns {@link File} of cached image or <b>null</b> if image was not cached in disk cache
"""
File image = diskCache.get(imageUri);
return image != null && image.exists() ? image : null;
} | java | public static File findInCache(String imageUri, DiskCache diskCache) {
File image = diskCache.get(imageUri);
return image != null && image.exists() ? image : null;
} | [
"public",
"static",
"File",
"findInCache",
"(",
"String",
"imageUri",
",",
"DiskCache",
"diskCache",
")",
"{",
"File",
"image",
"=",
"diskCache",
".",
"get",
"(",
"imageUri",
")",
";",
"return",
"image",
"!=",
"null",
"&&",
"image",
".",
"exists",
"(",
"... | Returns {@link File} of cached image or <b>null</b> if image was not cached in disk cache | [
"Returns",
"{"
] | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/utils/DiskCacheUtils.java#L35-L38 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/PeriodFormatterBuilder.java | PeriodFormatterBuilder.appendSeparator | public PeriodFormatterBuilder appendSeparator(String text, String finalText,
String[] variants) {
"""
Append a separator, which is output if fields are printed both before
and after the separator.
<p>
This method changes the separator depending on whether it is ... | java | public PeriodFormatterBuilder appendSeparator(String text, String finalText,
String[] variants) {
return appendSeparator(text, finalText, variants, true, true);
} | [
"public",
"PeriodFormatterBuilder",
"appendSeparator",
"(",
"String",
"text",
",",
"String",
"finalText",
",",
"String",
"[",
"]",
"variants",
")",
"{",
"return",
"appendSeparator",
"(",
"text",
",",
"finalText",
",",
"variants",
",",
"true",
",",
"true",
")",... | Append a separator, which is output if fields are printed both before
and after the separator.
<p>
This method changes the separator depending on whether it is the last separator
to be output.
<p>
For example, <code>builder.appendDays().appendSeparator(",", "&").appendHours().appendSeparator(",", "&").appendMinutes()</... | [
"Append",
"a",
"separator",
"which",
"is",
"output",
"if",
"fields",
"are",
"printed",
"both",
"before",
"and",
"after",
"the",
"separator",
".",
"<p",
">",
"This",
"method",
"changes",
"the",
"separator",
"depending",
"on",
"whether",
"it",
"is",
"the",
"... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/PeriodFormatterBuilder.java#L818-L821 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java | FeatureOverlayQuery.buildMapClickTableData | private FeatureTableData buildMapClickTableData(LatLng latLng, double zoom, BoundingBox boundingBox, double tolerance, Projection projection) {
"""
Perform a query based upon the map click location and build feature table data
@param latLng location
@param zoom current zoom level
@param boundingBo... | java | private FeatureTableData buildMapClickTableData(LatLng latLng, double zoom, BoundingBox boundingBox, double tolerance, Projection projection) {
FeatureTableData tableData = null;
// Verify the features are indexed and we are getting information
if (isIndexed() && (maxFeaturesInfo || featuresInf... | [
"private",
"FeatureTableData",
"buildMapClickTableData",
"(",
"LatLng",
"latLng",
",",
"double",
"zoom",
",",
"BoundingBox",
"boundingBox",
",",
"double",
"tolerance",
",",
"Projection",
"projection",
")",
"{",
"FeatureTableData",
"tableData",
"=",
"null",
";",
"// ... | Perform a query based upon the map click location and build feature table data
@param latLng location
@param zoom current zoom level
@param boundingBox click bounding box
@param tolerance distance tolerance
@param projection desired geometry projection
@return table data on what was clicked, or null | [
"Perform",
"a",
"query",
"based",
"upon",
"the",
"map",
"click",
"location",
"and",
"build",
"feature",
"table",
"data"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java#L536-L568 |
CodeNarc/CodeNarc | src/main/java/org/codenarc/util/AstUtil.java | AstUtil.isConstructorCall | public static boolean isConstructorCall(Expression expression, List<String> classNames) {
"""
Return true if the expression is a constructor call on any of the named classes, with any number of parameters.
@param expression - the expression
@param classNames - the possible List of class names
@return as describ... | java | public static boolean isConstructorCall(Expression expression, List<String> classNames) {
return expression instanceof ConstructorCallExpression && classNames.contains(expression.getType().getName());
} | [
"public",
"static",
"boolean",
"isConstructorCall",
"(",
"Expression",
"expression",
",",
"List",
"<",
"String",
">",
"classNames",
")",
"{",
"return",
"expression",
"instanceof",
"ConstructorCallExpression",
"&&",
"classNames",
".",
"contains",
"(",
"expression",
"... | Return true if the expression is a constructor call on any of the named classes, with any number of parameters.
@param expression - the expression
@param classNames - the possible List of class names
@return as described | [
"Return",
"true",
"if",
"the",
"expression",
"is",
"a",
"constructor",
"call",
"on",
"any",
"of",
"the",
"named",
"classes",
"with",
"any",
"number",
"of",
"parameters",
"."
] | train | https://github.com/CodeNarc/CodeNarc/blob/9a7cec02cb8cbaf845030f2434309e8968f5d7a7/src/main/java/org/codenarc/util/AstUtil.java#L452-L454 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/ScanRequest.java | ScanRequest.withScanFilter | public ScanRequest withScanFilter(java.util.Map<String, Condition> scanFilter) {
"""
<p>
This is a legacy parameter. Use <code>FilterExpression</code> instead. For more information, see <a href=
"https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ScanFilter.html"
>ScanF... | java | public ScanRequest withScanFilter(java.util.Map<String, Condition> scanFilter) {
setScanFilter(scanFilter);
return this;
} | [
"public",
"ScanRequest",
"withScanFilter",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"Condition",
">",
"scanFilter",
")",
"{",
"setScanFilter",
"(",
"scanFilter",
")",
";",
"return",
"this",
";",
"}"
] | <p>
This is a legacy parameter. Use <code>FilterExpression</code> instead. For more information, see <a href=
"https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ScanFilter.html"
>ScanFilter</a> in the <i>Amazon DynamoDB Developer Guide</i>.
</p>
@param scanFilter
This is a le... | [
"<p",
">",
"This",
"is",
"a",
"legacy",
"parameter",
".",
"Use",
"<code",
">",
"FilterExpression<",
"/",
"code",
">",
"instead",
".",
"For",
"more",
"information",
"see",
"<a",
"href",
"=",
"https",
":",
"//",
"docs",
".",
"aws",
".",
"amazon",
".",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/ScanRequest.java#L1301-L1304 |
GCRC/nunaliit | nunaliit2-dbSec/src/main/java/ca/carleton/gcrc/dbSec/FieldSelectorCentroid.java | FieldSelectorCentroid.getQueryString | public String getQueryString(TableSchema tableSchema, Phase phase) throws Exception {
"""
/*
ST_X(ST_Centroid(coalesce(ST_GeometryN(the_geom,1),the_geom)))
ST_Y(ST_Centroid(coalesce(ST_GeometryN(the_geom,1),the_geom)))
ST_GeometryN - Return the 1-based Nth geometry if the geometry is a
GEOMETRYCOLLECTION, MU... | java | public String getQueryString(TableSchema tableSchema, Phase phase) throws Exception {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
if( Type.X == type ) {
pw.print("ST_X");
} else if( Type.Y == type ) {
pw.print("ST_Y");
} else {
throw new Exception("Can not handle ty... | [
"public",
"String",
"getQueryString",
"(",
"TableSchema",
"tableSchema",
",",
"Phase",
"phase",
")",
"throws",
"Exception",
"{",
"StringWriter",
"sw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"PrintWriter",
"pw",
"=",
"new",
"PrintWriter",
"(",
"sw",
")",
... | /*
ST_X(ST_Centroid(coalesce(ST_GeometryN(the_geom,1),the_geom)))
ST_Y(ST_Centroid(coalesce(ST_GeometryN(the_geom,1),the_geom)))
ST_GeometryN - Return the 1-based Nth geometry if the geometry is a
GEOMETRYCOLLECTION, MULTIPOINT, MULTILINESTRING, MULTICURVE or
MULTIPOLYGON. Otherwise, return NULL.
ST_Centroid - Return... | [
"/",
"*",
"ST_X",
"(",
"ST_Centroid",
"(",
"coalesce",
"(",
"ST_GeometryN",
"(",
"the_geom",
"1",
")",
"the_geom",
")))",
"ST_Y",
"(",
"ST_Centroid",
"(",
"coalesce",
"(",
"ST_GeometryN",
"(",
"the_geom",
"1",
")",
"the_geom",
")))"
] | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-dbSec/src/main/java/ca/carleton/gcrc/dbSec/FieldSelectorCentroid.java#L99-L129 |
aws/aws-sdk-java | aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/JobDetail.java | JobDetail.withParameters | public JobDetail withParameters(java.util.Map<String, String> parameters) {
"""
<p>
Additional parameters passed to the job that replace parameter substitution placeholders or override any
corresponding parameter defaults from the job definition.
</p>
@param parameters
Additional parameters passed to the jo... | java | public JobDetail withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
} | [
"public",
"JobDetail",
"withParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"setParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Additional parameters passed to the job that replace parameter substitution placeholders or override any
corresponding parameter defaults from the job definition.
</p>
@param parameters
Additional parameters passed to the job that replace parameter substitution placeholders or override any
corresponding parameter ... | [
"<p",
">",
"Additional",
"parameters",
"passed",
"to",
"the",
"job",
"that",
"replace",
"parameter",
"substitution",
"placeholders",
"or",
"override",
"any",
"corresponding",
"parameter",
"defaults",
"from",
"the",
"job",
"definition",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/JobDetail.java#L865-L868 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/AbstractToString.java | AbstractToString.isToString | ToStringKind isToString(Tree parent, ExpressionTree tree, VisitorState state) {
"""
Classifies expressions that are converted to strings by their enclosing expression.
"""
// is the enclosing expression string concat?
if (isStringConcat(parent, state)) {
return ToStringKind.IMPLICIT;
}
if... | java | ToStringKind isToString(Tree parent, ExpressionTree tree, VisitorState state) {
// is the enclosing expression string concat?
if (isStringConcat(parent, state)) {
return ToStringKind.IMPLICIT;
}
if (parent instanceof ExpressionTree) {
ExpressionTree parentExpression = (ExpressionTree) parent... | [
"ToStringKind",
"isToString",
"(",
"Tree",
"parent",
",",
"ExpressionTree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"// is the enclosing expression string concat?",
"if",
"(",
"isStringConcat",
"(",
"parent",
",",
"state",
")",
")",
"{",
"return",
"ToStringK... | Classifies expressions that are converted to strings by their enclosing expression. | [
"Classifies",
"expressions",
"that",
"are",
"converted",
"to",
"strings",
"by",
"their",
"enclosing",
"expression",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/AbstractToString.java#L162-L179 |
banq/jdonframework | JdonAccessory/jdon-remote/src/main/java/com/jdon/bussinessproxy/remote/hessian/HessianToJdonRequestProcessor.java | HessianToJdonRequestProcessor.writeException | protected void writeException(final AbstractHessianOutput out, Exception ex)
throws IOException {
"""
Writes Exception information to Hessian Output.
@param out
Hessian Output
@param ex
Exception
@throws java.io.IOException
If i/o error occur
"""
OutputStream os = new ByteArrayOutputStream();
... | java | protected void writeException(final AbstractHessianOutput out, Exception ex)
throws IOException {
OutputStream os = new ByteArrayOutputStream();
ex.printStackTrace(new PrintStream(os));
out.writeFault(ex.getClass().toString(), os.toString(), null);
} | [
"protected",
"void",
"writeException",
"(",
"final",
"AbstractHessianOutput",
"out",
",",
"Exception",
"ex",
")",
"throws",
"IOException",
"{",
"OutputStream",
"os",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"ex",
".",
"printStackTrace",
"(",
"new",
"P... | Writes Exception information to Hessian Output.
@param out
Hessian Output
@param ex
Exception
@throws java.io.IOException
If i/o error occur | [
"Writes",
"Exception",
"information",
"to",
"Hessian",
"Output",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-remote/src/main/java/com/jdon/bussinessproxy/remote/hessian/HessianToJdonRequestProcessor.java#L205-L210 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/cpnl/CpnlElFunctions.java | CpnlElFunctions.mappedExternalUrl | public static String mappedExternalUrl(SlingHttpServletRequest request, String path) {
"""
Builds an external (full qualified) URL for a repository path using the LinkUtil.getMappedURL() method.
@param request the current request (domain host hint)
@param path the repository path
@return the URL built in t... | java | public static String mappedExternalUrl(SlingHttpServletRequest request, String path) {
return LinkUtil.getAbsoluteUrl(request, LinkUtil.getMappedUrl(request, path));
} | [
"public",
"static",
"String",
"mappedExternalUrl",
"(",
"SlingHttpServletRequest",
"request",
",",
"String",
"path",
")",
"{",
"return",
"LinkUtil",
".",
"getAbsoluteUrl",
"(",
"request",
",",
"LinkUtil",
".",
"getMappedUrl",
"(",
"request",
",",
"path",
")",
")... | Builds an external (full qualified) URL for a repository path using the LinkUtil.getMappedURL() method.
@param request the current request (domain host hint)
@param path the repository path
@return the URL built in the context of the requested domain host | [
"Builds",
"an",
"external",
"(",
"full",
"qualified",
")",
"URL",
"for",
"a",
"repository",
"path",
"using",
"the",
"LinkUtil",
".",
"getMappedURL",
"()",
"method",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/cpnl/CpnlElFunctions.java#L220-L222 |
VerbalExpressions/JavaVerbalExpressions | src/main/java/ru/lanwen/verbalregex/VerbalExpression.java | VerbalExpression.getText | public String getText(final String toTest, final int group) {
"""
Extract exact group from string
@param toTest - string to extract from
@param group - group to extract
@return extracted group
@since 1.1
"""
Matcher m = pattern.matcher(toTest);
StringBuilder result = new StringBuilder();... | java | public String getText(final String toTest, final int group) {
Matcher m = pattern.matcher(toTest);
StringBuilder result = new StringBuilder();
while (m.find()) {
result.append(m.group(group));
}
return result.toString();
} | [
"public",
"String",
"getText",
"(",
"final",
"String",
"toTest",
",",
"final",
"int",
"group",
")",
"{",
"Matcher",
"m",
"=",
"pattern",
".",
"matcher",
"(",
"toTest",
")",
";",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"whil... | Extract exact group from string
@param toTest - string to extract from
@param group - group to extract
@return extracted group
@since 1.1 | [
"Extract",
"exact",
"group",
"from",
"string"
] | train | https://github.com/VerbalExpressions/JavaVerbalExpressions/blob/4ee34e6c96ea2cf8335e3b425afa44c535229347/src/main/java/ru/lanwen/verbalregex/VerbalExpression.java#L742-L749 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/UtilReflection.java | UtilReflection.getMethod | public static <T> T getMethod(Object object, String name, Object... params) {
"""
Get method and call its return value with parameters.
@param <T> The object type.
@param object The object caller (must not be <code>null</code>).
@param name The method name (must not be <code>null</code>).
@param params The m... | java | public static <T> T getMethod(Object object, String name, Object... params)
{
Check.notNull(object);
Check.notNull(name);
Check.notNull(params);
try
{
final Class<?> clazz = getClass(object);
final Method method = clazz.getDeclaredMethod(name... | [
"public",
"static",
"<",
"T",
">",
"T",
"getMethod",
"(",
"Object",
"object",
",",
"String",
"name",
",",
"Object",
"...",
"params",
")",
"{",
"Check",
".",
"notNull",
"(",
"object",
")",
";",
"Check",
".",
"notNull",
"(",
"name",
")",
";",
"Check",
... | Get method and call its return value with parameters.
@param <T> The object type.
@param object The object caller (must not be <code>null</code>).
@param name The method name (must not be <code>null</code>).
@param params The method parameters (must not be <code>null</code>).
@return The value returned.
@throws LionEn... | [
"Get",
"method",
"and",
"call",
"its",
"return",
"value",
"with",
"parameters",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/UtilReflection.java#L220-L243 |
anotheria/moskito | moskito-extensions/moskito-notification-providers/src/main/java/net/anotheria/moskito/extensions/notificationtemplate/MailTemplateProcessor.java | MailTemplateProcessor.processingAllowed | private boolean processingAllowed(final String prefix, final String variable, final TemplateReplacementContext context) {
"""
Checks whether processing is allowed.
@param prefix variable prefix
@param context {@link TemplateReplacementContext}
@return {@code boolean} flag
"""
return (PREFIX.equals(pref... | java | private boolean processingAllowed(final String prefix, final String variable, final TemplateReplacementContext context) {
return (PREFIX.equals(prefix) && !StringUtils.isEmpty(variable) && context instanceof MailTemplateReplacementContext);
} | [
"private",
"boolean",
"processingAllowed",
"(",
"final",
"String",
"prefix",
",",
"final",
"String",
"variable",
",",
"final",
"TemplateReplacementContext",
"context",
")",
"{",
"return",
"(",
"PREFIX",
".",
"equals",
"(",
"prefix",
")",
"&&",
"!",
"StringUtils"... | Checks whether processing is allowed.
@param prefix variable prefix
@param context {@link TemplateReplacementContext}
@return {@code boolean} flag | [
"Checks",
"whether",
"processing",
"is",
"allowed",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-notification-providers/src/main/java/net/anotheria/moskito/extensions/notificationtemplate/MailTemplateProcessor.java#L44-L46 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/ws/logging/internal/TraceNLSResolver.java | TraceNLSResolver.getResourceBundle | public ResourceBundle getResourceBundle(Class<?> aClass, String bundleName, Locale locale) {
"""
Like {@link #getResourceBundle(Class, String, List)}, but takes a single
Locale.
@see #getResourceBundle(Class, String, List)
"""
return getResourceBundle(aClass, bundleName, (locale == null) ? null : C... | java | public ResourceBundle getResourceBundle(Class<?> aClass, String bundleName, Locale locale) {
return getResourceBundle(aClass, bundleName, (locale == null) ? null : Collections.singletonList(locale));
} | [
"public",
"ResourceBundle",
"getResourceBundle",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"String",
"bundleName",
",",
"Locale",
"locale",
")",
"{",
"return",
"getResourceBundle",
"(",
"aClass",
",",
"bundleName",
",",
"(",
"locale",
"==",
"null",
")",
"?... | Like {@link #getResourceBundle(Class, String, List)}, but takes a single
Locale.
@see #getResourceBundle(Class, String, List) | [
"Like",
"{",
"@link",
"#getResourceBundle",
"(",
"Class",
"String",
"List",
")",
"}",
"but",
"takes",
"a",
"single",
"Locale",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ws/logging/internal/TraceNLSResolver.java#L303-L305 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineExtensionsInner.java | VirtualMachineExtensionsInner.createOrUpdate | public VirtualMachineExtensionInner createOrUpdate(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) {
"""
The operation to create or update the extension.
@param resourceGroupName The name of the resource group.
@param vmName The name of the vir... | java | public VirtualMachineExtensionInner createOrUpdate(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).toBlocking().last().body();
} | [
"public",
"VirtualMachineExtensionInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"String",
"vmExtensionName",
",",
"VirtualMachineExtensionInner",
"extensionParameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"... | The operation to create or update the extension.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine where the extension should be created or updated.
@param vmExtensionName The name of the virtual machine extension.
@param extensionParameters Parameters supplied to t... | [
"The",
"operation",
"to",
"create",
"or",
"update",
"the",
"extension",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineExtensionsInner.java#L102-L104 |
inkstand-io/scribble | scribble-jcr/src/main/java/io/inkstand/scribble/jcr/JCRAssert.java | JCRAssert.assertPrimaryNodeType | public static void assertPrimaryNodeType(final Node node, final String nodeType) throws RepositoryException {
"""
Asserts the primary node type of the node
@param node
the node whose primary node type should be checked
@param nodeType
the nodetype that is asserted to be the node type of the node
@throws Rep... | java | public static void assertPrimaryNodeType(final Node node, final String nodeType) throws RepositoryException {
final NodeType primaryNodeType = node.getPrimaryNodeType();
assertEquals(nodeType, primaryNodeType.getName());
} | [
"public",
"static",
"void",
"assertPrimaryNodeType",
"(",
"final",
"Node",
"node",
",",
"final",
"String",
"nodeType",
")",
"throws",
"RepositoryException",
"{",
"final",
"NodeType",
"primaryNodeType",
"=",
"node",
".",
"getPrimaryNodeType",
"(",
")",
";",
"assert... | Asserts the primary node type of the node
@param node
the node whose primary node type should be checked
@param nodeType
the nodetype that is asserted to be the node type of the node
@throws RepositoryException | [
"Asserts",
"the",
"primary",
"node",
"type",
"of",
"the",
"node"
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/JCRAssert.java#L173-L176 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java | H2GISDBFactory.createDataSource | public static DataSource createDataSource(String dbName ,boolean initSpatial) throws SQLException {
"""
Create a database and return a DataSource
@param dbName DataBase name, or path URI
@param initSpatial True to enable basic spatial capabilities
@return DataSource
@throws SQLException
"""
return ... | java | public static DataSource createDataSource(String dbName ,boolean initSpatial) throws SQLException {
return createDataSource(dbName, initSpatial, H2_PARAMETERS);
} | [
"public",
"static",
"DataSource",
"createDataSource",
"(",
"String",
"dbName",
",",
"boolean",
"initSpatial",
")",
"throws",
"SQLException",
"{",
"return",
"createDataSource",
"(",
"dbName",
",",
"initSpatial",
",",
"H2_PARAMETERS",
")",
";",
"}"
] | Create a database and return a DataSource
@param dbName DataBase name, or path URI
@param initSpatial True to enable basic spatial capabilities
@return DataSource
@throws SQLException | [
"Create",
"a",
"database",
"and",
"return",
"a",
"DataSource"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java#L93-L95 |
dnsjava/dnsjava | org/xbill/DNS/DNSInput.java | DNSInput.readByteArray | public void
readByteArray(byte [] b, int off, int len) throws WireParseException {
"""
Reads a byte array of a specified length from the stream into an existing
array.
@param b The array to read into.
@param off The offset of the array to start copying data into.
@param len The number of bytes to copy.
@throw... | java | public void
readByteArray(byte [] b, int off, int len) throws WireParseException {
require(len);
byteBuffer.get(b, off, len);
} | [
"public",
"void",
"readByteArray",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"WireParseException",
"{",
"require",
"(",
"len",
")",
";",
"byteBuffer",
".",
"get",
"(",
"b",
",",
"off",
",",
"len",
")",
";",
"}... | Reads a byte array of a specified length from the stream into an existing
array.
@param b The array to read into.
@param off The offset of the array to start copying data into.
@param len The number of bytes to copy.
@throws WireParseException The end of the stream was reached. | [
"Reads",
"a",
"byte",
"array",
"of",
"a",
"specified",
"length",
"from",
"the",
"stream",
"into",
"an",
"existing",
"array",
"."
] | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/DNSInput.java#L194-L198 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/BigendianEncoding.java | BigendianEncoding.longToByteArray | static void longToByteArray(long value, byte[] dest, int destOffset) {
"""
Stores the big-endian representation of {@code value} in the {@code dest} starting from the
{@code destOffset}.
@param value the value to be converted.
@param dest the destination byte array.
@param destOffset the starting offset in t... | java | static void longToByteArray(long value, byte[] dest, int destOffset) {
Utils.checkArgument(dest.length >= destOffset + LONG_BYTES, "array too small");
dest[destOffset + 7] = (byte) (value & 0xFFL);
dest[destOffset + 6] = (byte) (value >> 8 & 0xFFL);
dest[destOffset + 5] = (byte) (value >> 16 & 0xFFL);
... | [
"static",
"void",
"longToByteArray",
"(",
"long",
"value",
",",
"byte",
"[",
"]",
"dest",
",",
"int",
"destOffset",
")",
"{",
"Utils",
".",
"checkArgument",
"(",
"dest",
".",
"length",
">=",
"destOffset",
"+",
"LONG_BYTES",
",",
"\"array too small\"",
")",
... | Stores the big-endian representation of {@code value} in the {@code dest} starting from the
{@code destOffset}.
@param value the value to be converted.
@param dest the destination byte array.
@param destOffset the starting offset in the destination byte array. | [
"Stores",
"the",
"big",
"-",
"endian",
"representation",
"of",
"{",
"@code",
"value",
"}",
"in",
"the",
"{",
"@code",
"dest",
"}",
"starting",
"from",
"the",
"{",
"@code",
"destOffset",
"}",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/BigendianEncoding.java#L79-L89 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/WikipediaInfo.java | WikipediaInfo.getNumberOfCategorizedArticles | public int getNumberOfCategorizedArticles(Wikipedia pWiki, CategoryGraph catGraph) throws WikiApiException {
"""
If the return value has been already computed, it is returned, else it is computed at retrieval time.
@param pWiki The wikipedia object.
@param catGraph The category graph.
@return The number of cate... | java | public int getNumberOfCategorizedArticles(Wikipedia pWiki, CategoryGraph catGraph) throws WikiApiException{
if (categorizedArticleSet == null) { // has not been initialized yet
iterateCategoriesGetArticles(pWiki, catGraph);
}
return categorizedArticleSet.size();
} | [
"public",
"int",
"getNumberOfCategorizedArticles",
"(",
"Wikipedia",
"pWiki",
",",
"CategoryGraph",
"catGraph",
")",
"throws",
"WikiApiException",
"{",
"if",
"(",
"categorizedArticleSet",
"==",
"null",
")",
"{",
"// has not been initialized yet",
"iterateCategoriesGetArticl... | If the return value has been already computed, it is returned, else it is computed at retrieval time.
@param pWiki The wikipedia object.
@param catGraph The category graph.
@return The number of categorized articles, i.e. articles that have at least one category. | [
"If",
"the",
"return",
"value",
"has",
"been",
"already",
"computed",
"it",
"is",
"returned",
"else",
"it",
"is",
"computed",
"at",
"retrieval",
"time",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/WikipediaInfo.java#L287-L292 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java | PrimaveraReader.applyAliases | private void applyAliases(Map<FieldType, String> aliases) {
"""
Apply aliases to task and resource fields.
@param aliases map of aliases
"""
CustomFieldContainer fields = m_project.getCustomFields();
for (Map.Entry<FieldType, String> entry : aliases.entrySet())
{
fields.getCustomF... | java | private void applyAliases(Map<FieldType, String> aliases)
{
CustomFieldContainer fields = m_project.getCustomFields();
for (Map.Entry<FieldType, String> entry : aliases.entrySet())
{
fields.getCustomField(entry.getKey()).setAlias(entry.getValue());
}
} | [
"private",
"void",
"applyAliases",
"(",
"Map",
"<",
"FieldType",
",",
"String",
">",
"aliases",
")",
"{",
"CustomFieldContainer",
"fields",
"=",
"m_project",
".",
"getCustomFields",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"FieldType",
",",
"St... | Apply aliases to task and resource fields.
@param aliases map of aliases | [
"Apply",
"aliases",
"to",
"task",
"and",
"resource",
"fields",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java#L1481-L1488 |
vlingo/vlingo-actors | src/main/java/io/vlingo/actors/Stage.java | Stage.actorFor | public <T> T actorFor(final Class<T> protocol, final Definition definition, final Logger logger) {
"""
Answers the {@code T} protocol of the newly created {@code Actor} that implements the {@code protocol} and
that will be assigned the specific {@code logger}.
@param <T> the protocol type
@param protocol the {@... | java | public <T> T actorFor(final Class<T> protocol, final Definition definition, final Logger logger) {
return actorFor(
protocol,
definition,
definition.parentOr(world.defaultParent()),
definition.supervisor(),
logger);
} | [
"public",
"<",
"T",
">",
"T",
"actorFor",
"(",
"final",
"Class",
"<",
"T",
">",
"protocol",
",",
"final",
"Definition",
"definition",
",",
"final",
"Logger",
"logger",
")",
"{",
"return",
"actorFor",
"(",
"protocol",
",",
"definition",
",",
"definition",
... | Answers the {@code T} protocol of the newly created {@code Actor} that implements the {@code protocol} and
that will be assigned the specific {@code logger}.
@param <T> the protocol type
@param protocol the {@code Class<T>} protocol
@param definition the {@code Definition} used to initialize the newly created {@code Ac... | [
"Answers",
"the",
"{"
] | train | https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/Stage.java#L103-L110 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java | PatternsImpl.updatePatterns | public List<PatternRuleInfo> updatePatterns(UUID appId, String versionId, List<PatternRuleUpdateObject> patterns) {
"""
Updates patterns.
@param appId The application ID.
@param versionId The version ID.
@param patterns An array represents the patterns.
@throws IllegalArgumentException thrown if parameters f... | java | public List<PatternRuleInfo> updatePatterns(UUID appId, String versionId, List<PatternRuleUpdateObject> patterns) {
return updatePatternsWithServiceResponseAsync(appId, versionId, patterns).toBlocking().single().body();
} | [
"public",
"List",
"<",
"PatternRuleInfo",
">",
"updatePatterns",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"List",
"<",
"PatternRuleUpdateObject",
">",
"patterns",
")",
"{",
"return",
"updatePatternsWithServiceResponseAsync",
"(",
"appId",
",",
"version... | Updates patterns.
@param appId The application ID.
@param versionId The version ID.
@param patterns An array represents the patterns.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws RuntimeException all other w... | [
"Updates",
"patterns",
"."
] | 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/PatternsImpl.java#L384-L386 |
payneteasy/superfly | superfly-web/src/main/java/com/payneteasy/superfly/web/wicket/component/label/DateLabels.java | DateLabels.forDateTime | public static DateLabel forDateTime(String id, Date date) {
"""
Creates a label which displays date and time.
@param id component id
@param date date to display
@return date label
"""
return DateLabel.forDatePattern(id, new Model<Date>(date),
DATE_TIME_PATTERN);
} | java | public static DateLabel forDateTime(String id, Date date) {
return DateLabel.forDatePattern(id, new Model<Date>(date),
DATE_TIME_PATTERN);
} | [
"public",
"static",
"DateLabel",
"forDateTime",
"(",
"String",
"id",
",",
"Date",
"date",
")",
"{",
"return",
"DateLabel",
".",
"forDatePattern",
"(",
"id",
",",
"new",
"Model",
"<",
"Date",
">",
"(",
"date",
")",
",",
"DATE_TIME_PATTERN",
")",
";",
"}"
... | Creates a label which displays date and time.
@param id component id
@param date date to display
@return date label | [
"Creates",
"a",
"label",
"which",
"displays",
"date",
"and",
"time",
"."
] | train | https://github.com/payneteasy/superfly/blob/4cad6d0f8e951a61f3c302c49b13a51d179076f8/superfly-web/src/main/java/com/payneteasy/superfly/web/wicket/component/label/DateLabels.java#L48-L51 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java | ExtensionsInner.beginCreate | public void beginCreate(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) {
"""
Creates an HDInsight cluster extension.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param extensionName The name of the cluster... | java | public void beginCreate(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) {
beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).toBlocking().single().body();
} | [
"public",
"void",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"extensionName",
",",
"ExtensionInner",
"parameters",
")",
"{",
"beginCreateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
",",
"e... | Creates an HDInsight cluster extension.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param extensionName The name of the cluster extension.
@param parameters The cluster extensions create request.
@throws IllegalArgumentException thrown if parameters fail the va... | [
"Creates",
"an",
"HDInsight",
"cluster",
"extension",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java#L605-L607 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/Sign.java | Sign.init | @Override
public Sign init(String algorithm, PrivateKey privateKey, PublicKey publicKey) {
"""
初始化
@param algorithm 算法
@param privateKey 私钥
@param publicKey 公钥
@return this
"""
try {
signature = Signature.getInstance(algorithm);
} catch (NoSuchAlgorithmException e) {
throw new CryptoExcep... | java | @Override
public Sign init(String algorithm, PrivateKey privateKey, PublicKey publicKey) {
try {
signature = Signature.getInstance(algorithm);
} catch (NoSuchAlgorithmException e) {
throw new CryptoException(e);
}
super.init(algorithm, privateKey, publicKey);
return this;
} | [
"@",
"Override",
"public",
"Sign",
"init",
"(",
"String",
"algorithm",
",",
"PrivateKey",
"privateKey",
",",
"PublicKey",
"publicKey",
")",
"{",
"try",
"{",
"signature",
"=",
"Signature",
".",
"getInstance",
"(",
"algorithm",
")",
";",
"}",
"catch",
"(",
"... | 初始化
@param algorithm 算法
@param privateKey 私钥
@param publicKey 公钥
@return this | [
"初始化"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/Sign.java#L157-L166 |
groovy/groovy-core | subprojects/groovy-json/src/main/java/groovy/json/StreamingJsonBuilder.java | StreamingJsonBuilder.call | public Object call(Collection coll, Closure c) throws IOException {
"""
A collection and closure passed to a JSON builder will create a root JSON array applying
the closure to each object in the collection
<p>
Example:
<pre class="groovyTestCase">
class Author {
String name
}
def authors = [new Author (nam... | java | public Object call(Collection coll, Closure c) throws IOException {
StreamingJsonDelegate.writeCollectionWithClosure(writer, coll, c);
return null;
} | [
"public",
"Object",
"call",
"(",
"Collection",
"coll",
",",
"Closure",
"c",
")",
"throws",
"IOException",
"{",
"StreamingJsonDelegate",
".",
"writeCollectionWithClosure",
"(",
"writer",
",",
"coll",
",",
"c",
")",
";",
"return",
"null",
";",
"}"
] | A collection and closure passed to a JSON builder will create a root JSON array applying
the closure to each object in the collection
<p>
Example:
<pre class="groovyTestCase">
class Author {
String name
}
def authors = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
new StringW... | [
"A",
"collection",
"and",
"closure",
"passed",
"to",
"a",
"JSON",
"builder",
"will",
"create",
"a",
"root",
"JSON",
"array",
"applying",
"the",
"closure",
"to",
"each",
"object",
"in",
"the",
"collection",
"<p",
">",
"Example",
":",
"<pre",
"class",
"=",
... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/subprojects/groovy-json/src/main/java/groovy/json/StreamingJsonBuilder.java#L184-L188 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.multTransB | public static void multTransB(DMatrix1Row a , DMatrix1Row b , DMatrix1Row c ) {
"""
<p>
Performs the following operation:<br>
<br>
c = a * b<sup>T</sup> <br>
c<sub>ij</sub> = ∑<sub>k=1:n</sub> { a<sub>ik</sub> * b<sub>jk</sub>}
</p>
@param a The left matrix in the multiplication operation. Not modified... | java | public static void multTransB(DMatrix1Row a , DMatrix1Row b , DMatrix1Row c )
{
if( b.numRows == 1 ) {
MatrixVectorMult_DDRM.mult(a, b, c);
} else {
MatrixMatrixMult_DDRM.multTransB(a, b, c);
}
} | [
"public",
"static",
"void",
"multTransB",
"(",
"DMatrix1Row",
"a",
",",
"DMatrix1Row",
"b",
",",
"DMatrix1Row",
"c",
")",
"{",
"if",
"(",
"b",
".",
"numRows",
"==",
"1",
")",
"{",
"MatrixVectorMult_DDRM",
".",
"mult",
"(",
"a",
",",
"b",
",",
"c",
")... | <p>
Performs the following operation:<br>
<br>
c = a * b<sup>T</sup> <br>
c<sub>ij</sub> = ∑<sub>k=1:n</sub> { a<sub>ik</sub> * b<sub>jk</sub>}
</p>
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix in the multiplication operation. Not modified.
@param c Where the re... | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"c",
"=",
"a",
"*",
"b<sup",
">",
"T<",
"/",
"sup",
">",
"<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"&sum",
";",
"<sub",
">",
"k",
"=",
"1",
":",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L175-L182 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.indexOfDifference | public static int indexOfDifference(final CharSequence cs1, final CharSequence cs2) {
"""
<p>Compares two CharSequences, and returns the index at which the
CharSequences begin to differ.</p>
<p>For example,
{@code indexOfDifference("i am a machine", "i am a robot") -> 7}</p>
<pre>
StringUtils.indexOfDiffe... | java | public static int indexOfDifference(final CharSequence cs1, final CharSequence cs2) {
if (cs1 == cs2) {
return INDEX_NOT_FOUND;
}
if (cs1 == null || cs2 == null) {
return 0;
}
int i;
for (i = 0; i < cs1.length() && i < cs2.length(); ++i) {
... | [
"public",
"static",
"int",
"indexOfDifference",
"(",
"final",
"CharSequence",
"cs1",
",",
"final",
"CharSequence",
"cs2",
")",
"{",
"if",
"(",
"cs1",
"==",
"cs2",
")",
"{",
"return",
"INDEX_NOT_FOUND",
";",
"}",
"if",
"(",
"cs1",
"==",
"null",
"||",
"cs2... | <p>Compares two CharSequences, and returns the index at which the
CharSequences begin to differ.</p>
<p>For example,
{@code indexOfDifference("i am a machine", "i am a robot") -> 7}</p>
<pre>
StringUtils.indexOfDifference(null, null) = -1
StringUtils.indexOfDifference("", "") = -1
StringUtils.indexOfDifference("", "a... | [
"<p",
">",
"Compares",
"two",
"CharSequences",
"and",
"returns",
"the",
"index",
"at",
"which",
"the",
"CharSequences",
"begin",
"to",
"differ",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L7846-L7863 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/web/JavaScriptUtils.java | JavaScriptUtils.getJavaScriptHtmlCookieString | public String getJavaScriptHtmlCookieString(String name, String value) {
"""
Creates and returns a JavaScript line that sets a cookie with the specified name and value. For example, a cookie name
of "test" and value of "123" would return {@code document.cookie="test=123;";}. Note: The name and value will be
HTML... | java | public String getJavaScriptHtmlCookieString(String name, String value) {
return getJavaScriptHtmlCookieString(name, value, null);
} | [
"public",
"String",
"getJavaScriptHtmlCookieString",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"return",
"getJavaScriptHtmlCookieString",
"(",
"name",
",",
"value",
",",
"null",
")",
";",
"}"
] | Creates and returns a JavaScript line that sets a cookie with the specified name and value. For example, a cookie name
of "test" and value of "123" would return {@code document.cookie="test=123;";}. Note: The name and value will be
HTML-encoded. | [
"Creates",
"and",
"returns",
"a",
"JavaScript",
"line",
"that",
"sets",
"a",
"cookie",
"with",
"the",
"specified",
"name",
"and",
"value",
".",
"For",
"example",
"a",
"cookie",
"name",
"of",
"test",
"and",
"value",
"of",
"123",
"would",
"return",
"{"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/web/JavaScriptUtils.java#L39-L41 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseAllowRetries | private void parseAllowRetries(Map<Object, Object> props) {
"""
Parse the input configuration for the flag on whether to allow retries
or not.
@param props
"""
Object value = props.get(HttpConfigConstants.PROPNAME_ALLOW_RETRIES);
if (null != value) {
this.bAllowRetries = convert... | java | private void parseAllowRetries(Map<Object, Object> props) {
Object value = props.get(HttpConfigConstants.PROPNAME_ALLOW_RETRIES);
if (null != value) {
this.bAllowRetries = convertBoolean(value);
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr... | [
"private",
"void",
"parseAllowRetries",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"Object",
"value",
"=",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNAME_ALLOW_RETRIES",
")",
";",
"if",
"(",
"null",
"!=",
"value",
")... | Parse the input configuration for the flag on whether to allow retries
or not.
@param props | [
"Parse",
"the",
"input",
"configuration",
"for",
"the",
"flag",
"on",
"whether",
"to",
"allow",
"retries",
"or",
"not",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L998-L1006 |
auth0/java-jwt | lib/src/main/java/com/auth0/jwt/algorithms/CryptoHelper.java | CryptoHelper.verifySignatureFor | boolean verifySignatureFor(String algorithm, byte[] secretBytes, byte[] headerBytes, byte[] payloadBytes, byte[] signatureBytes) throws NoSuchAlgorithmException, InvalidKeyException {
"""
Verify signature for JWT header and payload.
@param algorithm algorithm name.
@param secretBytes algorithm secret.
@param ... | java | boolean verifySignatureFor(String algorithm, byte[] secretBytes, byte[] headerBytes, byte[] payloadBytes, byte[] signatureBytes) throws NoSuchAlgorithmException, InvalidKeyException {
return MessageDigest.isEqual(createSignatureFor(algorithm, secretBytes, headerBytes, payloadBytes), signatureBytes);
} | [
"boolean",
"verifySignatureFor",
"(",
"String",
"algorithm",
",",
"byte",
"[",
"]",
"secretBytes",
",",
"byte",
"[",
"]",
"headerBytes",
",",
"byte",
"[",
"]",
"payloadBytes",
",",
"byte",
"[",
"]",
"signatureBytes",
")",
"throws",
"NoSuchAlgorithmException",
... | Verify signature for JWT header and payload.
@param algorithm algorithm name.
@param secretBytes algorithm secret.
@param headerBytes JWT header.
@param payloadBytes JWT payload.
@param signatureBytes JWT signature.
@return true if signature is valid.
@throws NoSuchAlgorithmException if the algorithm is not supported.... | [
"Verify",
"signature",
"for",
"JWT",
"header",
"and",
"payload",
"."
] | train | https://github.com/auth0/java-jwt/blob/890538970a9699b7251a4bfe4f26e8d7605ad530/lib/src/main/java/com/auth0/jwt/algorithms/CryptoHelper.java#L43-L45 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalTime.java | LocalTime.plusSeconds | public LocalTime plusSeconds(long secondstoAdd) {
"""
Returns a copy of this {@code LocalTime} with the specified number of seconds added.
<p>
This adds the specified number of seconds to this time, returning a new time.
The calculation wraps around midnight.
<p>
This instance is immutable and unaffected by t... | java | public LocalTime plusSeconds(long secondstoAdd) {
if (secondstoAdd == 0) {
return this;
}
int sofd = hour * SECONDS_PER_HOUR +
minute * SECONDS_PER_MINUTE + second;
int newSofd = ((int) (secondstoAdd % SECONDS_PER_DAY) + sofd + SECONDS_PER_DAY) % SECONDS_P... | [
"public",
"LocalTime",
"plusSeconds",
"(",
"long",
"secondstoAdd",
")",
"{",
"if",
"(",
"secondstoAdd",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"int",
"sofd",
"=",
"hour",
"*",
"SECONDS_PER_HOUR",
"+",
"minute",
"*",
"SECONDS_PER_MINUTE",
"+",
"se... | Returns a copy of this {@code LocalTime} with the specified number of seconds added.
<p>
This adds the specified number of seconds to this time, returning a new time.
The calculation wraps around midnight.
<p>
This instance is immutable and unaffected by this method call.
@param secondstoAdd the seconds to add, may b... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalTime",
"}",
"with",
"the",
"specified",
"number",
"of",
"seconds",
"added",
".",
"<p",
">",
"This",
"adds",
"the",
"specified",
"number",
"of",
"seconds",
"to",
"this",
"time",
"returning",
"a",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalTime.java#L1110-L1124 |
meltmedia/jgroups-aws | src/main/java/com/meltmedia/jgroups/aws/InstanceIdentity.java | InstanceIdentity.getIdentityDocument | private static String getIdentityDocument(final HttpClient client) throws IOException {
"""
Gets the body of the content returned from a GET request to uri.
@param client
@return the body of the message returned from the GET request.
@throws IOException if there is an error encountered while getting the conte... | java | private static String getIdentityDocument(final HttpClient client) throws IOException {
try {
final HttpGet getInstance = new HttpGet();
getInstance.setURI(INSTANCE_IDENTITY_URI);
final HttpResponse response = client.execute(getInstance);
if (response.getStatusLine().getStatusCode() != HttpS... | [
"private",
"static",
"String",
"getIdentityDocument",
"(",
"final",
"HttpClient",
"client",
")",
"throws",
"IOException",
"{",
"try",
"{",
"final",
"HttpGet",
"getInstance",
"=",
"new",
"HttpGet",
"(",
")",
";",
"getInstance",
".",
"setURI",
"(",
"INSTANCE_IDENT... | Gets the body of the content returned from a GET request to uri.
@param client
@return the body of the message returned from the GET request.
@throws IOException if there is an error encountered while getting the content. | [
"Gets",
"the",
"body",
"of",
"the",
"content",
"returned",
"from",
"a",
"GET",
"request",
"to",
"uri",
"."
] | train | https://github.com/meltmedia/jgroups-aws/blob/b5e861a6809677e317dc624f981c983ed109fed6/src/main/java/com/meltmedia/jgroups/aws/InstanceIdentity.java#L67-L79 |
arnaudroger/SimpleFlatMapper | sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/ConnectedCrud.java | ConnectedCrud.read | public <RH extends CheckedConsumer<? super T>> RH read(final Collection<K> keys, final RH consumer) throws SQLException {
"""
retrieve the objects with the specified keys and pass them to the consumer.
@param keys the keys
@param consumer the handler that is callback for each row
@throws SQLException if... | java | public <RH extends CheckedConsumer<? super T>> RH read(final Collection<K> keys, final RH consumer) throws SQLException {
transactionTemplate
.doInTransaction(new SQLFunction<Connection, Object>() {
@Override
public Object apply(Connection connection) throws SQLExcept... | [
"public",
"<",
"RH",
"extends",
"CheckedConsumer",
"<",
"?",
"super",
"T",
">",
">",
"RH",
"read",
"(",
"final",
"Collection",
"<",
"K",
">",
"keys",
",",
"final",
"RH",
"consumer",
")",
"throws",
"SQLException",
"{",
"transactionTemplate",
".",
"doInTrans... | retrieve the objects with the specified keys and pass them to the consumer.
@param keys the keys
@param consumer the handler that is callback for each row
@throws SQLException if an error occurs | [
"retrieve",
"the",
"objects",
"with",
"the",
"specified",
"keys",
"and",
"pass",
"them",
"to",
"the",
"consumer",
"."
] | train | https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/ConnectedCrud.java#L129-L139 |
hellosign/hellosign-java-sdk | src/main/java/com/hellosign/sdk/HelloSignClient.java | HelloSignClient.getEmbeddedTemplateEditUrl | public EmbeddedResponse getEmbeddedTemplateEditUrl(String templateId, boolean skipSignerRoles,
boolean skipSubjectMessage) throws HelloSignException {
"""
Retrieves the necessary information to edit an embedded template.
@param templateId String ID of the signature request to embed
@param skipSigne... | java | public EmbeddedResponse getEmbeddedTemplateEditUrl(String templateId, boolean skipSignerRoles,
boolean skipSubjectMessage) throws HelloSignException {
return getEmbeddedTemplateEditUrl(templateId, skipSignerRoles, skipSubjectMessage, false);
} | [
"public",
"EmbeddedResponse",
"getEmbeddedTemplateEditUrl",
"(",
"String",
"templateId",
",",
"boolean",
"skipSignerRoles",
",",
"boolean",
"skipSubjectMessage",
")",
"throws",
"HelloSignException",
"{",
"return",
"getEmbeddedTemplateEditUrl",
"(",
"templateId",
",",
"skipS... | Retrieves the necessary information to edit an embedded template.
@param templateId String ID of the signature request to embed
@param skipSignerRoles true if the edited template should not allow the
user to modify the template's signer roles. Defaults to false.
@param skipSubjectMessage true if the edited template sh... | [
"Retrieves",
"the",
"necessary",
"information",
"to",
"edit",
"an",
"embedded",
"template",
"."
] | train | https://github.com/hellosign/hellosign-java-sdk/blob/08fa7aeb3b0c68ddb6c7ea797d114d55d36d36b1/src/main/java/com/hellosign/sdk/HelloSignClient.java#L873-L876 |
impossibl/stencil | engine/src/main/java/com/impossibl/stencil/engine/internal/StencilOperands.java | StencilOperands.toCollection | public Collection<?> toCollection(Object val) {
"""
Coerce to a collection
@param val
Object to be coerced.
@return The Collection coerced value.
"""
if (val == null) {
return Collections.emptyList();
}
else if (val instanceof Collection<?>) {
return (Collection<?>) val;
}
... | java | public Collection<?> toCollection(Object val) {
if (val == null) {
return Collections.emptyList();
}
else if (val instanceof Collection<?>) {
return (Collection<?>) val;
}
else if (val.getClass().isArray()) {
return newArrayList((Object[]) val);
}
else if (val instanceof M... | [
"public",
"Collection",
"<",
"?",
">",
"toCollection",
"(",
"Object",
"val",
")",
"{",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"else",
"if",
"(",
"val",
"instanceof",
"Collection",
"<",
... | Coerce to a collection
@param val
Object to be coerced.
@return The Collection coerced value. | [
"Coerce",
"to",
"a",
"collection"
] | train | https://github.com/impossibl/stencil/blob/4aac1be605542b4248be95bf8916be4e2f755d1c/engine/src/main/java/com/impossibl/stencil/engine/internal/StencilOperands.java#L1153-L1170 |
lemire/JavaFastPFOR | src/main/java/me/lemire/integercompression/synth/UniformDataGenerator.java | UniformDataGenerator.generateUniform | public int[] generateUniform(int N, int Max) {
"""
generates randomly N distinct integers from 0 to Max.
@param N
number of integers to generate
@param Max
bound on the value of integers
@return an array containing randomly selected integers
"""
if (N * 2 > Max) {
... | java | public int[] generateUniform(int N, int Max) {
if (N * 2 > Max) {
return negate(generateUniform(Max - N, Max), Max);
}
if (2048 * N > Max)
return generateUniformBitmap(N, Max);
return generateUniformHash(N, M... | [
"public",
"int",
"[",
"]",
"generateUniform",
"(",
"int",
"N",
",",
"int",
"Max",
")",
"{",
"if",
"(",
"N",
"*",
"2",
">",
"Max",
")",
"{",
"return",
"negate",
"(",
"generateUniform",
"(",
"Max",
"-",
"N",
",",
"Max",
")",
",",
"Max",
")",
";",... | generates randomly N distinct integers from 0 to Max.
@param N
number of integers to generate
@param Max
bound on the value of integers
@return an array containing randomly selected integers | [
"generates",
"randomly",
"N",
"distinct",
"integers",
"from",
"0",
"to",
"Max",
"."
] | train | https://github.com/lemire/JavaFastPFOR/blob/ffeea61ab2fdb3854da7b0a557f8d22d674477f4/src/main/java/me/lemire/integercompression/synth/UniformDataGenerator.java#L80-L87 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java | SwingBindingFactory.createBoundShuttleList | public Binding createBoundShuttleList( String selectionFormProperty, Object selectableItems, String renderedProperty ) {
"""
Binds the values specified in the collection contained within
<code>selectableItems</code> (which will be wrapped in a
{@link ValueHolder} to a {@link ShuttleList}, with any user selection... | java | public Binding createBoundShuttleList( String selectionFormProperty, Object selectableItems, String renderedProperty ) {
return createBoundShuttleList(selectionFormProperty, new ValueHolder(selectableItems), renderedProperty);
} | [
"public",
"Binding",
"createBoundShuttleList",
"(",
"String",
"selectionFormProperty",
",",
"Object",
"selectableItems",
",",
"String",
"renderedProperty",
")",
"{",
"return",
"createBoundShuttleList",
"(",
"selectionFormProperty",
",",
"new",
"ValueHolder",
"(",
"selecta... | Binds the values specified in the collection contained within
<code>selectableItems</code> (which will be wrapped in a
{@link ValueHolder} to a {@link ShuttleList}, with any user selection
being placed in the form property referred to by
<code>selectionFormProperty</code>. Each item in the list will be
rendered by look... | [
"Binds",
"the",
"values",
"specified",
"in",
"the",
"collection",
"contained",
"within",
"<code",
">",
"selectableItems<",
"/",
"code",
">",
"(",
"which",
"will",
"be",
"wrapped",
"in",
"a",
"{",
"@link",
"ValueHolder",
"}",
"to",
"a",
"{",
"@link",
"Shutt... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java#L387-L389 |
sdl/odata | odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java | EntityDataModelUtil.isCollection | public static boolean isCollection(EntityDataModel entityDataModel, String typeName) {
"""
Checks if the specified typeName is a collection.
@param entityDataModel The entity data model.
@param typeName The type name to check.
@return True if the type is a collection, False if not
"""
Entit... | java | public static boolean isCollection(EntityDataModel entityDataModel, String typeName) {
EntitySet entitySet = entityDataModel.getEntityContainer().getEntitySet(typeName);
if (entitySet != null) {
return true;
}
try {
if (Collection.class.isAssignableFrom(Class.forN... | [
"public",
"static",
"boolean",
"isCollection",
"(",
"EntityDataModel",
"entityDataModel",
",",
"String",
"typeName",
")",
"{",
"EntitySet",
"entitySet",
"=",
"entityDataModel",
".",
"getEntityContainer",
"(",
")",
".",
"getEntitySet",
"(",
"typeName",
")",
";",
"i... | Checks if the specified typeName is a collection.
@param entityDataModel The entity data model.
@param typeName The type name to check.
@return True if the type is a collection, False if not | [
"Checks",
"if",
"the",
"specified",
"typeName",
"is",
"a",
"collection",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L671-L686 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeojsonPoint | public static void toGeojsonPoint(Point point, StringBuilder sb) {
"""
For type "Point", the "coordinates" member must be a single position.
A position is the fundamental geometry construct. The "coordinates"
member of a geometry object is composed of one position (in the case of a
Point geometry), an array o... | java | public static void toGeojsonPoint(Point point, StringBuilder sb) {
Coordinate coord = point.getCoordinate();
sb.append("{\"type\":\"Point\",\"coordinates\":[");
sb.append(coord.x).append(",").append(coord.y);
if (!Double.isNaN(coord.z)) {
sb.append(",").append(coord.z);
... | [
"public",
"static",
"void",
"toGeojsonPoint",
"(",
"Point",
"point",
",",
"StringBuilder",
"sb",
")",
"{",
"Coordinate",
"coord",
"=",
"point",
".",
"getCoordinate",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"{\\\"type\\\":\\\"Point\\\",\\\"coordinates\\\":[\"",
... | For type "Point", the "coordinates" member must be a single position.
A position is the fundamental geometry construct. The "coordinates"
member of a geometry object is composed of one position (in the case of a
Point geometry), an array of positions (LineString or MultiPoint
geometries), an array of arrays of positio... | [
"For",
"type",
"Point",
"the",
"coordinates",
"member",
"must",
"be",
"a",
"single",
"position",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L106-L114 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.rotateAround | public Matrix4x3f rotateAround(Quaternionfc quat, float ox, float oy, float oz) {
"""
Apply the rotation transformation of the given {@link Quaternionfc} to this matrix while using <code>(ox, oy, oz)</code> as the rotation origin.
<p>
When used with a right-handed coordinate system, the produced rotation will ro... | java | public Matrix4x3f rotateAround(Quaternionfc quat, float ox, float oy, float oz) {
return rotateAround(quat, ox, oy, oz, this);
} | [
"public",
"Matrix4x3f",
"rotateAround",
"(",
"Quaternionfc",
"quat",
",",
"float",
"ox",
",",
"float",
"oy",
",",
"float",
"oz",
")",
"{",
"return",
"rotateAround",
"(",
"quat",
",",
"ox",
",",
"oy",
",",
"oz",
",",
"this",
")",
";",
"}"
] | Apply the rotation transformation of the given {@link Quaternionfc} to this matrix while using <code>(ox, oy, oz)</code> as the rotation origin.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise around the rotation axis, when viewing along the negative axi... | [
"Apply",
"the",
"rotation",
"transformation",
"of",
"the",
"given",
"{",
"@link",
"Quaternionfc",
"}",
"to",
"this",
"matrix",
"while",
"using",
"<code",
">",
"(",
"ox",
"oy",
"oz",
")",
"<",
"/",
"code",
">",
"as",
"the",
"rotation",
"origin",
".",
"<... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L4008-L4010 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/AlphabeticIndex.java | AlphabeticIndex.isOneLabelBetterThanOther | private static boolean isOneLabelBetterThanOther(Normalizer2 nfkdNormalizer, String one, String other) {
"""
Returns true if one index character string is "better" than the other.
Shorter NFKD is better, and otherwise NFKD-binary-less-than is
better, and otherwise binary-less-than is better.
"""
// T... | java | private static boolean isOneLabelBetterThanOther(Normalizer2 nfkdNormalizer, String one, String other) {
// This is called with primary-equal strings, but never with one.equals(other).
String n1 = nfkdNormalizer.normalize(one);
String n2 = nfkdNormalizer.normalize(other);
int result = n1... | [
"private",
"static",
"boolean",
"isOneLabelBetterThanOther",
"(",
"Normalizer2",
"nfkdNormalizer",
",",
"String",
"one",
",",
"String",
"other",
")",
"{",
"// This is called with primary-equal strings, but never with one.equals(other).",
"String",
"n1",
"=",
"nfkdNormalizer",
... | Returns true if one index character string is "better" than the other.
Shorter NFKD is better, and otherwise NFKD-binary-less-than is
better, and otherwise binary-less-than is better. | [
"Returns",
"true",
"if",
"one",
"index",
"character",
"string",
"is",
"better",
"than",
"the",
"other",
".",
"Shorter",
"NFKD",
"is",
"better",
"and",
"otherwise",
"NFKD",
"-",
"binary",
"-",
"less",
"-",
"than",
"is",
"better",
"and",
"otherwise",
"binary... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/AlphabeticIndex.java#L799-L812 |
pmayweg/sonar-groovy | sonar-groovy-plugin/src/main/java/org/sonar/plugins/groovy/jacoco/JaCoCoReportReader.java | JaCoCoReportReader.analyzeClassFile | private static void analyzeClassFile(org.jacoco.previous.core.analysis.Analyzer analyzer, File classFile) {
"""
Caller must guarantee that {@code classFile} is actually class file.
"""
try (InputStream inputStream = new FileInputStream(classFile)) {
analyzer.analyzeClass(inputStream, classFile.getPat... | java | private static void analyzeClassFile(org.jacoco.previous.core.analysis.Analyzer analyzer, File classFile) {
try (InputStream inputStream = new FileInputStream(classFile)) {
analyzer.analyzeClass(inputStream, classFile.getPath());
} catch (IOException e) {
// (Godin): in fact JaCoCo includes name int... | [
"private",
"static",
"void",
"analyzeClassFile",
"(",
"org",
".",
"jacoco",
".",
"previous",
".",
"core",
".",
"analysis",
".",
"Analyzer",
"analyzer",
",",
"File",
"classFile",
")",
"{",
"try",
"(",
"InputStream",
"inputStream",
"=",
"new",
"FileInputStream",... | Caller must guarantee that {@code classFile} is actually class file. | [
"Caller",
"must",
"guarantee",
"that",
"{"
] | train | https://github.com/pmayweg/sonar-groovy/blob/2d78d6578304601613db928795d81de340e6fa34/sonar-groovy-plugin/src/main/java/org/sonar/plugins/groovy/jacoco/JaCoCoReportReader.java#L126-L133 |
j256/ormlite-core | src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java | DatabaseTableConfigLoader.readFields | private static <T> void readFields(BufferedReader reader, DatabaseTableConfig<T> config) throws SQLException {
"""
Read all of the fields information from the configuration file.
"""
List<DatabaseFieldConfig> fields = new ArrayList<DatabaseFieldConfig>();
while (true) {
String line;
try {
line = ... | java | private static <T> void readFields(BufferedReader reader, DatabaseTableConfig<T> config) throws SQLException {
List<DatabaseFieldConfig> fields = new ArrayList<DatabaseFieldConfig>();
while (true) {
String line;
try {
line = reader.readLine();
} catch (IOException e) {
throw SqlExceptionUtil.create... | [
"private",
"static",
"<",
"T",
">",
"void",
"readFields",
"(",
"BufferedReader",
"reader",
",",
"DatabaseTableConfig",
"<",
"T",
">",
"config",
")",
"throws",
"SQLException",
"{",
"List",
"<",
"DatabaseFieldConfig",
">",
"fields",
"=",
"new",
"ArrayList",
"<",... | Read all of the fields information from the configuration file. | [
"Read",
"all",
"of",
"the",
"fields",
"information",
"from",
"the",
"configuration",
"file",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/DatabaseTableConfigLoader.java#L151-L170 |
google/flogger | google/src/main/java/com/google/common/flogger/GoogleLogger.java | GoogleLogger.forInjectedClassName | @Deprecated
public static GoogleLogger forInjectedClassName(String className) {
"""
Returns a new Google specific logger instance for the given class, using printf
style message formatting.
@deprecated prefer forEnclosingClass(); this method exists only to support
compile-time log site injection.
"""
... | java | @Deprecated
public static GoogleLogger forInjectedClassName(String className) {
checkArgument(!className.isEmpty(), "injected class name is empty");
// The injected class name is in binary form (e.g. java/util/Map$Entry) to re-use
// constant pool entries.
return new GoogleLogger(Platform.getBackend(c... | [
"@",
"Deprecated",
"public",
"static",
"GoogleLogger",
"forInjectedClassName",
"(",
"String",
"className",
")",
"{",
"checkArgument",
"(",
"!",
"className",
".",
"isEmpty",
"(",
")",
",",
"\"injected class name is empty\"",
")",
";",
"// The injected class name is in bi... | Returns a new Google specific logger instance for the given class, using printf
style message formatting.
@deprecated prefer forEnclosingClass(); this method exists only to support
compile-time log site injection. | [
"Returns",
"a",
"new",
"Google",
"specific",
"logger",
"instance",
"for",
"the",
"given",
"class",
"using",
"printf",
"style",
"message",
"formatting",
"."
] | train | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/google/src/main/java/com/google/common/flogger/GoogleLogger.java#L59-L65 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.