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 |
|---|---|---|---|---|---|---|---|---|---|---|
belaban/JGroups | src/org/jgroups/util/Bits.java | Bits.writeAsciiString | public static void writeAsciiString(AsciiString s, ByteBuffer buf) {
"""
Writes an AsciiString to buf. The length of the string is written first, followed by the chars (as single-byte values).
@param s the string
@param buf the buffer
"""
short length=(short)(s != null? s.length() : -1);
buf.... | java | public static void writeAsciiString(AsciiString s, ByteBuffer buf) {
short length=(short)(s != null? s.length() : -1);
buf.putShort(length);
if(s != null)
buf.put(s.chars());
} | [
"public",
"static",
"void",
"writeAsciiString",
"(",
"AsciiString",
"s",
",",
"ByteBuffer",
"buf",
")",
"{",
"short",
"length",
"=",
"(",
"short",
")",
"(",
"s",
"!=",
"null",
"?",
"s",
".",
"length",
"(",
")",
":",
"-",
"1",
")",
";",
"buf",
".",
... | Writes an AsciiString to buf. The length of the string is written first, followed by the chars (as single-byte values).
@param s the string
@param buf the buffer | [
"Writes",
"an",
"AsciiString",
"to",
"buf",
".",
"The",
"length",
"of",
"the",
"string",
"is",
"written",
"first",
"followed",
"by",
"the",
"chars",
"(",
"as",
"single",
"-",
"byte",
"values",
")",
"."
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/Bits.java#L695-L700 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/json/JSONDeserializer.java | JSONDeserializer.deserializeToField | public static void deserializeToField(final Object containingObject, final String fieldName, final String json)
throws IllegalArgumentException {
"""
Deserialize JSON to a new object graph, with the root object of the specified expected type, and store the
root object in the named field of the given c... | java | public static void deserializeToField(final Object containingObject, final String fieldName, final String json)
throws IllegalArgumentException {
final ClassFieldCache typeCache = new ClassFieldCache(/* resolveTypes = */ true,
/* onlySerializePublicFields = */ false);
deseria... | [
"public",
"static",
"void",
"deserializeToField",
"(",
"final",
"Object",
"containingObject",
",",
"final",
"String",
"fieldName",
",",
"final",
"String",
"json",
")",
"throws",
"IllegalArgumentException",
"{",
"final",
"ClassFieldCache",
"typeCache",
"=",
"new",
"C... | Deserialize JSON to a new object graph, with the root object of the specified expected type, and store the
root object in the named field of the given containing object. Works for generic types, since it is possible
to obtain the generic type of a field.
@param containingObject
The object containing the named field to... | [
"Deserialize",
"JSON",
"to",
"a",
"new",
"object",
"graph",
"with",
"the",
"root",
"object",
"of",
"the",
"specified",
"expected",
"type",
"and",
"store",
"the",
"root",
"object",
"in",
"the",
"named",
"field",
"of",
"the",
"given",
"containing",
"object",
... | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/JSONDeserializer.java#L754-L759 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java | UCharacter.codePointCount | public static int codePointCount(CharSequence text, int start, int limit) {
"""
Equivalent to the {@link Character#codePointCount(CharSequence, int, int)}
method, for convenience. Counts the number of code points in the range
of text.
@param text the characters to check
@param start the start of the range
@p... | java | public static int codePointCount(CharSequence text, int start, int limit) {
if (start < 0 || limit < start || limit > text.length()) {
throw new IndexOutOfBoundsException("start (" + start +
") or limit (" + limit +
") invalid or out of range 0, " + text.lengt... | [
"public",
"static",
"int",
"codePointCount",
"(",
"CharSequence",
"text",
",",
"int",
"start",
",",
"int",
"limit",
")",
"{",
"if",
"(",
"start",
"<",
"0",
"||",
"limit",
"<",
"start",
"||",
"limit",
">",
"text",
".",
"length",
"(",
")",
")",
"{",
... | Equivalent to the {@link Character#codePointCount(CharSequence, int, int)}
method, for convenience. Counts the number of code points in the range
of text.
@param text the characters to check
@param start the start of the range
@param limit the limit of the range
@return the number of code points in the range | [
"Equivalent",
"to",
"the",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java#L5510-L5529 |
deeplearning4j/deeplearning4j | nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronUtil.java | AeronUtil.subscriberLoop | public static Consumer<Subscription> subscriberLoop(final FragmentHandler fragmentHandler, final int limit,
final AtomicBoolean running, final AtomicBoolean launched) {
"""
Return a reusable, parametrized
event loop that calls a
default idler
when no messages are received
@param fragmentH... | java | public static Consumer<Subscription> subscriberLoop(final FragmentHandler fragmentHandler, final int limit,
final AtomicBoolean running, final AtomicBoolean launched) {
final IdleStrategy idleStrategy = new BusySpinIdleStrategy();
return subscriberLoop(fragmentHandler, limit, running... | [
"public",
"static",
"Consumer",
"<",
"Subscription",
">",
"subscriberLoop",
"(",
"final",
"FragmentHandler",
"fragmentHandler",
",",
"final",
"int",
"limit",
",",
"final",
"AtomicBoolean",
"running",
",",
"final",
"AtomicBoolean",
"launched",
")",
"{",
"final",
"I... | Return a reusable, parametrized
event loop that calls a
default idler
when no messages are received
@param fragmentHandler to be called back for each message.
@param limit passed to {@link Subscription#poll(FragmentHandler, int)}
@param running indication for loop
@return loop function | [
"Return",
"a",
"reusable",
"parametrized",
"event",
"loop",
"that",
"calls",
"a",
"default",
"idler",
"when",
"no",
"messages",
"are",
"received"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronUtil.java#L89-L93 |
BBN-E/bue-common-open | nlp-core-open/src/main/java/com/bbn/nlp/corpora/ere/ERELoader.java | ERELoading.toFiller | private EREFiller toFiller(final Element xml, final String docid) {
"""
==== Fillers and transforming them to APF entity/value/time ====
"""
final String id = generateID(XMLUtils.requiredAttribute(xml, "id"), docid);
final String type = XMLUtils.requiredAttribute(xml, "type");
final int extentStart... | java | private EREFiller toFiller(final Element xml, final String docid) {
final String id = generateID(XMLUtils.requiredAttribute(xml, "id"), docid);
final String type = XMLUtils.requiredAttribute(xml, "type");
final int extentStart = XMLUtils.requiredIntegerAttribute(xml, "offset");
final int extentEnd = ext... | [
"private",
"EREFiller",
"toFiller",
"(",
"final",
"Element",
"xml",
",",
"final",
"String",
"docid",
")",
"{",
"final",
"String",
"id",
"=",
"generateID",
"(",
"XMLUtils",
".",
"requiredAttribute",
"(",
"xml",
",",
"\"id\"",
")",
",",
"docid",
")",
";",
... | ==== Fillers and transforming them to APF entity/value/time ==== | [
"====",
"Fillers",
"and",
"transforming",
"them",
"to",
"APF",
"entity",
"/",
"value",
"/",
"time",
"===="
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/nlp-core-open/src/main/java/com/bbn/nlp/corpora/ere/ERELoader.java#L239-L256 |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapResponse.java | ImapResponse.commandComplete | public void commandComplete(ImapCommand command, String responseCode) {
"""
Writes a standard tagged OK response on completion of a command,
with a response code (eg READ-WRITE)
Response is writen as:
<pre> a01 OK [responseCode] COMMAND_NAME completed.</pre>
@param command The ImapCommand which was ... | java | public void commandComplete(ImapCommand command, String responseCode) {
tag();
message(OK);
responseCode(responseCode);
commandName(command);
message("completed.");
end();
} | [
"public",
"void",
"commandComplete",
"(",
"ImapCommand",
"command",
",",
"String",
"responseCode",
")",
"{",
"tag",
"(",
")",
";",
"message",
"(",
"OK",
")",
";",
"responseCode",
"(",
"responseCode",
")",
";",
"commandName",
"(",
"command",
")",
";",
"mess... | Writes a standard tagged OK response on completion of a command,
with a response code (eg READ-WRITE)
Response is writen as:
<pre> a01 OK [responseCode] COMMAND_NAME completed.</pre>
@param command The ImapCommand which was completed.
@param responseCode A string response code to send to the client. | [
"Writes",
"a",
"standard",
"tagged",
"OK",
"response",
"on",
"completion",
"of",
"a",
"command",
"with",
"a",
"response",
"code",
"(",
"eg",
"READ",
"-",
"WRITE",
")",
"Response",
"is",
"writen",
"as",
":",
"<pre",
">",
"a01",
"OK",
"[",
"responseCode",
... | train | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapResponse.java#L53-L60 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java | OdsElements.addTableToContent | public Table addTableToContent(final String name, final int rowCapacity,
final int columnCapacity) throws IOException {
"""
Add a new table to content. The config for this table is added to the settings.
If the OdsElements is observed, the previous table is flushed. If there is... | java | public Table addTableToContent(final String name, final int rowCapacity,
final int columnCapacity) throws IOException {
final Table previousTable = this.contentElement.getLastTable();
final Table table = this.contentElement.addTable(name, rowCapacity, columnCapacity... | [
"public",
"Table",
"addTableToContent",
"(",
"final",
"String",
"name",
",",
"final",
"int",
"rowCapacity",
",",
"final",
"int",
"columnCapacity",
")",
"throws",
"IOException",
"{",
"final",
"Table",
"previousTable",
"=",
"this",
".",
"contentElement",
".",
"get... | Add a new table to content. The config for this table is added to the settings.
If the OdsElements is observed, the previous table is flushed. If there is no previous table,
meta.xml, styles.xml and the preamble of content.xml are written to destination.
@param name name of the table
@param rowCapacity es... | [
"Add",
"a",
"new",
"table",
"to",
"content",
".",
"The",
"config",
"for",
"this",
"table",
"is",
"added",
"to",
"the",
"settings",
".",
"If",
"the",
"OdsElements",
"is",
"observed",
"the",
"previous",
"table",
"is",
"flushed",
".",
"If",
"there",
"is",
... | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java#L214-L226 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java | RegionForwardingRuleId.of | public static RegionForwardingRuleId of(String project, String region, String rule) {
"""
Returns a region forwarding rule identity given project, region and rule names. The forwarding
rule name must be 1-63 characters long and comply with RFC1035. Specifically, the name must
match the regular expression {@code ... | java | public static RegionForwardingRuleId of(String project, String region, String rule) {
return new RegionForwardingRuleId(project, region, rule);
} | [
"public",
"static",
"RegionForwardingRuleId",
"of",
"(",
"String",
"project",
",",
"String",
"region",
",",
"String",
"rule",
")",
"{",
"return",
"new",
"RegionForwardingRuleId",
"(",
"project",
",",
"region",
",",
"rule",
")",
";",
"}"
] | Returns a region forwarding rule identity given project, region and rule names. The forwarding
rule name must be 1-63 characters long and comply with RFC1035. Specifically, the name must
match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character
must be a lowercase letter, and all f... | [
"Returns",
"a",
"region",
"forwarding",
"rule",
"identity",
"given",
"project",
"region",
"and",
"rule",
"names",
".",
"The",
"forwarding",
"rule",
"name",
"must",
"be",
"1",
"-",
"63",
"characters",
"long",
"and",
"comply",
"with",
"RFC1035",
".",
"Specific... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionForwardingRuleId.java#L141-L143 |
h2oai/h2o-2 | src/main/java/water/ga/GoogleAnalyticsRequest.java | GoogleAnalyticsRequest.customMetric | public T customMetric(int index, String value) {
"""
<div class="ind">
<p>
Optional.
</p>
<p>Each custom metric has an associated index. There is a maximum of 20 custom metrics (200 for Premium accounts). The name suffix must be a positive integer between 1 and 200, inclusive.</p>
<table border="1">
<tbody>
... | java | public T customMetric(int index, String value) {
customMetrics.put("cm" + index, value);
return (T) this;
} | [
"public",
"T",
"customMetric",
"(",
"int",
"index",
",",
"String",
"value",
")",
"{",
"customMetrics",
".",
"put",
"(",
"\"cm\"",
"+",
"index",
",",
"value",
")",
";",
"return",
"(",
"T",
")",
"this",
";",
"}"
] | <div class="ind">
<p>
Optional.
</p>
<p>Each custom metric has an associated index. There is a maximum of 20 custom metrics (200 for Premium accounts). The name suffix must be a positive integer between 1 and 200, inclusive.</p>
<table border="1">
<tbody>
<tr>
<th>Parameter</th>
<th>Value Type</th>
<th>Default Value</t... | [
"<div",
"class",
"=",
"ind",
">",
"<p",
">",
"Optional",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Each",
"custom",
"metric",
"has",
"an",
"associated",
"index",
".",
"There",
"is",
"a",
"maximum",
"of",
"20",
"custom",
"metrics",
"(",
"200",
"for",
"Pr... | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/ga/GoogleAnalyticsRequest.java#L264-L267 |
joelittlejohn/jsonschema2pojo | jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/PropertyRule.java | PropertyRule.apply | @Override
public JDefinedClass apply(String nodeName, JsonNode node, JsonNode parent, JDefinedClass jclass, Schema schema) {
"""
Applies this schema rule to take the required code generation steps.
<p>
This rule adds a property to a given Java class according to the Java
Bean spec. A private field is added ... | java | @Override
public JDefinedClass apply(String nodeName, JsonNode node, JsonNode parent, JDefinedClass jclass, Schema schema) {
String propertyName = ruleFactory.getNameHelper().getPropertyName(nodeName, node);
JType propertyType = ruleFactory.getSchemaRule().apply(nodeName, node, parent, jclass, sche... | [
"@",
"Override",
"public",
"JDefinedClass",
"apply",
"(",
"String",
"nodeName",
",",
"JsonNode",
"node",
",",
"JsonNode",
"parent",
",",
"JDefinedClass",
"jclass",
",",
"Schema",
"schema",
")",
"{",
"String",
"propertyName",
"=",
"ruleFactory",
".",
"getNameHelp... | Applies this schema rule to take the required code generation steps.
<p>
This rule adds a property to a given Java class according to the Java
Bean spec. A private field is added to the class, along with accompanying
accessor methods.
<p>
If this rule's schema mapper is configured to include builder methods
(see {@link... | [
"Applies",
"this",
"schema",
"rule",
"to",
"take",
"the",
"required",
"code",
"generation",
"steps",
".",
"<p",
">",
"This",
"rule",
"adds",
"a",
"property",
"to",
"a",
"given",
"Java",
"class",
"according",
"to",
"the",
"Java",
"Bean",
"spec",
".",
"A",... | train | https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/PropertyRule.java#L66-L119 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.recoverDeletedSasDefinition | public SasDefinitionBundle recoverDeletedSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) {
"""
Recovers the deleted SAS definition.
Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. Th... | java | public SasDefinitionBundle recoverDeletedSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) {
return recoverDeletedSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).toBlocking().single().body();
} | [
"public",
"SasDefinitionBundle",
"recoverDeletedSasDefinition",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"String",
"sasDefinitionName",
")",
"{",
"return",
"recoverDeletedSasDefinitionWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"storageA... | Recovers the deleted SAS definition.
Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@para... | [
"Recovers",
"the",
"deleted",
"SAS",
"definition",
".",
"Recovers",
"the",
"deleted",
"SAS",
"definition",
"for",
"the",
"specified",
"storage",
"account",
".",
"This",
"operation",
"can",
"only",
"be",
"performed",
"on",
"a",
"soft",
"-",
"delete",
"enabled",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L10975-L10977 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PhysicalDatabaseParent.java | PhysicalDatabaseParent.setProperty | public void setProperty(String strKey, Object objValue) {
"""
Set the value of this property (passed in on initialization).
@param key The parameter key value.
@param objValue The key's value.
"""
if (m_mapParams == null)
m_mapParams = new HashMap<String,Object>();
m_mapParams.put... | java | public void setProperty(String strKey, Object objValue)
{
if (m_mapParams == null)
m_mapParams = new HashMap<String,Object>();
m_mapParams.put(strKey, objValue);
} | [
"public",
"void",
"setProperty",
"(",
"String",
"strKey",
",",
"Object",
"objValue",
")",
"{",
"if",
"(",
"m_mapParams",
"==",
"null",
")",
"m_mapParams",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"m_mapParams",
".",
"put",... | Set the value of this property (passed in on initialization).
@param key The parameter key value.
@param objValue The key's value. | [
"Set",
"the",
"value",
"of",
"this",
"property",
"(",
"passed",
"in",
"on",
"initialization",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PhysicalDatabaseParent.java#L269-L274 |
jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/support/opentsdb/OpenTSDBMessageFormatter.java | OpenTSDBMessageFormatter.addTags | void addTags(StringBuilder resultString, Server server) {
"""
Add tags to the given result string, including a "host" tag with the name of the server and all of the tags
defined in the "settings" entry in the configuration file within the "tag" element.
@param resultString - the string containing the metric na... | java | void addTags(StringBuilder resultString, Server server) {
if (hostnameTag) {
addTag(resultString, "host", server.getLabel());
}
// Add the constant tag names and values.
for (Map.Entry<String, String> tagEntry : tags.entrySet()) {
addTag(resultString, tagEntry.getKey(), tagEntry.getValue());
}
} | [
"void",
"addTags",
"(",
"StringBuilder",
"resultString",
",",
"Server",
"server",
")",
"{",
"if",
"(",
"hostnameTag",
")",
"{",
"addTag",
"(",
"resultString",
",",
"\"host\"",
",",
"server",
".",
"getLabel",
"(",
")",
")",
";",
"}",
"// Add the constant tag ... | Add tags to the given result string, including a "host" tag with the name of the server and all of the tags
defined in the "settings" entry in the configuration file within the "tag" element.
@param resultString - the string containing the metric name, timestamp, value, and possibly other content. | [
"Add",
"tags",
"to",
"the",
"given",
"result",
"string",
"including",
"a",
"host",
"tag",
"with",
"the",
"name",
"of",
"the",
"server",
"and",
"all",
"of",
"the",
"tags",
"defined",
"in",
"the",
"settings",
"entry",
"in",
"the",
"configuration",
"file",
... | train | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/support/opentsdb/OpenTSDBMessageFormatter.java#L102-L111 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java | InodeLockList.lockEdgeInternal | public void lockEdgeInternal(String childName, LockMode mode) {
"""
Locks the next edge without checking or updating the mode.
@param childName the child to lock
@param mode the mode to lock in
"""
Preconditions.checkState(endsInInode());
Inode lastInode = get(numLockedInodes() - 1);
Edge edge... | java | public void lockEdgeInternal(String childName, LockMode mode) {
Preconditions.checkState(endsInInode());
Inode lastInode = get(numLockedInodes() - 1);
Edge edge = new Edge(lastInode.getId(), childName);
mEntries.add(new EdgeEntry(mInodeLockManager.lockEdge(edge, mode), edge));
} | [
"public",
"void",
"lockEdgeInternal",
"(",
"String",
"childName",
",",
"LockMode",
"mode",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"endsInInode",
"(",
")",
")",
";",
"Inode",
"lastInode",
"=",
"get",
"(",
"numLockedInodes",
"(",
")",
"-",
"1",
"... | Locks the next edge without checking or updating the mode.
@param childName the child to lock
@param mode the mode to lock in | [
"Locks",
"the",
"next",
"edge",
"without",
"checking",
"or",
"updating",
"the",
"mode",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java#L124-L130 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Call.java | Call.create | public static Call create(final BandwidthClient client, final Map <String, Object>params)
throws Exception {
"""
Dials a call, from a phone number to a phone number.
@param client the client
@param params the call params
@return the call
@throws IOException unexpected error.
"""
assert (c... | java | public static Call create(final BandwidthClient client, final Map <String, Object>params)
throws Exception {
assert (client != null && params != null);
final String callUri = client.getUserResourceUri(BandwidthConstants.CALLS_URI_PATH);
final RestResponse response = client.post(callUri, p... | [
"public",
"static",
"Call",
"create",
"(",
"final",
"BandwidthClient",
"client",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"throws",
"Exception",
"{",
"assert",
"(",
"client",
"!=",
"null",
"&&",
"params",
"!=",
"null",
")",
... | Dials a call, from a phone number to a phone number.
@param client the client
@param params the call params
@return the call
@throws IOException unexpected error. | [
"Dials",
"a",
"call",
"from",
"a",
"phone",
"number",
"to",
"a",
"phone",
"number",
"."
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Call.java#L153-L163 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/network/tunnelip_stats.java | tunnelip_stats.get | public static tunnelip_stats get(nitro_service service, String tunnelip) throws Exception {
"""
Use this API to fetch statistics of tunnelip_stats resource of given name .
"""
tunnelip_stats obj = new tunnelip_stats();
obj.set_tunnelip(tunnelip);
tunnelip_stats response = (tunnelip_stats) obj.stat_resour... | java | public static tunnelip_stats get(nitro_service service, String tunnelip) throws Exception{
tunnelip_stats obj = new tunnelip_stats();
obj.set_tunnelip(tunnelip);
tunnelip_stats response = (tunnelip_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"tunnelip_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"tunnelip",
")",
"throws",
"Exception",
"{",
"tunnelip_stats",
"obj",
"=",
"new",
"tunnelip_stats",
"(",
")",
";",
"obj",
".",
"set_tunnelip",
"(",
"tunnelip",
")",
";... | Use this API to fetch statistics of tunnelip_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"tunnelip_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/network/tunnelip_stats.java#L209-L214 |
m-m-m/util | cli/src/main/java/net/sf/mmm/util/cli/base/CliValueMap.java | CliValueMap.getOrCreate | @SuppressWarnings("unchecked")
public CliValueContainer getOrCreate(CliParameterContainer parameterContainer) {
"""
This method gets the {@link CliValueContainer} for the given {@link CliParameterContainer}. In advance to
{@link #get(CliParameterContainer)} this method will create an according {@link CliValueCo... | java | @SuppressWarnings("unchecked")
public CliValueContainer getOrCreate(CliParameterContainer parameterContainer) {
CliValueContainer result = this.map.get(parameterContainer);
if (result == null) {
PojoPropertyAccessorOneArg setter = parameterContainer.getSetter();
Class<?> propertyClass = setter.ge... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"CliValueContainer",
"getOrCreate",
"(",
"CliParameterContainer",
"parameterContainer",
")",
"{",
"CliValueContainer",
"result",
"=",
"this",
".",
"map",
".",
"get",
"(",
"parameterContainer",
")",
";",
"... | This method gets the {@link CliValueContainer} for the given {@link CliParameterContainer}. In advance to
{@link #get(CliParameterContainer)} this method will create an according {@link CliValueContainerObject} if not
present and the {@link CliParameterContainer} has a {@link CliParameterContainer#getSetter() setter} w... | [
"This",
"method",
"gets",
"the",
"{",
"@link",
"CliValueContainer",
"}",
"for",
"the",
"given",
"{",
"@link",
"CliParameterContainer",
"}",
".",
"In",
"advance",
"to",
"{",
"@link",
"#get",
"(",
"CliParameterContainer",
")",
"}",
"this",
"method",
"will",
"c... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/cli/src/main/java/net/sf/mmm/util/cli/base/CliValueMap.java#L73-L100 |
undera/jmeter-plugins | plugins/ffw/src/main/java/kg/apc/jmeter/reporters/FlexibleFileWriter.java | FlexibleFileWriter.getShiftDecimal | private String getShiftDecimal(long number, int shift) {
"""
/*
we work with timestamps, so we assume number > 1000 to avoid tests
to be faster
"""
StringBuilder builder = new StringBuilder();
builder.append(number);
int index = builder.length() - shift;
builder.insert(index,... | java | private String getShiftDecimal(long number, int shift) {
StringBuilder builder = new StringBuilder();
builder.append(number);
int index = builder.length() - shift;
builder.insert(index, ".");
return builder.toString();
} | [
"private",
"String",
"getShiftDecimal",
"(",
"long",
"number",
",",
"int",
"shift",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"number",
")",
";",
"int",
"index",
"=",
"builder",
".",
... | /*
we work with timestamps, so we assume number > 1000 to avoid tests
to be faster | [
"/",
"*",
"we",
"work",
"with",
"timestamps",
"so",
"we",
"assume",
"number",
">",
"1000",
"to",
"avoid",
"tests",
"to",
"be",
"faster"
] | train | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/ffw/src/main/java/kg/apc/jmeter/reporters/FlexibleFileWriter.java#L258-L266 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/transport/remote/AbstractRemoteTransport.java | AbstractRemoteTransport.localUpdateShortRunningFree | public void localUpdateShortRunningFree(Address logicalAddress, Long freeCount) {
"""
localUpdateShortRunningFree
@param logicalAddress the logical address
@param freeCount the free count
"""
if (trace)
log.tracef("LOCAL_UPDATE_SHORTRUNNING_FREE(%s, %d)", logicalAddress, freeCount);
D... | java | public void localUpdateShortRunningFree(Address logicalAddress, Long freeCount)
{
if (trace)
log.tracef("LOCAL_UPDATE_SHORTRUNNING_FREE(%s, %d)", logicalAddress, freeCount);
DistributedWorkManager dwm = workManagerCoordinator.resolveDistributedWorkManager(logicalAddress);
if (dwm != null... | [
"public",
"void",
"localUpdateShortRunningFree",
"(",
"Address",
"logicalAddress",
",",
"Long",
"freeCount",
")",
"{",
"if",
"(",
"trace",
")",
"log",
".",
"tracef",
"(",
"\"LOCAL_UPDATE_SHORTRUNNING_FREE(%s, %d)\"",
",",
"logicalAddress",
",",
"freeCount",
")",
";"... | localUpdateShortRunningFree
@param logicalAddress the logical address
@param freeCount the free count | [
"localUpdateShortRunningFree"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/transport/remote/AbstractRemoteTransport.java#L913-L934 |
Samsung/GearVRf | GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRRigidBody.java | GVRRigidBody.setLinearFactor | public void setLinearFactor(float x, float y, float z) {
"""
Sets an linear factor [X, Y, Z] that influences forces acting on this {@linkplain GVRRigidBody rigid body}
@param x factor on the 'X' axis.
@param y factor on the 'Y' axis.
@param z factor on the 'Z' axis.
"""
Native3DRigidBody.setLinear... | java | public void setLinearFactor(float x, float y, float z) {
Native3DRigidBody.setLinearFactor(getNative(), x, y, z);
} | [
"public",
"void",
"setLinearFactor",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"Native3DRigidBody",
".",
"setLinearFactor",
"(",
"getNative",
"(",
")",
",",
"x",
",",
"y",
",",
"z",
")",
";",
"}"
] | Sets an linear factor [X, Y, Z] that influences forces acting on this {@linkplain GVRRigidBody rigid body}
@param x factor on the 'X' axis.
@param y factor on the 'Y' axis.
@param z factor on the 'Z' axis. | [
"Sets",
"an",
"linear",
"factor",
"[",
"X",
"Y",
"Z",
"]",
"that",
"influences",
"forces",
"acting",
"on",
"this",
"{",
"@linkplain",
"GVRRigidBody",
"rigid",
"body",
"}"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRRigidBody.java#L341-L343 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.toCompoundCurveFromOptions | public CompoundCurve toCompoundCurveFromOptions(
MultiPolylineOptions multiPolylineOptions, boolean hasZ,
boolean hasM) {
"""
Convert a {@link MultiPolylineOptions} to a {@link CompoundCurve}
@param multiPolylineOptions multi polyline options
@param hasZ has z flag
@par... | java | public CompoundCurve toCompoundCurveFromOptions(
MultiPolylineOptions multiPolylineOptions, boolean hasZ,
boolean hasM) {
CompoundCurve compoundCurve = new CompoundCurve(hasZ, hasM);
for (PolylineOptions polyline : multiPolylineOptions
.getPolylineOptions()) {
... | [
"public",
"CompoundCurve",
"toCompoundCurveFromOptions",
"(",
"MultiPolylineOptions",
"multiPolylineOptions",
",",
"boolean",
"hasZ",
",",
"boolean",
"hasM",
")",
"{",
"CompoundCurve",
"compoundCurve",
"=",
"new",
"CompoundCurve",
"(",
"hasZ",
",",
"hasM",
")",
";",
... | Convert a {@link MultiPolylineOptions} to a {@link CompoundCurve}
@param multiPolylineOptions multi polyline options
@param hasZ has z flag
@param hasM has m flag
@return compound curve | [
"Convert",
"a",
"{",
"@link",
"MultiPolylineOptions",
"}",
"to",
"a",
"{",
"@link",
"CompoundCurve",
"}"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L969-L982 |
aerogear/aerogear-unifiedpush-server | push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/jms/AbstractJMSMessageProducer.java | AbstractJMSMessageProducer.sendTransacted | protected void sendTransacted(Destination destination, Serializable message, String propertyName, String propertValue) {
"""
Sends message to destination with given JMS message property name and value in transactional manner.
@param destination where to send
@param message what to send
@param propertyName pro... | java | protected void sendTransacted(Destination destination, Serializable message, String propertyName, String propertValue) {
send(destination, message, propertyName, propertValue, true);
} | [
"protected",
"void",
"sendTransacted",
"(",
"Destination",
"destination",
",",
"Serializable",
"message",
",",
"String",
"propertyName",
",",
"String",
"propertValue",
")",
"{",
"send",
"(",
"destination",
",",
"message",
",",
"propertyName",
",",
"propertValue",
... | Sends message to destination with given JMS message property name and value in transactional manner.
@param destination where to send
@param message what to send
@param propertyName property of obj
@param propertValue value of obj
Since transacted session is used, the message won't be committed until whole enclosing ... | [
"Sends",
"message",
"to",
"destination",
"with",
"given",
"JMS",
"message",
"property",
"name",
"and",
"value",
"in",
"transactional",
"manner",
"."
] | train | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/jms/AbstractJMSMessageProducer.java#L94-L96 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/sql/SqlKit.java | SqlKit.getSqlParaByString | public SqlPara getSqlParaByString(String content, Map data) {
"""
通过 String 内容获取 SqlPara 对象
<pre>
例子:
String content = "select * from user where id = #para(id)";
SqlPara sqlPara = getSqlParaByString(content, Kv.by("id", 123));
特别注意:content 参数中不能包含 #sql 指令
</pre>
"""
Template template = engine.getT... | java | public SqlPara getSqlParaByString(String content, Map data) {
Template template = engine.getTemplateByString(content);
SqlPara sqlPara = new SqlPara();
data.put(SQL_PARA_KEY, sqlPara);
sqlPara.setSql(template.renderToString(data));
data.remove(SQL_PARA_KEY); // 避免污染传入的 Map
return sqlPara;
} | [
"public",
"SqlPara",
"getSqlParaByString",
"(",
"String",
"content",
",",
"Map",
"data",
")",
"{",
"Template",
"template",
"=",
"engine",
".",
"getTemplateByString",
"(",
"content",
")",
";",
"SqlPara",
"sqlPara",
"=",
"new",
"SqlPara",
"(",
")",
";",
"data"... | 通过 String 内容获取 SqlPara 对象
<pre>
例子:
String content = "select * from user where id = #para(id)";
SqlPara sqlPara = getSqlParaByString(content, Kv.by("id", 123));
特别注意:content 参数中不能包含 #sql 指令
</pre> | [
"通过",
"String",
"内容获取",
"SqlPara",
"对象"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/sql/SqlKit.java#L219-L227 |
alkacon/opencms-core | src/org/opencms/search/CmsSearchIndexSource.java | CmsSearchIndexSource.isIndexing | public boolean isIndexing(String rootPath, String documentType) {
"""
Returns <code>true</code> in case the given resource root path is contained in the list of
configured resource names, and the given document type name is contained in the
list if configured document type names of this index source.<p>
@para... | java | public boolean isIndexing(String rootPath, String documentType) {
return m_documentTypes.contains(documentType) && isContaining(rootPath);
} | [
"public",
"boolean",
"isIndexing",
"(",
"String",
"rootPath",
",",
"String",
"documentType",
")",
"{",
"return",
"m_documentTypes",
".",
"contains",
"(",
"documentType",
")",
"&&",
"isContaining",
"(",
"rootPath",
")",
";",
"}"
] | Returns <code>true</code> in case the given resource root path is contained in the list of
configured resource names, and the given document type name is contained in the
list if configured document type names of this index source.<p>
@param rootPath the resource root path to check
@param documentType the document typ... | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"in",
"case",
"the",
"given",
"resource",
"root",
"path",
"is",
"contained",
"in",
"the",
"list",
"of",
"configured",
"resource",
"names",
"and",
"the",
"given",
"document",
"type",
"name",
"is",
"contain... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchIndexSource.java#L278-L281 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.refreshCachedData | private synchronized void refreshCachedData() throws IOException {
"""
Reload any data that may have been cached. This is necessary
when we first load the Journal, but also after any formatting
operation, since the cached data is no longer relevant.
@throws IOException
"""
IOUtils.closeStream(committedT... | java | private synchronized void refreshCachedData() throws IOException {
IOUtils.closeStream(committedTxnId);
File currentDir = journalStorage.getSingularStorageDir().getCurrentDir();
this.lastPromisedEpoch = new PersistentLongFile(
new File(currentDir, LAST_PROMISED_FILENAME), 0);
this.lastWrite... | [
"private",
"synchronized",
"void",
"refreshCachedData",
"(",
")",
"throws",
"IOException",
"{",
"IOUtils",
".",
"closeStream",
"(",
"committedTxnId",
")",
";",
"File",
"currentDir",
"=",
"journalStorage",
".",
"getSingularStorageDir",
"(",
")",
".",
"getCurrentDir",... | Reload any data that may have been cached. This is necessary
when we first load the Journal, but also after any formatting
operation, since the cached data is no longer relevant.
@throws IOException | [
"Reload",
"any",
"data",
"that",
"may",
"have",
"been",
"cached",
".",
"This",
"is",
"necessary",
"when",
"we",
"first",
"load",
"the",
"Journal",
"but",
"also",
"after",
"any",
"formatting",
"operation",
"since",
"the",
"cached",
"data",
"is",
"no",
"long... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L193-L205 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java | InternalService.getParticipants | public void getParticipants(@NonNull final String conversationId, @Nullable Callback<ComapiResult<List<Participant>>> callback) {
"""
Returns observable to add a participant to.
@param conversationId ID of a conversation to add a participant to.
@param callback Callback to deliver new session instance.
... | java | public void getParticipants(@NonNull final String conversationId, @Nullable Callback<ComapiResult<List<Participant>>> callback) {
adapter.adapt(getParticipants(conversationId), callback);
} | [
"public",
"void",
"getParticipants",
"(",
"@",
"NonNull",
"final",
"String",
"conversationId",
",",
"@",
"Nullable",
"Callback",
"<",
"ComapiResult",
"<",
"List",
"<",
"Participant",
">",
">",
">",
"callback",
")",
"{",
"adapter",
".",
"adapt",
"(",
"getPart... | Returns observable to add a participant to.
@param conversationId ID of a conversation to add a participant to.
@param callback Callback to deliver new session instance. | [
"Returns",
"observable",
"to",
"add",
"a",
"participant",
"to",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L655-L657 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java | JsonUtil.putDoubleList | public static void putDoubleList(Writer writer, List<Double> values) throws IOException {
"""
Writes the given value with the given writer.
@param writer
@param values
@throws IOException
@author vvakame
"""
if (values == null) {
writer.write("null");
} else {
startArray(writer);
for (int i = ... | java | public static void putDoubleList(Writer writer, List<Double> values) throws IOException {
if (values == null) {
writer.write("null");
} else {
startArray(writer);
for (int i = 0; i < values.size(); i++) {
put(writer, values.get(i));
if (i != values.size() - 1) {
addSeparator(writer);
}
... | [
"public",
"static",
"void",
"putDoubleList",
"(",
"Writer",
"writer",
",",
"List",
"<",
"Double",
">",
"values",
")",
"throws",
"IOException",
"{",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"writer",
".",
"write",
"(",
"\"null\"",
")",
";",
"}",
"el... | Writes the given value with the given writer.
@param writer
@param values
@throws IOException
@author vvakame | [
"Writes",
"the",
"given",
"value",
"with",
"the",
"given",
"writer",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java#L500-L513 |
impossibl/stencil | engine/src/main/java/com/impossibl/stencil/engine/internal/StencilOperands.java | StencilOperands.bitwiseOr | public Object bitwiseOr(Object left, Object right) {
"""
Performs a bitwise or.
@param left
the left operand
@param right
the right operator
@return left | right
"""
long l = toLong(left);
long r = toLong(right);
return Long.valueOf(l | r);
} | java | public Object bitwiseOr(Object left, Object right) {
long l = toLong(left);
long r = toLong(right);
return Long.valueOf(l | r);
} | [
"public",
"Object",
"bitwiseOr",
"(",
"Object",
"left",
",",
"Object",
"right",
")",
"{",
"long",
"l",
"=",
"toLong",
"(",
"left",
")",
";",
"long",
"r",
"=",
"toLong",
"(",
"right",
")",
";",
"return",
"Long",
".",
"valueOf",
"(",
"l",
"|",
"r",
... | Performs a bitwise or.
@param left
the left operand
@param right
the right operator
@return left | right | [
"Performs",
"a",
"bitwise",
"or",
"."
] | train | https://github.com/impossibl/stencil/blob/4aac1be605542b4248be95bf8916be4e2f755d1c/engine/src/main/java/com/impossibl/stencil/engine/internal/StencilOperands.java#L660-L664 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java | StaticTypeCheckingVisitor.inferClosureParameterTypes | protected void inferClosureParameterTypes(final ClassNode receiver, final Expression arguments, final ClosureExpression expression, final Parameter param, final MethodNode selectedMethod) {
"""
This method is responsible for performing type inference on closure argument types whenever code like this is
found: <co... | java | protected void inferClosureParameterTypes(final ClassNode receiver, final Expression arguments, final ClosureExpression expression, final Parameter param, final MethodNode selectedMethod) {
List<AnnotationNode> annotations = param.getAnnotations(CLOSUREPARAMS_CLASSNODE);
if (annotations != null && !anno... | [
"protected",
"void",
"inferClosureParameterTypes",
"(",
"final",
"ClassNode",
"receiver",
",",
"final",
"Expression",
"arguments",
",",
"final",
"ClosureExpression",
"expression",
",",
"final",
"Parameter",
"param",
",",
"final",
"MethodNode",
"selectedMethod",
")",
"... | This method is responsible for performing type inference on closure argument types whenever code like this is
found: <code>foo.collect { it.toUpperCase() }</code>.
In this case, the type checker tries to find if the <code>collect</code> method has its {@link Closure} argument
annotated with {@link groovy.transform.stc.... | [
"This",
"method",
"is",
"responsible",
"for",
"performing",
"type",
"inference",
"on",
"closure",
"argument",
"types",
"whenever",
"code",
"like",
"this",
"is",
"found",
":",
"<code",
">",
"foo",
".",
"collect",
"{",
"it",
".",
"toUpperCase",
"()",
"}",
"<... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java#L2845-L2860 |
infinispan/infinispan | hibernate/cache-v53/src/main/java/org/infinispan/hibernate/cache/v53/InfinispanRegionFactory.java | InfinispanRegionFactory.createCacheManager | protected EmbeddedCacheManager createCacheManager(Properties properties, ServiceRegistry serviceRegistry) {
"""
/* This method is overridden in WildFly, so the signature must not change.
"""
for (EmbeddedCacheManagerProvider provider : ServiceLoader.load(EmbeddedCacheManagerProvider.class, EmbeddedCacheM... | java | protected EmbeddedCacheManager createCacheManager(Properties properties, ServiceRegistry serviceRegistry) {
for (EmbeddedCacheManagerProvider provider : ServiceLoader.load(EmbeddedCacheManagerProvider.class, EmbeddedCacheManagerProvider.class.getClassLoader())) {
EmbeddedCacheManager cacheManager = provi... | [
"protected",
"EmbeddedCacheManager",
"createCacheManager",
"(",
"Properties",
"properties",
",",
"ServiceRegistry",
"serviceRegistry",
")",
"{",
"for",
"(",
"EmbeddedCacheManagerProvider",
"provider",
":",
"ServiceLoader",
".",
"load",
"(",
"EmbeddedCacheManagerProvider",
"... | /* This method is overridden in WildFly, so the signature must not change. | [
"/",
"*",
"This",
"method",
"is",
"overridden",
"in",
"WildFly",
"so",
"the",
"signature",
"must",
"not",
"change",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/hibernate/cache-v53/src/main/java/org/infinispan/hibernate/cache/v53/InfinispanRegionFactory.java#L276-L284 |
medallia/Word2VecJava | src/main/java/com/medallia/word2vec/util/IO.java | IO.copyAndCloseBoth | public static long copyAndCloseBoth(InputStream input, OutputStream output) throws IOException {
"""
Copy input to output and close both the input and output streams before returning
"""
try (InputStream inputStream = input) {
return copyAndCloseOutput(inputStream, output);
}
} | java | public static long copyAndCloseBoth(InputStream input, OutputStream output) throws IOException {
try (InputStream inputStream = input) {
return copyAndCloseOutput(inputStream, output);
}
} | [
"public",
"static",
"long",
"copyAndCloseBoth",
"(",
"InputStream",
"input",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"try",
"(",
"InputStream",
"inputStream",
"=",
"input",
")",
"{",
"return",
"copyAndCloseOutput",
"(",
"inputStream",
","... | Copy input to output and close both the input and output streams before returning | [
"Copy",
"input",
"to",
"output",
"and",
"close",
"both",
"the",
"input",
"and",
"output",
"streams",
"before",
"returning"
] | train | https://github.com/medallia/Word2VecJava/blob/eb31fbb99ac6bbab82d7f807b3e2240edca50eb7/src/main/java/com/medallia/word2vec/util/IO.java#L58-L62 |
Chorus-bdd/Chorus | interpreter/chorus-remoting/src/main/java/org/chorusbdd/chorus/remoting/jmx/remotingmanager/ChorusHandlerJmxProxy.java | ChorusHandlerJmxProxy.invokeStep | public Object invokeStep(String remoteStepInvokerId, String stepTokenId, List<String> params) throws Exception {
"""
Calls the invoke Step method on the remote MBean. The current ChorusContext will be
serialized as part of this and marshalled to the remote bean.
@param remoteStepInvokerId the id of the step to... | java | public Object invokeStep(String remoteStepInvokerId, String stepTokenId, List<String> params) throws Exception {
try {
//call the remote method
Object[] args = {remoteStepInvokerId, stepTokenId, ChorusContext.getContext().getSnapshot(), params};
String[] signature = {"java.la... | [
"public",
"Object",
"invokeStep",
"(",
"String",
"remoteStepInvokerId",
",",
"String",
"stepTokenId",
",",
"List",
"<",
"String",
">",
"params",
")",
"throws",
"Exception",
"{",
"try",
"{",
"//call the remote method",
"Object",
"[",
"]",
"args",
"=",
"{",
"rem... | Calls the invoke Step method on the remote MBean. The current ChorusContext will be
serialized as part of this and marshalled to the remote bean.
@param remoteStepInvokerId the id of the step to call
@param params params to pass in the call | [
"Calls",
"the",
"invoke",
"Step",
"method",
"on",
"the",
"remote",
"MBean",
".",
"The",
"current",
"ChorusContext",
"will",
"be",
"serialized",
"as",
"part",
"of",
"this",
"and",
"marshalled",
"to",
"the",
"remote",
"bean",
"."
] | train | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-remoting/src/main/java/org/chorusbdd/chorus/remoting/jmx/remotingmanager/ChorusHandlerJmxProxy.java#L89-L106 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java | BaseNDArrayFactory.valueArrayOf | @Override
public INDArray valueArrayOf(long rows, long columns, double value) {
"""
Creates a row vector with the specified number of columns
@param rows the number of rows in the matrix
@param columns the columns of the ndarray
@param value the value to assign
@return the created ndarray
"""
... | java | @Override
public INDArray valueArrayOf(long rows, long columns, double value) {
INDArray create = createUninitialized(new long[] {rows, columns}, Nd4j.order());
create.assign(value);
return create;
} | [
"@",
"Override",
"public",
"INDArray",
"valueArrayOf",
"(",
"long",
"rows",
",",
"long",
"columns",
",",
"double",
"value",
")",
"{",
"INDArray",
"create",
"=",
"createUninitialized",
"(",
"new",
"long",
"[",
"]",
"{",
"rows",
",",
"columns",
"}",
",",
"... | Creates a row vector with the specified number of columns
@param rows the number of rows in the matrix
@param columns the columns of the ndarray
@param value the value to assign
@return the created ndarray | [
"Creates",
"a",
"row",
"vector",
"with",
"the",
"specified",
"number",
"of",
"columns"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java#L828-L833 |
oglimmer/utils | src/main/java/de/oglimmer/utils/date/DateHelper.java | DateHelper.formatDateDifference | public static String formatDateDifference(Date d1, Date d2) {
"""
Calculates a human readable date/time difference.
@param d1
a starting date
@param d2
an end date
@return a string which reads like x days, y hours, z minutes ...
"""
long[] td = DateHelper.getTimeDifference(d1, d2);
if (td[0] > 0) {
... | java | public static String formatDateDifference(Date d1, Date d2) {
long[] td = DateHelper.getTimeDifference(d1, d2);
if (td[0] > 0) {
return td[0] + " day(s), " + td[1] + " hour(s)";
}
if (td[1] > 0) {
return td[1] + " hour(s), " + td[2] + " minute(s)";
}
if (td[2] > 0) {
return td[2] + " minute(s), " +... | [
"public",
"static",
"String",
"formatDateDifference",
"(",
"Date",
"d1",
",",
"Date",
"d2",
")",
"{",
"long",
"[",
"]",
"td",
"=",
"DateHelper",
".",
"getTimeDifference",
"(",
"d1",
",",
"d2",
")",
";",
"if",
"(",
"td",
"[",
"0",
"]",
">",
"0",
")"... | Calculates a human readable date/time difference.
@param d1
a starting date
@param d2
an end date
@return a string which reads like x days, y hours, z minutes ... | [
"Calculates",
"a",
"human",
"readable",
"date",
"/",
"time",
"difference",
"."
] | train | https://github.com/oglimmer/utils/blob/bc46c57a24e60c9dbda4c73a810c163b0ce407ea/src/main/java/de/oglimmer/utils/date/DateHelper.java#L27-L39 |
pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/connect/ConnectionParams.java | ConnectionParams.fromConfig | public static ConnectionParams fromConfig(ConfigParams config, boolean configAsDefault) {
"""
Retrieves a single ConnectionParams from configuration parameters from
"connection" section. If "connections" section is present instead, then is
returns only the first connection element.
@param config Conn... | java | public static ConnectionParams fromConfig(ConfigParams config, boolean configAsDefault) {
List<ConnectionParams> connections = manyFromConfig(config, configAsDefault);
return connections.size() > 0 ? connections.get(0) : null;
} | [
"public",
"static",
"ConnectionParams",
"fromConfig",
"(",
"ConfigParams",
"config",
",",
"boolean",
"configAsDefault",
")",
"{",
"List",
"<",
"ConnectionParams",
">",
"connections",
"=",
"manyFromConfig",
"(",
"config",
",",
"configAsDefault",
")",
";",
"return",
... | Retrieves a single ConnectionParams from configuration parameters from
"connection" section. If "connections" section is present instead, then is
returns only the first connection element.
@param config ConnectionParams, containing a section named
"connection(s)".
@param configAsDefault boolean parameter for ... | [
"Retrieves",
"a",
"single",
"ConnectionParams",
"from",
"configuration",
"parameters",
"from",
"connection",
"section",
".",
"If",
"connections",
"section",
"is",
"present",
"instead",
"then",
"is",
"returns",
"only",
"the",
"first",
"connection",
"element",
"."
] | train | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/connect/ConnectionParams.java#L276-L279 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java | ExpressRouteCircuitsInner.listRoutesTableSummaryAsync | public Observable<ExpressRouteCircuitsRoutesTableSummaryListResultInner> listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
"""
Gets the currently advertised routes table summary associated with the express route circuit in a resource group.
@param... | java | public Observable<ExpressRouteCircuitsRoutesTableSummaryListResultInner> listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1... | [
"public",
"Observable",
"<",
"ExpressRouteCircuitsRoutesTableSummaryListResultInner",
">",
"listRoutesTableSummaryAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
",",
"String",
"peeringName",
",",
"String",
"devicePath",
")",
"{",
"return",
"listRo... | Gets the currently advertised routes table summary associated with the express route circuit in a resource group.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the express route circuit.
@param peeringName The name of the peering.
@param devicePath The path of the device.
@thr... | [
"Gets",
"the",
"currently",
"advertised",
"routes",
"table",
"summary",
"associated",
"with",
"the",
"express",
"route",
"circuit",
"in",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java#L1267-L1274 |
apache/reef | lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/DriverFiles.java | DriverFiles.copyTo | public void copyTo(final File destinationFolder) throws IOException {
"""
Copies this set of files to the destination folder given.
<p>
Will attempt to create symbolic links for the files to the destination
folder. If the filesystem does not support symbolic links or the user
does not have appropriate permiss... | java | public void copyTo(final File destinationFolder) throws IOException {
if (!destinationFolder.exists() && !destinationFolder.mkdirs()) {
LOG.log(Level.WARNING, "Failed to create [{0}]", destinationFolder.getAbsolutePath());
}
final File reefFolder = new File(destinationFolder, fileNames.getREEFFolderNa... | [
"public",
"void",
"copyTo",
"(",
"final",
"File",
"destinationFolder",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"destinationFolder",
".",
"exists",
"(",
")",
"&&",
"!",
"destinationFolder",
".",
"mkdirs",
"(",
")",
")",
"{",
"LOG",
".",
"log",
... | Copies this set of files to the destination folder given.
<p>
Will attempt to create symbolic links for the files to the destination
folder. If the filesystem does not support symbolic links or the user
does not have appropriate permissions, the entire file will be copied instead.
@param destinationFolder the folder ... | [
"Copies",
"this",
"set",
"of",
"files",
"to",
"the",
"destination",
"folder",
"given",
".",
"<p",
">",
"Will",
"attempt",
"to",
"create",
"symbolic",
"links",
"for",
"the",
"files",
"to",
"the",
"destination",
"folder",
".",
"If",
"the",
"filesystem",
"doe... | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/DriverFiles.java#L131-L158 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXMLNotEqual | public static void assertXMLNotEqual(String err, Document control,
Document test) {
"""
Assert that two XML documents are NOT similar
@param err Message to be displayed on assertion failure
@param control XML to be compared against
@param test XML to be tested
"""
... | java | public static void assertXMLNotEqual(String err, Document control,
Document test) {
Diff diff = new Diff(control, test);
assertXMLEqual(err, diff, false);
} | [
"public",
"static",
"void",
"assertXMLNotEqual",
"(",
"String",
"err",
",",
"Document",
"control",
",",
"Document",
"test",
")",
"{",
"Diff",
"diff",
"=",
"new",
"Diff",
"(",
"control",
",",
"test",
")",
";",
"assertXMLEqual",
"(",
"err",
",",
"diff",
",... | Assert that two XML documents are NOT similar
@param err Message to be displayed on assertion failure
@param control XML to be compared against
@param test XML to be tested | [
"Assert",
"that",
"two",
"XML",
"documents",
"are",
"NOT",
"similar"
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L342-L346 |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java | MOEADD.deleteCrowdIndiv_diff | public void deleteCrowdIndiv_diff(int crowdIdx, int curLocation, int nicheCount, S indiv) {
"""
delete one solution from the most crowded subregion, which is different from indiv's subregion.
just use indiv to replace the worst solution in that subregion
"""
// find the solution indices within this crowd... | java | public void deleteCrowdIndiv_diff(int crowdIdx, int curLocation, int nicheCount, S indiv) {
// find the solution indices within this crowdIdx subregion
ArrayList<Integer> indList = new ArrayList<>();
for (int i = 0; i < populationSize; i++) {
if (subregionIdx[crowdIdx][i] == 1) {
indList.add(... | [
"public",
"void",
"deleteCrowdIndiv_diff",
"(",
"int",
"crowdIdx",
",",
"int",
"curLocation",
",",
"int",
"nicheCount",
",",
"S",
"indiv",
")",
"{",
"// find the solution indices within this crowdIdx subregion",
"ArrayList",
"<",
"Integer",
">",
"indList",
"=",
"new",... | delete one solution from the most crowded subregion, which is different from indiv's subregion.
just use indiv to replace the worst solution in that subregion | [
"delete",
"one",
"solution",
"from",
"the",
"most",
"crowded",
"subregion",
"which",
"is",
"different",
"from",
"indiv",
"s",
"subregion",
".",
"just",
"use",
"indiv",
"to",
"replace",
"the",
"worst",
"solution",
"in",
"that",
"subregion"
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java#L1157-L1184 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGraph.java | ManagementGraph.getOutputVertex | public ManagementVertex getOutputVertex(final int stage, final int index) {
"""
Returns the output vertex with the specified index for the given stage.
@param stage
the index of the stage
@param index
the index of the output vertex to return
@return the output vertex with the specified index or <code>null</... | java | public ManagementVertex getOutputVertex(final int stage, final int index) {
if (stage >= this.stages.size()) {
return null;
}
return this.stages.get(stage).getOutputManagementVertex(index);
} | [
"public",
"ManagementVertex",
"getOutputVertex",
"(",
"final",
"int",
"stage",
",",
"final",
"int",
"index",
")",
"{",
"if",
"(",
"stage",
">=",
"this",
".",
"stages",
".",
"size",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"this",
".",
... | Returns the output vertex with the specified index for the given stage.
@param stage
the index of the stage
@param index
the index of the output vertex to return
@return the output vertex with the specified index or <code>null</code> if no output vertex with such an index
exists in that stage | [
"Returns",
"the",
"output",
"vertex",
"with",
"the",
"specified",
"index",
"for",
"the",
"given",
"stage",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGraph.java#L309-L316 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.missingConstructorException | private static NoSuchBeingException missingConstructorException(Class<?> clazz, Object... arguments) {
"""
Helper for missing constructor exception.
@param clazz constructor class,
@param arguments constructor arguments.
@return formatted exception.
"""
Type[] types = new Type[arguments.length];
... | java | private static NoSuchBeingException missingConstructorException(Class<?> clazz, Object... arguments)
{
Type[] types = new Type[arguments.length];
for(int i = 0; i < arguments.length; ++i) {
types[i] = arguments[i].getClass();
}
return new NoSuchBeingException("Missing constructor(%s) for |... | [
"private",
"static",
"NoSuchBeingException",
"missingConstructorException",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Object",
"...",
"arguments",
")",
"{",
"Type",
"[",
"]",
"types",
"=",
"new",
"Type",
"[",
"arguments",
".",
"length",
"]",
";",
"for",
... | Helper for missing constructor exception.
@param clazz constructor class,
@param arguments constructor arguments.
@return formatted exception. | [
"Helper",
"for",
"missing",
"constructor",
"exception",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L1406-L1413 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java | WorkflowsInner.createOrUpdateAsync | public Observable<WorkflowInner> createOrUpdateAsync(String resourceGroupName, String workflowName, WorkflowInner workflow) {
"""
Creates or updates a workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param workflow The workflow.
@throws IllegalArgumentExcept... | java | public Observable<WorkflowInner> createOrUpdateAsync(String resourceGroupName, String workflowName, WorkflowInner workflow) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, workflowName, workflow).map(new Func1<ServiceResponse<WorkflowInner>, WorkflowInner>() {
@Override
... | [
"public",
"Observable",
"<",
"WorkflowInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
",",
"WorkflowInner",
"workflow",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"wor... | Creates or updates a workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param workflow The workflow.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the WorkflowInner object | [
"Creates",
"or",
"updates",
"a",
"workflow",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java#L721-L728 |
MarkusBernhardt/xml-doclet | src/main/java/com/github/markusbernhardt/xmldoclet/XmlDoclet.java | XmlDoclet.parseCommandLine | public static CommandLine parseCommandLine(String[][] optionsArrayArray) {
"""
Parse the given options.
@param optionsArrayArray
The two dimensional array of options.
@return the parsed command line arguments.
"""
try {
List<String> argumentList = new ArrayList<String>();
for (String[] optionsArra... | java | public static CommandLine parseCommandLine(String[][] optionsArrayArray) {
try {
List<String> argumentList = new ArrayList<String>();
for (String[] optionsArray : optionsArrayArray) {
argumentList.addAll(Arrays.asList(optionsArray));
}
CommandLineParser commandLineParser = new BasicParser() {
@Ov... | [
"public",
"static",
"CommandLine",
"parseCommandLine",
"(",
"String",
"[",
"]",
"[",
"]",
"optionsArrayArray",
")",
"{",
"try",
"{",
"List",
"<",
"String",
">",
"argumentList",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"Stri... | Parse the given options.
@param optionsArrayArray
The two dimensional array of options.
@return the parsed command line arguments. | [
"Parse",
"the",
"given",
"options",
"."
] | train | https://github.com/MarkusBernhardt/xml-doclet/blob/6bb0cc1ff82b2e20787b93252c6b294d0eb31622/src/main/java/com/github/markusbernhardt/xmldoclet/XmlDoclet.java#L232-L260 |
pravega/pravega | common/src/main/java/io/pravega/common/util/BitConverter.java | BitConverter.writeShort | public static int writeShort(byte[] target, int offset, short value) {
"""
Writes the given 16-bit Short to the given byte array at the given offset.
@param target The byte array to write to.
@param offset The offset within the byte array to write at.
@param value The value to write.
@return The number of b... | java | public static int writeShort(byte[] target, int offset, short value) {
target[offset] = (byte) (value >>> 8 & 255);
target[offset + 1] = (byte) (value & 255);
return Short.BYTES;
} | [
"public",
"static",
"int",
"writeShort",
"(",
"byte",
"[",
"]",
"target",
",",
"int",
"offset",
",",
"short",
"value",
")",
"{",
"target",
"[",
"offset",
"]",
"=",
"(",
"byte",
")",
"(",
"value",
">>>",
"8",
"&",
"255",
")",
";",
"target",
"[",
"... | Writes the given 16-bit Short to the given byte array at the given offset.
@param target The byte array to write to.
@param offset The offset within the byte array to write at.
@param value The value to write.
@return The number of bytes written. | [
"Writes",
"the",
"given",
"16",
"-",
"bit",
"Short",
"to",
"the",
"given",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L42-L46 |
infinispan/infinispan | counter/src/main/java/org/infinispan/counter/impl/entries/CounterValue.java | CounterValue.newCounterValue | public static CounterValue newCounterValue(long currentValue, CounterConfiguration configuration) {
"""
Creates the initial {@link CounterValue} based on {@code currentValue} and the {@link CounterConfiguration}.
@param currentValue the current counter's value.
@param configuration the configuration.
@return... | java | public static CounterValue newCounterValue(long currentValue, CounterConfiguration configuration) {
return configuration.type() == CounterType.BOUNDED_STRONG ?
newCounterValue(currentValue, configuration.lowerBound(), configuration.upperBound()) :
newCounterValue(currentValue);
} | [
"public",
"static",
"CounterValue",
"newCounterValue",
"(",
"long",
"currentValue",
",",
"CounterConfiguration",
"configuration",
")",
"{",
"return",
"configuration",
".",
"type",
"(",
")",
"==",
"CounterType",
".",
"BOUNDED_STRONG",
"?",
"newCounterValue",
"(",
"cu... | Creates the initial {@link CounterValue} based on {@code currentValue} and the {@link CounterConfiguration}.
@param currentValue the current counter's value.
@param configuration the configuration.
@return the {@link CounterValue}. | [
"Creates",
"the",
"initial",
"{",
"@link",
"CounterValue",
"}",
"based",
"on",
"{",
"@code",
"currentValue",
"}",
"and",
"the",
"{",
"@link",
"CounterConfiguration",
"}",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/counter/src/main/java/org/infinispan/counter/impl/entries/CounterValue.java#L96-L100 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java | ConstantsSummaryBuilder.buildPackageHeader | public void buildPackageHeader(XMLNode node, Content summariesTree) {
"""
Build the header for the given package.
@param node the XML element that specifies which components to document
@param summariesTree the tree to which the package header will be added
"""
PackageElement abbrevPkg = configurat... | java | public void buildPackageHeader(XMLNode node, Content summariesTree) {
PackageElement abbrevPkg = configuration.workArounds.getAbbreviatedPackageElement(currentPackage);
if (!printedPackageHeaders.contains(abbrevPkg)) {
writer.addPackageName(currentPackage, summariesTree, first);
... | [
"public",
"void",
"buildPackageHeader",
"(",
"XMLNode",
"node",
",",
"Content",
"summariesTree",
")",
"{",
"PackageElement",
"abbrevPkg",
"=",
"configuration",
".",
"workArounds",
".",
"getAbbreviatedPackageElement",
"(",
"currentPackage",
")",
";",
"if",
"(",
"!",
... | Build the header for the given package.
@param node the XML element that specifies which components to document
@param summariesTree the tree to which the package header will be added | [
"Build",
"the",
"header",
"for",
"the",
"given",
"package",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java#L205-L211 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java | PolicyEventsInner.listQueryResultsForResourceGroupLevelPolicyAssignmentAsync | public Observable<PolicyEventsQueryResultsInner> listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(String subscriptionId, String resourceGroupName, String policyAssignmentName, QueryOptions queryOptions) {
"""
Queries policy events for the resource group level policy assignment.
@param subscriptionId M... | java | public Observable<PolicyEventsQueryResultsInner> listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(String subscriptionId, String resourceGroupName, String policyAssignmentName, QueryOptions queryOptions) {
return listQueryResultsForResourceGroupLevelPolicyAssignmentWithServiceResponseAsync(subscription... | [
"public",
"Observable",
"<",
"PolicyEventsQueryResultsInner",
">",
"listQueryResultsForResourceGroupLevelPolicyAssignmentAsync",
"(",
"String",
"subscriptionId",
",",
"String",
"resourceGroupName",
",",
"String",
"policyAssignmentName",
",",
"QueryOptions",
"queryOptions",
")",
... | Queries policy events for the resource group level policy assignment.
@param subscriptionId Microsoft Azure subscription ID.
@param resourceGroupName Resource group name.
@param policyAssignmentName Policy assignment name.
@param queryOptions Additional parameters for the operation
@throws IllegalArgumentException thr... | [
"Queries",
"policy",
"events",
"for",
"the",
"resource",
"group",
"level",
"policy",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java#L1610-L1617 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java | KMLGeometry.appendExtrude | private static void appendExtrude(ExtrudeMode extrude, StringBuilder sb) {
"""
Append the extrude value
Syntax :
<extrude>0</extrude>
@param extrude
@param sb
"""
if (extrude.equals(ExtrudeMode.TRUE)) {
sb.append("<extrude>").append(1).append("</extrude>");
} else if (extr... | java | private static void appendExtrude(ExtrudeMode extrude, StringBuilder sb) {
if (extrude.equals(ExtrudeMode.TRUE)) {
sb.append("<extrude>").append(1).append("</extrude>");
} else if (extrude.equals(ExtrudeMode.FALSE)) {
sb.append("<extrude>").append(0).append("</extrude>");
... | [
"private",
"static",
"void",
"appendExtrude",
"(",
"ExtrudeMode",
"extrude",
",",
"StringBuilder",
"sb",
")",
"{",
"if",
"(",
"extrude",
".",
"equals",
"(",
"ExtrudeMode",
".",
"TRUE",
")",
")",
"{",
"sb",
".",
"append",
"(",
"\"<extrude>\"",
")",
".",
"... | Append the extrude value
Syntax :
<extrude>0</extrude>
@param extrude
@param sb | [
"Append",
"the",
"extrude",
"value"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java#L307-L313 |
Azure/azure-sdk-for-java | recoveryservices/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/v2016_06_01/implementation/UsagesInner.java | UsagesInner.listByVaults | public List<VaultUsageInner> listByVaults(String resourceGroupName, String vaultName) {
"""
Fetches the usages of the vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@param vaultName The name of the recovery services vault.
@throws IllegalArgumentEx... | java | public List<VaultUsageInner> listByVaults(String resourceGroupName, String vaultName) {
return listByVaultsWithServiceResponseAsync(resourceGroupName, vaultName).toBlocking().single().body();
} | [
"public",
"List",
"<",
"VaultUsageInner",
">",
"listByVaults",
"(",
"String",
"resourceGroupName",
",",
"String",
"vaultName",
")",
"{",
"return",
"listByVaultsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vaultName",
")",
".",
"toBlocking",
"(",
")",
"... | Fetches the usages of the vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@param vaultName The name of the recovery services vault.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is reje... | [
"Fetches",
"the",
"usages",
"of",
"the",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/v2016_06_01/implementation/UsagesInner.java#L71-L73 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddressSection.java | IPAddressSection.matchesWithMask | public boolean matchesWithMask(IPAddressSection other, IPAddressSection mask) {
"""
Applies the mask to this address section and then compares values with the given address section
@param mask
@param other
@return
"""
checkMaskSectionCount(mask);
checkSectionCount(other);
int divCount = getSegmentCo... | java | public boolean matchesWithMask(IPAddressSection other, IPAddressSection mask) {
checkMaskSectionCount(mask);
checkSectionCount(other);
int divCount = getSegmentCount();
for(int i = 0; i < divCount; i++) {
IPAddressSegment div = getSegment(i);
IPAddressSegment maskSegment = mask.getSegment(i);
IPAddress... | [
"public",
"boolean",
"matchesWithMask",
"(",
"IPAddressSection",
"other",
",",
"IPAddressSection",
"mask",
")",
"{",
"checkMaskSectionCount",
"(",
"mask",
")",
";",
"checkSectionCount",
"(",
"other",
")",
";",
"int",
"divCount",
"=",
"getSegmentCount",
"(",
")",
... | Applies the mask to this address section and then compares values with the given address section
@param mask
@param other
@return | [
"Applies",
"the",
"mask",
"to",
"this",
"address",
"section",
"and",
"then",
"compares",
"values",
"with",
"the",
"given",
"address",
"section"
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddressSection.java#L1824-L1840 |
JM-Lab/utils-java9 | src/main/java/kr/jm/utils/helper/JMJson.java | JMJson.withBytes | public static <T> T withBytes(byte[] bytes, Class<T> c) {
"""
With bytes t.
@param <T> the type parameter
@param bytes the bytes
@param c the c
@return the t
"""
try {
return jsonMapper.readValue(bytes, c);
} catch (Exception e) {
return JMExceptionManager.ha... | java | public static <T> T withBytes(byte[] bytes, Class<T> c) {
try {
return jsonMapper.readValue(bytes, c);
} catch (Exception e) {
return JMExceptionManager.handleExceptionAndReturnNull(log, e,
"withBytes", new String(bytes));
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withBytes",
"(",
"byte",
"[",
"]",
"bytes",
",",
"Class",
"<",
"T",
">",
"c",
")",
"{",
"try",
"{",
"return",
"jsonMapper",
".",
"readValue",
"(",
"bytes",
",",
"c",
")",
";",
"}",
"catch",
"(",
"Exception... | With bytes t.
@param <T> the type parameter
@param bytes the bytes
@param c the c
@return the t | [
"With",
"bytes",
"t",
"."
] | train | https://github.com/JM-Lab/utils-java9/blob/ee80235b2760396a616cf7563cbdc98d4affe8e1/src/main/java/kr/jm/utils/helper/JMJson.java#L142-L149 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java | MapFixture.setDoubleValueForIn | public void setDoubleValueForIn(double value, String name, Map<String, Object> map) {
"""
Stores double value in map.
@param value value to be passed.
@param name name to use this value for.
@param map map to store value in.
"""
setValueForIn(Double.valueOf(value), name, map);
} | java | public void setDoubleValueForIn(double value, String name, Map<String, Object> map) {
setValueForIn(Double.valueOf(value), name, map);
} | [
"public",
"void",
"setDoubleValueForIn",
"(",
"double",
"value",
",",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"setValueForIn",
"(",
"Double",
".",
"valueOf",
"(",
"value",
")",
",",
"name",
",",
"map",
")",
";"... | Stores double value in map.
@param value value to be passed.
@param name name to use this value for.
@param map map to store value in. | [
"Stores",
"double",
"value",
"in",
"map",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java#L65-L67 |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java | Reflection.setValue | public static void setValue(Object instance, String fieldName, Object value) {
"""
Sets the value of a field of an object instance via reflection
@param instance to inspect
@param fieldName name of field to set
@param value the value to set
"""
try {
Field f = findFieldRecursively(ins... | java | public static void setValue(Object instance, String fieldName, Object value) {
try {
Field f = findFieldRecursively(instance.getClass(), fieldName);
if (f == null)
throw new NoSuchMethodException("Cannot find field " + fieldName + " on " + instance.getClass() + " or super... | [
"public",
"static",
"void",
"setValue",
"(",
"Object",
"instance",
",",
"String",
"fieldName",
",",
"Object",
"value",
")",
"{",
"try",
"{",
"Field",
"f",
"=",
"findFieldRecursively",
"(",
"instance",
".",
"getClass",
"(",
")",
",",
"fieldName",
")",
";",
... | Sets the value of a field of an object instance via reflection
@param instance to inspect
@param fieldName name of field to set
@param value the value to set | [
"Sets",
"the",
"value",
"of",
"a",
"field",
"of",
"an",
"object",
"instance",
"via",
"reflection"
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java#L211-L221 |
hawkular/hawkular-apm | client/collector/src/main/java/org/hawkular/apm/client/collector/internal/DefaultTraceCollector.java | DefaultTraceCollector.processOutContent | protected void processOutContent(String location, FragmentBuilder builder, int hashCode) {
"""
This method processes the out content if available.
@param location The instrumentation location
@param builder The builder
@param hashCode The hash code, or -1 to ignore the hash code
"""
if (builder.is... | java | protected void processOutContent(String location, FragmentBuilder builder, int hashCode) {
if (builder.isOutBufferActive(hashCode)) {
processOut(location, null, builder.getOutData(hashCode));
} else if (log.isLoggable(Level.FINEST)) {
log.finest("processOutContent: location=[" + ... | [
"protected",
"void",
"processOutContent",
"(",
"String",
"location",
",",
"FragmentBuilder",
"builder",
",",
"int",
"hashCode",
")",
"{",
"if",
"(",
"builder",
".",
"isOutBufferActive",
"(",
"hashCode",
")",
")",
"{",
"processOut",
"(",
"location",
",",
"null"... | This method processes the out content if available.
@param location The instrumentation location
@param builder The builder
@param hashCode The hash code, or -1 to ignore the hash code | [
"This",
"method",
"processes",
"the",
"out",
"content",
"if",
"available",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/client/collector/src/main/java/org/hawkular/apm/client/collector/internal/DefaultTraceCollector.java#L1002-L1009 |
goldmansachs/reladomo | reladomogen/src/main/java/com/gs/fw/common/mithra/generator/queryparser/JJTMithraQLState.java | JJTMithraQLState.closeNodeScope | void closeNodeScope(Node n, int num) {
"""
/* A definite node is constructed from a specified number of
children. That number of nodes are popped from the stack and
made the children of the definite node. Then the definite node
is pushed on to the stack.
"""
mk = ((Integer)marks.pop()).intValue();
... | java | void closeNodeScope(Node n, int num) {
mk = ((Integer)marks.pop()).intValue();
while (num-- > 0) {
Node c = popNode();
c.jjtSetParent(n);
n.jjtAddChild(c, num);
}
n.jjtClose();
pushNode(n);
node_created = true;
} | [
"void",
"closeNodeScope",
"(",
"Node",
"n",
",",
"int",
"num",
")",
"{",
"mk",
"=",
"(",
"(",
"Integer",
")",
"marks",
".",
"pop",
"(",
")",
")",
".",
"intValue",
"(",
")",
";",
"while",
"(",
"num",
"--",
">",
"0",
")",
"{",
"Node",
"c",
"=",... | /* A definite node is constructed from a specified number of
children. That number of nodes are popped from the stack and
made the children of the definite node. Then the definite node
is pushed on to the stack. | [
"/",
"*",
"A",
"definite",
"node",
"is",
"constructed",
"from",
"a",
"specified",
"number",
"of",
"children",
".",
"That",
"number",
"of",
"nodes",
"are",
"popped",
"from",
"the",
"stack",
"and",
"made",
"the",
"children",
"of",
"the",
"definite",
"node",
... | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomogen/src/main/java/com/gs/fw/common/mithra/generator/queryparser/JJTMithraQLState.java#L104-L114 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/concurrency/InterruptionChecker.java | InterruptionChecker.getCause | public static Throwable getCause(final Throwable throwable) {
"""
Get the cause of an {@link ExecutionException}.
@param throwable
the Throwable
@return the cause
"""
// Unwrap possibly-nested ExecutionExceptions to get to root cause
Throwable cause = throwable;
while (cause instan... | java | public static Throwable getCause(final Throwable throwable) {
// Unwrap possibly-nested ExecutionExceptions to get to root cause
Throwable cause = throwable;
while (cause instanceof ExecutionException) {
cause = cause.getCause();
}
return cause != null ? cause : new E... | [
"public",
"static",
"Throwable",
"getCause",
"(",
"final",
"Throwable",
"throwable",
")",
"{",
"// Unwrap possibly-nested ExecutionExceptions to get to root cause",
"Throwable",
"cause",
"=",
"throwable",
";",
"while",
"(",
"cause",
"instanceof",
"ExecutionException",
")",
... | Get the cause of an {@link ExecutionException}.
@param throwable
the Throwable
@return the cause | [
"Get",
"the",
"cause",
"of",
"an",
"{",
"@link",
"ExecutionException",
"}",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/concurrency/InterruptionChecker.java#L82-L89 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java | DateUtils.addDays | public static Date addDays(Date date, int numberOfDays) {
"""
Adds a number of days to a date returning a new object.
The original date object is unchanged.
@param date the date, not null
@param numberOfDays the amount to add, may be negative
@return the new date object with the amount added
"""
... | java | public static Date addDays(Date date, int numberOfDays) {
return Date.from(date.toInstant().plus(numberOfDays, ChronoUnit.DAYS));
} | [
"public",
"static",
"Date",
"addDays",
"(",
"Date",
"date",
",",
"int",
"numberOfDays",
")",
"{",
"return",
"Date",
".",
"from",
"(",
"date",
".",
"toInstant",
"(",
")",
".",
"plus",
"(",
"numberOfDays",
",",
"ChronoUnit",
".",
"DAYS",
")",
")",
";",
... | Adds a number of days to a date returning a new object.
The original date object is unchanged.
@param date the date, not null
@param numberOfDays the amount to add, may be negative
@return the new date object with the amount added | [
"Adds",
"a",
"number",
"of",
"days",
"to",
"a",
"date",
"returning",
"a",
"new",
"object",
".",
"The",
"original",
"date",
"object",
"is",
"unchanged",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java#L297-L299 |
mnlipp/jgrapes | org.jgrapes.http/src/org/jgrapes/http/ResourcePattern.java | ResourcePattern.removeSegments | public static String removeSegments(String path, int segments) {
"""
Removes the given number of segments (and their trailing slashes)
from the beginning of the path. Segments may be empty. This implies
that invoking this method with a path that starts with a
slash, the first removed segment is the empty segmen... | java | public static String removeSegments(String path, int segments) {
return PathSpliterator.stream(path)
.skip(segments).collect(Collectors.joining("/"));
} | [
"public",
"static",
"String",
"removeSegments",
"(",
"String",
"path",
",",
"int",
"segments",
")",
"{",
"return",
"PathSpliterator",
".",
"stream",
"(",
"path",
")",
".",
"skip",
"(",
"segments",
")",
".",
"collect",
"(",
"Collectors",
".",
"joining",
"("... | Removes the given number of segments (and their trailing slashes)
from the beginning of the path. Segments may be empty. This implies
that invoking this method with a path that starts with a
slash, the first removed segment is the empty segment
preceding the slash and the starting slash. Put differently,
invoking this ... | [
"Removes",
"the",
"given",
"number",
"of",
"segments",
"(",
"and",
"their",
"trailing",
"slashes",
")",
"from",
"the",
"beginning",
"of",
"the",
"path",
".",
"Segments",
"may",
"be",
"empty",
".",
"This",
"implies",
"that",
"invoking",
"this",
"method",
"w... | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.http/src/org/jgrapes/http/ResourcePattern.java#L303-L306 |
samskivert/samskivert | src/main/java/com/samskivert/util/PropertiesUtil.java | PropertiesUtil.extractSubProperties | protected static void extractSubProperties (Properties source, Properties dest, String prefix) {
"""
A helper function used by the {@link #getSubProperties} methods.
"""
// extend the prefix to contain a dot
prefix = prefix + ".";
int preflen = prefix.length();
// scan the sour... | java | protected static void extractSubProperties (Properties source, Properties dest, String prefix)
{
// extend the prefix to contain a dot
prefix = prefix + ".";
int preflen = prefix.length();
// scan the source properties
Enumeration<?> names = source.propertyNames();
w... | [
"protected",
"static",
"void",
"extractSubProperties",
"(",
"Properties",
"source",
",",
"Properties",
"dest",
",",
"String",
"prefix",
")",
"{",
"// extend the prefix to contain a dot",
"prefix",
"=",
"prefix",
"+",
"\".\"",
";",
"int",
"preflen",
"=",
"prefix",
... | A helper function used by the {@link #getSubProperties} methods. | [
"A",
"helper",
"function",
"used",
"by",
"the",
"{"
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/PropertiesUtil.java#L137-L154 |
apache/incubator-druid | extensions-contrib/cloudfiles-extensions/src/main/java/org/apache/druid/storage/cloudfiles/CloudFilesUtils.java | CloudFilesUtils.retryCloudFilesOperation | public static <T> T retryCloudFilesOperation(Task<T> f, final int maxTries) throws Exception {
"""
Retries CloudFiles operations that fail due to io-related exceptions.
"""
return RetryUtils.retry(f, CLOUDFILESRETRY, maxTries);
} | java | public static <T> T retryCloudFilesOperation(Task<T> f, final int maxTries) throws Exception
{
return RetryUtils.retry(f, CLOUDFILESRETRY, maxTries);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"retryCloudFilesOperation",
"(",
"Task",
"<",
"T",
">",
"f",
",",
"final",
"int",
"maxTries",
")",
"throws",
"Exception",
"{",
"return",
"RetryUtils",
".",
"retry",
"(",
"f",
",",
"CLOUDFILESRETRY",
",",
"maxTries",
... | Retries CloudFiles operations that fail due to io-related exceptions. | [
"Retries",
"CloudFiles",
"operations",
"that",
"fail",
"due",
"to",
"io",
"-",
"related",
"exceptions",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-contrib/cloudfiles-extensions/src/main/java/org/apache/druid/storage/cloudfiles/CloudFilesUtils.java#L52-L55 |
real-logic/agrona | agrona/src/main/java/org/agrona/concurrent/status/CountersManager.java | CountersManager.newCounter | public AtomicCounter newCounter(final String label, final int typeId, final Consumer<MutableDirectBuffer> keyFunc) {
"""
Allocate a counter record and wrap it with a new {@link AtomicCounter} for use.
@param label to describe the counter.
@param typeId for the type of counter.
@param keyFunc for setting th... | java | public AtomicCounter newCounter(final String label, final int typeId, final Consumer<MutableDirectBuffer> keyFunc)
{
return new AtomicCounter(valuesBuffer, allocate(label, typeId, keyFunc), this);
} | [
"public",
"AtomicCounter",
"newCounter",
"(",
"final",
"String",
"label",
",",
"final",
"int",
"typeId",
",",
"final",
"Consumer",
"<",
"MutableDirectBuffer",
">",
"keyFunc",
")",
"{",
"return",
"new",
"AtomicCounter",
"(",
"valuesBuffer",
",",
"allocate",
"(",
... | Allocate a counter record and wrap it with a new {@link AtomicCounter} for use.
@param label to describe the counter.
@param typeId for the type of counter.
@param keyFunc for setting the key value for the counter.
@return a newly allocated {@link AtomicCounter} | [
"Allocate",
"a",
"counter",
"record",
"and",
"wrap",
"it",
"with",
"a",
"new",
"{",
"@link",
"AtomicCounter",
"}",
"for",
"use",
"."
] | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/concurrent/status/CountersManager.java#L320-L323 |
google/flatbuffers | java/com/google/flatbuffers/Table.java | Table.compareStrings | protected static int compareStrings(int offset_1, int offset_2, ByteBuffer bb) {
"""
Compare two strings in the buffer.
@param offset_1 An 'int' index of the first string into the bb.
@param offset_2 An 'int' index of the second string into the bb.
@param bb A {@code ByteBuffer} to get the strings.
"""
... | java | protected static int compareStrings(int offset_1, int offset_2, ByteBuffer bb) {
offset_1 += bb.getInt(offset_1);
offset_2 += bb.getInt(offset_2);
int len_1 = bb.getInt(offset_1);
int len_2 = bb.getInt(offset_2);
int startPos_1 = offset_1 + SIZEOF_INT;
int startPos_2 = offset_2 + SIZEOF_INT;
... | [
"protected",
"static",
"int",
"compareStrings",
"(",
"int",
"offset_1",
",",
"int",
"offset_2",
",",
"ByteBuffer",
"bb",
")",
"{",
"offset_1",
"+=",
"bb",
".",
"getInt",
"(",
"offset_1",
")",
";",
"offset_2",
"+=",
"bb",
".",
"getInt",
"(",
"offset_2",
"... | Compare two strings in the buffer.
@param offset_1 An 'int' index of the first string into the bb.
@param offset_2 An 'int' index of the second string into the bb.
@param bb A {@code ByteBuffer} to get the strings. | [
"Compare",
"two",
"strings",
"in",
"the",
"buffer",
"."
] | train | https://github.com/google/flatbuffers/blob/6cc30b3272d79c85db7d4871ac0aa69541dc89de/java/com/google/flatbuffers/Table.java#L231-L244 |
LearnLib/automatalib | util/src/main/java/net/automatalib/util/minimizer/Minimizer.java | Minimizer.updateBlockReferences | private static <S, L> void updateBlockReferences(Block<S, L> block) {
"""
Sets the blockReference-attribute of each state in the collection to the corresponding ElementReference of the
collection.
"""
UnorderedCollection<State<S, L>> states = block.getStates();
for (ElementReference ref : stat... | java | private static <S, L> void updateBlockReferences(Block<S, L> block) {
UnorderedCollection<State<S, L>> states = block.getStates();
for (ElementReference ref : states.references()) {
State<S, L> state = states.get(ref);
state.setBlockReference(ref);
state.setBlock(bloc... | [
"private",
"static",
"<",
"S",
",",
"L",
">",
"void",
"updateBlockReferences",
"(",
"Block",
"<",
"S",
",",
"L",
">",
"block",
")",
"{",
"UnorderedCollection",
"<",
"State",
"<",
"S",
",",
"L",
">",
">",
"states",
"=",
"block",
".",
"getStates",
"(",... | Sets the blockReference-attribute of each state in the collection to the corresponding ElementReference of the
collection. | [
"Sets",
"the",
"blockReference",
"-",
"attribute",
"of",
"each",
"state",
"in",
"the",
"collection",
"to",
"the",
"corresponding",
"ElementReference",
"of",
"the",
"collection",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/util/src/main/java/net/automatalib/util/minimizer/Minimizer.java#L442-L449 |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSURLHelper.java | CSSURLHelper.getEscapedCSSURL | @Nonnull
@Nonempty
public static String getEscapedCSSURL (@Nonnull final String sURL, final char cQuoteChar) {
"""
Internal method to escape a CSS URL. Because this method is only called for
quoted URLs, only the quote character itself needs to be quoted.
@param sURL
The URL to be escaped. May not be <cod... | java | @Nonnull
@Nonempty
public static String getEscapedCSSURL (@Nonnull final String sURL, final char cQuoteChar)
{
ValueEnforcer.notNull (sURL, "URL");
if (sURL.indexOf (cQuoteChar) < 0 && sURL.indexOf (CSSParseHelper.URL_ESCAPE_CHAR) < 0)
{
// Found nothing to quote
return sURL;
}
f... | [
"@",
"Nonnull",
"@",
"Nonempty",
"public",
"static",
"String",
"getEscapedCSSURL",
"(",
"@",
"Nonnull",
"final",
"String",
"sURL",
",",
"final",
"char",
"cQuoteChar",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sURL",
",",
"\"URL\"",
")",
";",
"if",
"... | Internal method to escape a CSS URL. Because this method is only called for
quoted URLs, only the quote character itself needs to be quoted.
@param sURL
The URL to be escaped. May not be <code>null</code>.
@param cQuoteChar
The quote char that is used. Either '\'' or '"'
@return The escaped string. Never <code>null</c... | [
"Internal",
"method",
"to",
"escape",
"a",
"CSS",
"URL",
".",
"Because",
"this",
"method",
"is",
"only",
"called",
"for",
"quoted",
"URLs",
"only",
"the",
"quote",
"character",
"itself",
"needs",
"to",
"be",
"quoted",
"."
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSURLHelper.java#L158-L179 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_save_config.java | ns_save_config.add | public static ns_save_config add(nitro_service client, ns_save_config resource) throws Exception {
"""
<pre>
Use this operation to save configuration on NS Instance(s).
</pre>
"""
resource.validate("add");
return ((ns_save_config[]) resource.perform_operation(client, "add"))[0];
} | java | public static ns_save_config add(nitro_service client, ns_save_config resource) throws Exception
{
resource.validate("add");
return ((ns_save_config[]) resource.perform_operation(client, "add"))[0];
} | [
"public",
"static",
"ns_save_config",
"add",
"(",
"nitro_service",
"client",
",",
"ns_save_config",
"resource",
")",
"throws",
"Exception",
"{",
"resource",
".",
"validate",
"(",
"\"add\"",
")",
";",
"return",
"(",
"(",
"ns_save_config",
"[",
"]",
")",
"resour... | <pre>
Use this operation to save configuration on NS Instance(s).
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"save",
"configuration",
"on",
"NS",
"Instance",
"(",
"s",
")",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_save_config.java#L85-L89 |
landawn/AbacusUtil | src/com/landawn/abacus/util/ExceptionalStream.java | ExceptionalStream.rows | public static <T> ExceptionalStream<T, SQLException> rows(final Class<T> targetClass, final ResultSet resultSet) {
"""
It's user's responsibility to close the input <code>resultSet</code> after the stream is finished.
@param targetClass Array/List/Map or Entity with getter/setter methods.
@param resultSet
@re... | java | public static <T> ExceptionalStream<T, SQLException> rows(final Class<T> targetClass, final ResultSet resultSet) {
N.checkArgNotNull(targetClass, "targetClass");
N.checkArgNotNull(resultSet, "resultSet");
final Try.BiFunction<ResultSet, List<String>, T, SQLException> recordGetter = new Try.... | [
"public",
"static",
"<",
"T",
">",
"ExceptionalStream",
"<",
"T",
",",
"SQLException",
">",
"rows",
"(",
"final",
"Class",
"<",
"T",
">",
"targetClass",
",",
"final",
"ResultSet",
"resultSet",
")",
"{",
"N",
".",
"checkArgNotNull",
"(",
"targetClass",
",",... | It's user's responsibility to close the input <code>resultSet</code> after the stream is finished.
@param targetClass Array/List/Map or Entity with getter/setter methods.
@param resultSet
@return | [
"It",
"s",
"user",
"s",
"responsibility",
"to",
"close",
"the",
"input",
"<code",
">",
"resultSet<",
"/",
"code",
">",
"after",
"the",
"stream",
"is",
"finished",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/ExceptionalStream.java#L530-L544 |
ihaolin/session | session-redis/src/main/java/me/hao0/session/redis/RedisSessionManager.java | RedisSessionManager.loadById | public Map<String, Object> loadById(String id) {
"""
load session by id
@param id session id
@return session map object
"""
final String sid = sessionPrefix + ":" + id;
try {
return this.executor.execute(new RedisCallback<Map<String, Object>>() {
public Map<String,... | java | public Map<String, Object> loadById(String id) {
final String sid = sessionPrefix + ":" + id;
try {
return this.executor.execute(new RedisCallback<Map<String, Object>>() {
public Map<String, Object> execute(Jedis jedis) {
String session = jedis.get(sid);
... | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"loadById",
"(",
"String",
"id",
")",
"{",
"final",
"String",
"sid",
"=",
"sessionPrefix",
"+",
"\":\"",
"+",
"id",
";",
"try",
"{",
"return",
"this",
".",
"executor",
".",
"execute",
"(",
"new",
"R... | load session by id
@param id session id
@return session map object | [
"load",
"session",
"by",
"id"
] | train | https://github.com/ihaolin/session/blob/322c3a9f47b305a39345135fa8163dd7e065b4f8/session-redis/src/main/java/me/hao0/session/redis/RedisSessionManager.java#L109-L125 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201808/reportservice/RunInventoryReport.java | RunInventoryReport.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws IOException, InterruptedException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws IOException, InterruptedException {
// Get the ReportService.
ReportServiceInterface reportService =
adManagerServices.get(session, ReportServiceInterface.class);
// Get the NetworkService.
... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"// Get the ReportService.",
"ReportServiceInterface",
"reportService",
"=",
"adManager... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors.
@throws IOException if the report's contents could not be written to a temp... | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201808/reportservice/RunInventoryReport.java#L67-L131 |
twilio/twilio-java | src/main/java/com/twilio/base/Page.java | Page.getNextPageUrl | public String getNextPageUrl(String domain, String region) {
"""
Generate next page url for a list result.
@param domain domain to use
@param region region to use
@return the next page url
"""
if (nextPageUrl != null) {
return nextPageUrl;
}
return urlFromUri(domain, r... | java | public String getNextPageUrl(String domain, String region) {
if (nextPageUrl != null) {
return nextPageUrl;
}
return urlFromUri(domain, region, nextPageUri);
} | [
"public",
"String",
"getNextPageUrl",
"(",
"String",
"domain",
",",
"String",
"region",
")",
"{",
"if",
"(",
"nextPageUrl",
"!=",
"null",
")",
"{",
"return",
"nextPageUrl",
";",
"}",
"return",
"urlFromUri",
"(",
"domain",
",",
"region",
",",
"nextPageUri",
... | Generate next page url for a list result.
@param domain domain to use
@param region region to use
@return the next page url | [
"Generate",
"next",
"page",
"url",
"for",
"a",
"list",
"result",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/base/Page.java#L68-L74 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/factories/SecretKeyFactoryExtensions.java | SecretKeyFactoryExtensions.newSecretKeySpec | public static SecretKeySpec newSecretKeySpec(final String algorithm, final int keyLength)
throws NoSuchAlgorithmException {
"""
Factory method for creating a new {@link SecretKeySpec} from the given algorithm and the
given key length.
@param algorithm
the algorithm
@param keyLength
the key length
@return... | java | public static SecretKeySpec newSecretKeySpec(final String algorithm, final int keyLength)
throws NoSuchAlgorithmException
{
final KeyGenerator keyGenerator = KeyGenerator.getInstance(algorithm);
keyGenerator.init(keyLength);
final SecretKey secretKey = keyGenerator.generateKey();
final byte[] secretKeyEncode... | [
"public",
"static",
"SecretKeySpec",
"newSecretKeySpec",
"(",
"final",
"String",
"algorithm",
",",
"final",
"int",
"keyLength",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"final",
"KeyGenerator",
"keyGenerator",
"=",
"KeyGenerator",
".",
"getInstance",
"(",
"algo... | Factory method for creating a new {@link SecretKeySpec} from the given algorithm and the
given key length.
@param algorithm
the algorithm
@param keyLength
the key length
@return the new {@link SecretKeySpec} from the given algorithm and the given key length.
@throws NoSuchAlgorithmException
is thrown if instantiation ... | [
"Factory",
"method",
"for",
"creating",
"a",
"new",
"{",
"@link",
"SecretKeySpec",
"}",
"from",
"the",
"given",
"algorithm",
"and",
"the",
"given",
"key",
"length",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/factories/SecretKeyFactoryExtensions.java#L74-L82 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java | SocketBindingJBossASClient.addSocketBinding | public void addSocketBinding(String socketBindingGroupName, String socketBindingName, int port) throws Exception {
"""
Adds a socket binding with the given name in the named socket binding group.
If a socket binding with the given name already exists, this method does nothing.
@param socketBindingGroupName the... | java | public void addSocketBinding(String socketBindingGroupName, String socketBindingName, int port) throws Exception {
addSocketBinding(socketBindingGroupName, socketBindingName, null, port);
} | [
"public",
"void",
"addSocketBinding",
"(",
"String",
"socketBindingGroupName",
",",
"String",
"socketBindingName",
",",
"int",
"port",
")",
"throws",
"Exception",
"{",
"addSocketBinding",
"(",
"socketBindingGroupName",
",",
"socketBindingName",
",",
"null",
",",
"port... | Adds a socket binding with the given name in the named socket binding group.
If a socket binding with the given name already exists, this method does nothing.
@param socketBindingGroupName the name of the socket binding group in which to create the named socket binding
@param socketBindingName the name of the socket b... | [
"Adds",
"a",
"socket",
"binding",
"with",
"the",
"given",
"name",
"in",
"the",
"named",
"socket",
"binding",
"group",
".",
"If",
"a",
"socket",
"binding",
"with",
"the",
"given",
"name",
"already",
"exists",
"this",
"method",
"does",
"nothing",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java#L116-L118 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java | CPInstancePersistenceImpl.fetchByUUID_G | @Override
public CPInstance fetchByUUID_G(String uuid, long groupId) {
"""
Returns the cp instance where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching cp instance, or <code>n... | java | @Override
public CPInstance fetchByUUID_G(String uuid, long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | [
"@",
"Override",
"public",
"CPInstance",
"fetchByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
",",
"true",
")",
";",
"}"
] | Returns the cp instance where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching cp instance, or <code>null</code> if a matching cp instance could not be found | [
"Returns",
"the",
"cp",
"instance",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"finder",
"cache",
"."... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L698-L701 |
line/armeria | jetty/src/main/java/com/linecorp/armeria/server/jetty/JettyService.java | JettyService.forServer | public static JettyService forServer(Server jettyServer) {
"""
Creates a new {@link JettyService} from an existing Jetty {@link Server}.
@param jettyServer the Jetty {@link Server}
"""
requireNonNull(jettyServer, "jettyServer");
return new JettyService(null, blockingTaskExecutor -> jettyServ... | java | public static JettyService forServer(Server jettyServer) {
requireNonNull(jettyServer, "jettyServer");
return new JettyService(null, blockingTaskExecutor -> jettyServer);
} | [
"public",
"static",
"JettyService",
"forServer",
"(",
"Server",
"jettyServer",
")",
"{",
"requireNonNull",
"(",
"jettyServer",
",",
"\"jettyServer\"",
")",
";",
"return",
"new",
"JettyService",
"(",
"null",
",",
"blockingTaskExecutor",
"->",
"jettyServer",
")",
";... | Creates a new {@link JettyService} from an existing Jetty {@link Server}.
@param jettyServer the Jetty {@link Server} | [
"Creates",
"a",
"new",
"{",
"@link",
"JettyService",
"}",
"from",
"an",
"existing",
"Jetty",
"{",
"@link",
"Server",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/jetty/src/main/java/com/linecorp/armeria/server/jetty/JettyService.java#L83-L86 |
Wikidata/Wikidata-Toolkit | wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/ApiConnection.java | ApiConnection.fillCookies | @Deprecated
void fillCookies(Map<String, List<String>> headerFields) {
"""
Reads out the Set-Cookie Header Fields and fills the cookie map of the
API connection with it.
@deprecated to be migrated to {@class PasswordApiConnection}
"""
List<String> headerCookies = headerFields
.get(ApiConnection.HEAD... | java | @Deprecated
void fillCookies(Map<String, List<String>> headerFields) {
List<String> headerCookies = headerFields
.get(ApiConnection.HEADER_FIELD_SET_COOKIE);
if (headerCookies != null) {
for (String cookie : headerCookies) {
String[] cookieResponse = cookie.split(";\\p{Space}??");
for (String cookie... | [
"@",
"Deprecated",
"void",
"fillCookies",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headerFields",
")",
"{",
"List",
"<",
"String",
">",
"headerCookies",
"=",
"headerFields",
".",
"get",
"(",
"ApiConnection",
".",
"HEADER_FIELD_SET_CO... | Reads out the Set-Cookie Header Fields and fills the cookie map of the
API connection with it.
@deprecated to be migrated to {@class PasswordApiConnection} | [
"Reads",
"out",
"the",
"Set",
"-",
"Cookie",
"Header",
"Fields",
"and",
"fills",
"the",
"cookie",
"map",
"of",
"the",
"API",
"connection",
"with",
"it",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/ApiConnection.java#L643-L661 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2ConnectionManager.java | Http2ConnectionManager.borrowChannel | public Http2ClientChannel borrowChannel(Http2SourceHandler http2SrcHandler, HttpRoute httpRoute) {
"""
Borrow an HTTP/2 client channel.
@param http2SrcHandler Relevant http/2 source handler where the source connection belongs to
@param httpRoute the http route
@return Http2ClientChannel
"""
... | java | public Http2ClientChannel borrowChannel(Http2SourceHandler http2SrcHandler, HttpRoute httpRoute) {
EventLoopPool eventLoopPool;
String key = generateKey(httpRoute);
EventLoopPool.PerRouteConnectionPool perRouteConnectionPool;
if (http2SrcHandler != null) {
eventLoopPool = ge... | [
"public",
"Http2ClientChannel",
"borrowChannel",
"(",
"Http2SourceHandler",
"http2SrcHandler",
",",
"HttpRoute",
"httpRoute",
")",
"{",
"EventLoopPool",
"eventLoopPool",
";",
"String",
"key",
"=",
"generateKey",
"(",
"httpRoute",
")",
";",
"EventLoopPool",
".",
"PerRo... | Borrow an HTTP/2 client channel.
@param http2SrcHandler Relevant http/2 source handler where the source connection belongs to
@param httpRoute the http route
@return Http2ClientChannel | [
"Borrow",
"an",
"HTTP",
"/",
"2",
"client",
"channel",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2ConnectionManager.java#L111-L133 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZonedDateTime.java | ZonedDateTime.plus | @Override
public ZonedDateTime plus(long amountToAdd, TemporalUnit unit) {
"""
Returns a copy of this date-time with the specified amount added.
<p>
This returns a {@code ZonedDateTime}, based on this one, with the amount
in terms of the unit added. If it is not possible to add the amount, because the
unit... | java | @Override
public ZonedDateTime plus(long amountToAdd, TemporalUnit unit) {
if (unit instanceof ChronoUnit) {
if (unit.isDateBased()) {
return resolveLocal(dateTime.plus(amountToAdd, unit));
} else {
return resolveInstant(dateTime.plus(amountToAdd, unit... | [
"@",
"Override",
"public",
"ZonedDateTime",
"plus",
"(",
"long",
"amountToAdd",
",",
"TemporalUnit",
"unit",
")",
"{",
"if",
"(",
"unit",
"instanceof",
"ChronoUnit",
")",
"{",
"if",
"(",
"unit",
".",
"isDateBased",
"(",
")",
")",
"{",
"return",
"resolveLoc... | Returns a copy of this date-time with the specified amount added.
<p>
This returns a {@code ZonedDateTime}, based on this one, with the amount
in terms of the unit added. If it is not possible to add the amount, because the
unit is not supported or for some other reason, an exception is thrown.
<p>
If the field is a {@... | [
"Returns",
"a",
"copy",
"of",
"this",
"date",
"-",
"time",
"with",
"the",
"specified",
"amount",
"added",
".",
"<p",
">",
"This",
"returns",
"a",
"{",
"@code",
"ZonedDateTime",
"}",
"based",
"on",
"this",
"one",
"with",
"the",
"amount",
"in",
"terms",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZonedDateTime.java#L1592-L1602 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java | IndexWriter.generateAttributeUpdates | private void generateAttributeUpdates(BucketUpdate bucketUpdate, UpdateInstructions update) {
"""
Generates the necessary {@link AttributeUpdate}s to index updates to the given {@link BucketUpdate}.
Backpointer updates:
- Backpointers are used to resolve collisions when we have exhausted the full hash (so we c... | java | private void generateAttributeUpdates(BucketUpdate bucketUpdate, UpdateInstructions update) {
if (!bucketUpdate.hasUpdates()) {
// Nothing to do.
return;
}
// Sanity check: If we get an existing bucket (that points to a Table Entry), then it must have at least one existi... | [
"private",
"void",
"generateAttributeUpdates",
"(",
"BucketUpdate",
"bucketUpdate",
",",
"UpdateInstructions",
"update",
")",
"{",
"if",
"(",
"!",
"bucketUpdate",
".",
"hasUpdates",
"(",
")",
")",
"{",
"// Nothing to do.",
"return",
";",
"}",
"// Sanity check: If we... | Generates the necessary {@link AttributeUpdate}s to index updates to the given {@link BucketUpdate}.
Backpointer updates:
- Backpointers are used to resolve collisions when we have exhausted the full hash (so we cannot grow the tree
anymore). As such, we only calculate backpointers after we group the keys based on the... | [
"Generates",
"the",
"necessary",
"{",
"@link",
"AttributeUpdate",
"}",
"s",
"to",
"index",
"updates",
"to",
"the",
"given",
"{",
"@link",
"BucketUpdate",
"}",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java#L159-L186 |
wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java | CacheUtils.computeEtag | public static String computeEtag(long lastModification, ApplicationConfiguration configuration, Crypto crypto) {
"""
Computes the ETAG value based on the last modification date passed as parameter.
@param lastModification the last modification (must be valid)
@param configuration the configuration
@param c... | java | public static String computeEtag(long lastModification, ApplicationConfiguration configuration, Crypto crypto) {
boolean useEtag = configuration.getBooleanWithDefault(HTTP_USE_ETAG,
HTTP_USE_ETAG_DEFAULT);
if (!useEtag) {
return null;
}
String raw = Long.toStr... | [
"public",
"static",
"String",
"computeEtag",
"(",
"long",
"lastModification",
",",
"ApplicationConfiguration",
"configuration",
",",
"Crypto",
"crypto",
")",
"{",
"boolean",
"useEtag",
"=",
"configuration",
".",
"getBooleanWithDefault",
"(",
"HTTP_USE_ETAG",
",",
"HTT... | Computes the ETAG value based on the last modification date passed as parameter.
@param lastModification the last modification (must be valid)
@param configuration the configuration
@param crypto the crypto service
@return the encoded etag | [
"Computes",
"the",
"ETAG",
"value",
"based",
"on",
"the",
"last",
"modification",
"date",
"passed",
"as",
"parameter",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java#L110-L118 |
Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/command/AbstractFileSystemCommand.java | AbstractFileSystemCommand.runWildCardCmd | protected void runWildCardCmd(AlluxioURI wildCardPath, CommandLine cl) throws IOException {
"""
Runs the command for a particular URI that may contain wildcard in its path.
@param wildCardPath an AlluxioURI that may or may not contain a wildcard
@param cl object containing the original commandLine
"""
... | java | protected void runWildCardCmd(AlluxioURI wildCardPath, CommandLine cl) throws IOException {
List<AlluxioURI> paths = FileSystemShellUtils.getAlluxioURIs(mFileSystem, wildCardPath);
if (paths.size() == 0) { // A unified sanity check on the paths
throw new IOException(wildCardPath + " does not exist.");
... | [
"protected",
"void",
"runWildCardCmd",
"(",
"AlluxioURI",
"wildCardPath",
",",
"CommandLine",
"cl",
")",
"throws",
"IOException",
"{",
"List",
"<",
"AlluxioURI",
">",
"paths",
"=",
"FileSystemShellUtils",
".",
"getAlluxioURIs",
"(",
"mFileSystem",
",",
"wildCardPath... | Runs the command for a particular URI that may contain wildcard in its path.
@param wildCardPath an AlluxioURI that may or may not contain a wildcard
@param cl object containing the original commandLine | [
"Runs",
"the",
"command",
"for",
"a",
"particular",
"URI",
"that",
"may",
"contain",
"wildcard",
"in",
"its",
"path",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/AbstractFileSystemCommand.java#L79-L101 |
bingoohuang/excel2javabeans | src/main/java/com/github/bingoohuang/excel2beans/BeansToExcelOnTemplate.java | BeansToExcelOnTemplate.newCell | private Cell newCell(Row tmplRow, int cellCol, int rowOffset, Row row, Object cellValue, int maxLen) {
"""
创建新的单元格。
@param tmplRow 模板行。
@param cellCol 单元格所在的列索引。
@param rowOffset 行偏移号。
@param row 需要创建新单元格所在的行。
@param cellValue 新单元格取值。
@return 新的单元格。
"""
val cell = getOrCreateCell(tmpl... | java | private Cell newCell(Row tmplRow, int cellCol, int rowOffset, Row row, Object cellValue, int maxLen) {
val cell = getOrCreateCell(tmplRow, cellCol, rowOffset, row);
val value = PoiUtil.writeCellValue(cell, cellValue);
fixMaxRowHeightRatio(row, maxLen, value);
return cell;
} | [
"private",
"Cell",
"newCell",
"(",
"Row",
"tmplRow",
",",
"int",
"cellCol",
",",
"int",
"rowOffset",
",",
"Row",
"row",
",",
"Object",
"cellValue",
",",
"int",
"maxLen",
")",
"{",
"val",
"cell",
"=",
"getOrCreateCell",
"(",
"tmplRow",
",",
"cellCol",
","... | 创建新的单元格。
@param tmplRow 模板行。
@param cellCol 单元格所在的列索引。
@param rowOffset 行偏移号。
@param row 需要创建新单元格所在的行。
@param cellValue 新单元格取值。
@return 新的单元格。 | [
"创建新的单元格。"
] | train | https://github.com/bingoohuang/excel2javabeans/blob/db136d460b93b649814366c0d84a982698b96dc3/src/main/java/com/github/bingoohuang/excel2beans/BeansToExcelOnTemplate.java#L299-L306 |
arakelian/more-commons | src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java | XmlStreamReaderUtils.createXMLStreamException | public static XMLStreamException createXMLStreamException(
final String message,
final XMLStreamReader reader,
final Throwable cause) {
"""
Returns new instance of <code>XMLStreamException</code> with given cause
@param message
exception message
@param reader
parser
@para... | java | public static XMLStreamException createXMLStreamException(
final String message,
final XMLStreamReader reader,
final Throwable cause) {
final XMLStreamException exception = new XMLStreamException(message, reader.getLocation(), null);
exception.initCause(cause);
... | [
"public",
"static",
"XMLStreamException",
"createXMLStreamException",
"(",
"final",
"String",
"message",
",",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"Throwable",
"cause",
")",
"{",
"final",
"XMLStreamException",
"exception",
"=",
"new",
"XMLStreamException"... | Returns new instance of <code>XMLStreamException</code> with given cause
@param message
exception message
@param reader
parser
@param cause
underlying cause
@return <code>XMLStreamException</code> with given cause | [
"Returns",
"new",
"instance",
"of",
"<code",
">",
"XMLStreamException<",
"/",
"code",
">",
"with",
"given",
"cause"
] | train | https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java#L465-L472 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java | IntegralImageOps.block_unsafe | public static double block_unsafe(GrayF64 integral , int x0 , int y0 , int x1 , int y1 ) {
"""
<p>
Computes the value of a block inside an integral image without bounds checking. The block is
defined as follows: x0 < x ≤ x1 and y0 < y ≤ y1.
</p>
@param integral Integral image.
@param x0 Lower b... | java | public static double block_unsafe(GrayF64 integral , int x0 , int y0 , int x1 , int y1 )
{
return ImplIntegralImageOps.block_unsafe(integral,x0,y0,x1,y1);
} | [
"public",
"static",
"double",
"block_unsafe",
"(",
"GrayF64",
"integral",
",",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"return",
"ImplIntegralImageOps",
".",
"block_unsafe",
"(",
"integral",
",",
"x0",
",",
"y0",
",",... | <p>
Computes the value of a block inside an integral image without bounds checking. The block is
defined as follows: x0 < x ≤ x1 and y0 < y ≤ y1.
</p>
@param integral Integral image.
@param x0 Lower bound of the block. Exclusive.
@param y0 Lower bound of the block. Exclusive.
@param x1 Upper bound of th... | [
"<p",
">",
"Computes",
"the",
"value",
"of",
"a",
"block",
"inside",
"an",
"integral",
"image",
"without",
"bounds",
"checking",
".",
"The",
"block",
"is",
"defined",
"as",
"follows",
":",
"x0",
"<",
";",
"x",
"&le",
";",
"x1",
"and",
"y0",
"<",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java#L372-L375 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/image/ImageBuilder.java | ImageBuilder.buildLocalImage | private Image buildLocalImage(final AbstractBaseImage jrImage, final boolean skipImagesFolder) {
"""
Build a local image with its local path.
@param jrImage the local image params
@param skipImagesFolder skip imagesFolder prefix addition
@return the JavaFX image object
"""
final StringBuilder s... | java | private Image buildLocalImage(final AbstractBaseImage jrImage, final boolean skipImagesFolder) {
final StringBuilder sb = new StringBuilder();
if (jrImage.path() != null && !jrImage.path().isEmpty()) {
sb.append(jrImage.path()).append(Resources.PATH_SEP);
}
sb.append... | [
"private",
"Image",
"buildLocalImage",
"(",
"final",
"AbstractBaseImage",
"jrImage",
",",
"final",
"boolean",
"skipImagesFolder",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"jrImage",
".",
"path",
"(",
")",... | Build a local image with its local path.
@param jrImage the local image params
@param skipImagesFolder skip imagesFolder prefix addition
@return the JavaFX image object | [
"Build",
"a",
"local",
"image",
"with",
"its",
"local",
"path",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/image/ImageBuilder.java#L94-L107 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/DirectoryHelper.java | DirectoryHelper.deleteDstAndRename | public static void deleteDstAndRename(File srcFile, File dstFile) throws IOException {
"""
Rename file. Trying to remove destination first.
If file can't be renamed in standard way the coping
data will be used instead.
@param srcFile
source file
@param dstFile
destination file
@throws IOException
if any ... | java | public static void deleteDstAndRename(File srcFile, File dstFile) throws IOException
{
if (dstFile.exists())
{
if (!dstFile.delete())
{
throw new IOException("Cannot delete " + dstFile);
}
}
renameFile(srcFile, dstFile);
} | [
"public",
"static",
"void",
"deleteDstAndRename",
"(",
"File",
"srcFile",
",",
"File",
"dstFile",
")",
"throws",
"IOException",
"{",
"if",
"(",
"dstFile",
".",
"exists",
"(",
")",
")",
"{",
"if",
"(",
"!",
"dstFile",
".",
"delete",
"(",
")",
")",
"{",
... | Rename file. Trying to remove destination first.
If file can't be renamed in standard way the coping
data will be used instead.
@param srcFile
source file
@param dstFile
destination file
@throws IOException
if any exception occurred | [
"Rename",
"file",
".",
"Trying",
"to",
"remove",
"destination",
"first",
".",
"If",
"file",
"can",
"t",
"be",
"renamed",
"in",
"standard",
"way",
"the",
"coping",
"data",
"will",
"be",
"used",
"instead",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/DirectoryHelper.java#L384-L395 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java | NotificationHubsInner.checkNotificationHubAvailabilityAsync | public Observable<CheckAvailabilityResultInner> checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) {
"""
Checks the availability of the given notificationHub in a namespace.
@param resourceGroupName The name of the resource group.
@para... | java | public Observable<CheckAvailabilityResultInner> checkNotificationHubAvailabilityAsync(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) {
return checkNotificationHubAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1<ServiceRespo... | [
"public",
"Observable",
"<",
"CheckAvailabilityResultInner",
">",
"checkNotificationHubAvailabilityAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"namespaceName",
",",
"CheckAvailabilityParameters",
"parameters",
")",
"{",
"return",
"checkNotificationHubAvailabilityWi... | Checks the availability of the given notificationHub in a namespace.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param parameters The notificationHub name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Chec... | [
"Checks",
"the",
"availability",
"of",
"the",
"given",
"notificationHub",
"in",
"a",
"namespace",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java#L176-L183 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/api/Database.java | Database.removeAttachment | public com.cloudant.client.api.model.Response removeAttachment(Object object, String attachmentName) {
"""
Removes an attachment from the specified document.
<p>The object must have the correct {@code _id} and {@code _rev} values.</p>
<P>Example usage:</P>
<pre>
{@code
//get a Bar object from the database
Ba... | java | public com.cloudant.client.api.model.Response removeAttachment(Object object, String attachmentName) {
Response couchDbResponse = db.removeAttachment(object, attachmentName);
com.cloudant.client.api.model.Response response = new com.cloudant.client.api.model
.Response(couchDbResponse);
... | [
"public",
"com",
".",
"cloudant",
".",
"client",
".",
"api",
".",
"model",
".",
"Response",
"removeAttachment",
"(",
"Object",
"object",
",",
"String",
"attachmentName",
")",
"{",
"Response",
"couchDbResponse",
"=",
"db",
".",
"removeAttachment",
"(",
"object"... | Removes an attachment from the specified document.
<p>The object must have the correct {@code _id} and {@code _rev} values.</p>
<P>Example usage:</P>
<pre>
{@code
//get a Bar object from the database
Bar bar = db.find(Bar.class, "exampleId");
String attachmentName = "example.jpg";
//now remove the remote Bar attachment... | [
"Removes",
"an",
"attachment",
"from",
"the",
"specified",
"document",
".",
"<p",
">",
"The",
"object",
"must",
"have",
"the",
"correct",
"{",
"@code",
"_id",
"}",
"and",
"{",
"@code",
"_rev",
"}",
"values",
".",
"<",
"/",
"p",
">",
"<P",
">",
"Examp... | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/api/Database.java#L1315-L1320 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/APIClient.java | APIClient.enableRateLimitForward | public void enableRateLimitForward(String adminAPIKey, String endUserIP, String rateLimitAPIKey) {
"""
Allow to use IP rate limit when you have a proxy between end-user and Algolia.
This option will set the X-Forwarded-For HTTP header with the client IP and the X-Forwarded-API-Key with the API Key having rate lim... | java | public void enableRateLimitForward(String adminAPIKey, String endUserIP, String rateLimitAPIKey) {
this.forwardAdminAPIKey = adminAPIKey;
this.forwardEndUserIP = endUserIP;
this.forwardRateLimitAPIKey = rateLimitAPIKey;
} | [
"public",
"void",
"enableRateLimitForward",
"(",
"String",
"adminAPIKey",
",",
"String",
"endUserIP",
",",
"String",
"rateLimitAPIKey",
")",
"{",
"this",
".",
"forwardAdminAPIKey",
"=",
"adminAPIKey",
";",
"this",
".",
"forwardEndUserIP",
"=",
"endUserIP",
";",
"t... | Allow to use IP rate limit when you have a proxy between end-user and Algolia.
This option will set the X-Forwarded-For HTTP header with the client IP and the X-Forwarded-API-Key with the API Key having rate limits.
@param adminAPIKey the admin API Key you can find in your dashboard
@param endUserIP the end ... | [
"Allow",
"to",
"use",
"IP",
"rate",
"limit",
"when",
"you",
"have",
"a",
"proxy",
"between",
"end",
"-",
"user",
"and",
"Algolia",
".",
"This",
"option",
"will",
"set",
"the",
"X",
"-",
"Forwarded",
"-",
"For",
"HTTP",
"header",
"with",
"the",
"client"... | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L237-L241 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_server_GET | public OvhServer organizationName_service_exchangeService_server_GET(String organizationName, String exchangeService) throws IOException {
"""
Get this object properties
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/server
@param organizationName [required] The internal name of your ex... | java | public OvhServer organizationName_service_exchangeService_server_GET(String organizationName, String exchangeService) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/server";
StringBuilder sb = path(qPath, organizationName, exchangeService);
String resp = exec(qPa... | [
"public",
"OvhServer",
"organizationName_service_exchangeService_server_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/exchange/{organizationName}/service/{exchangeService}/server\"",
"... | Get this object properties
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/server
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L392-L397 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/responder/responderpolicylabel.java | responderpolicylabel.get | public static responderpolicylabel get(nitro_service service, String labelname) throws Exception {
"""
Use this API to fetch responderpolicylabel resource of given name .
"""
responderpolicylabel obj = new responderpolicylabel();
obj.set_labelname(labelname);
responderpolicylabel response = (responderpol... | java | public static responderpolicylabel get(nitro_service service, String labelname) throws Exception{
responderpolicylabel obj = new responderpolicylabel();
obj.set_labelname(labelname);
responderpolicylabel response = (responderpolicylabel) obj.get_resource(service);
return response;
} | [
"public",
"static",
"responderpolicylabel",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"labelname",
")",
"throws",
"Exception",
"{",
"responderpolicylabel",
"obj",
"=",
"new",
"responderpolicylabel",
"(",
")",
";",
"obj",
".",
"set_labelname",
"(",
"la... | Use this API to fetch responderpolicylabel resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"responderpolicylabel",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/responder/responderpolicylabel.java#L324-L329 |
j256/ormlite-core | src/main/java/com/j256/ormlite/misc/TransactionManager.java | TransactionManager.callInTransaction | public static <T> T callInTransaction(final ConnectionSource connectionSource, final Callable<T> callable)
throws SQLException {
"""
Same as {@link #callInTransaction(Callable)} except as a static method with a connection source.
<p>
WARNING: it is up to you to properly synchronize around this method if mul... | java | public static <T> T callInTransaction(final ConnectionSource connectionSource, final Callable<T> callable)
throws SQLException {
return callInTransaction(null, connectionSource, callable);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"callInTransaction",
"(",
"final",
"ConnectionSource",
"connectionSource",
",",
"final",
"Callable",
"<",
"T",
">",
"callable",
")",
"throws",
"SQLException",
"{",
"return",
"callInTransaction",
"(",
"null",
",",
"connecti... | Same as {@link #callInTransaction(Callable)} except as a static method with a connection source.
<p>
WARNING: it is up to you to properly synchronize around this method if multiple threads are using a
connection-source which works gives out a single-connection. The reason why this is necessary is that multiple
operati... | [
"Same",
"as",
"{",
"@link",
"#callInTransaction",
"(",
"Callable",
")",
"}",
"except",
"as",
"a",
"static",
"method",
"with",
"a",
"connection",
"source",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/misc/TransactionManager.java#L156-L159 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java | ClassUtil.getClassPaths | public static Set<String> getClassPaths(String packageName, boolean isDecode) {
"""
获得ClassPath
@param packageName 包名称
@param isDecode 是否解码路径中的特殊字符(例如空格和中文)
@return ClassPath路径字符串集合
@since 4.0.11
"""
String packagePath = packageName.replace(StrUtil.DOT, StrUtil.SLASH);
Enumeration<URL> resources;
... | java | public static Set<String> getClassPaths(String packageName, boolean isDecode) {
String packagePath = packageName.replace(StrUtil.DOT, StrUtil.SLASH);
Enumeration<URL> resources;
try {
resources = getClassLoader().getResources(packagePath);
} catch (IOException e) {
throw new UtilException(e, "Loadin... | [
"public",
"static",
"Set",
"<",
"String",
">",
"getClassPaths",
"(",
"String",
"packageName",
",",
"boolean",
"isDecode",
")",
"{",
"String",
"packagePath",
"=",
"packageName",
".",
"replace",
"(",
"StrUtil",
".",
"DOT",
",",
"StrUtil",
".",
"SLASH",
")",
... | 获得ClassPath
@param packageName 包名称
@param isDecode 是否解码路径中的特殊字符(例如空格和中文)
@return ClassPath路径字符串集合
@since 4.0.11 | [
"获得ClassPath"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L419-L434 |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/internal/util/UrlUtil.java | UrlUtil.toUrl | public static URL toUrl(@Nonnull final File file) {
"""
Gets the URL to a given {@code File}.
@param file
file to be converted to a URL
@return an URL to the passed file
@throws IllegalStateException
if no URL can be resolved to the given file
"""
Check.notNull(file, "file");
URL url = null;
try ... | java | public static URL toUrl(@Nonnull final File file) {
Check.notNull(file, "file");
URL url = null;
try {
url = file.toURI().toURL();
} catch (final MalformedURLException e) {
throw new IllegalStateException("Can not construct an URL for passed file.", e);
}
return url;
} | [
"public",
"static",
"URL",
"toUrl",
"(",
"@",
"Nonnull",
"final",
"File",
"file",
")",
"{",
"Check",
".",
"notNull",
"(",
"file",
",",
"\"file\"",
")",
";",
"URL",
"url",
"=",
"null",
";",
"try",
"{",
"url",
"=",
"file",
".",
"toURI",
"(",
")",
"... | Gets the URL to a given {@code File}.
@param file
file to be converted to a URL
@return an URL to the passed file
@throws IllegalStateException
if no URL can be resolved to the given file | [
"Gets",
"the",
"URL",
"to",
"a",
"given",
"{",
"@code",
"File",
"}",
"."
] | train | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/util/UrlUtil.java#L152-L162 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/gui/AbstractComponent.java | AbstractComponent.mouseReleased | public void mouseReleased(int button, int x, int y) {
"""
Gives the focus to this component with a click of the mouse.
@see org.newdawn.slick.gui.AbstractComponent#mouseReleased(int, int, int)
"""
setFocus(Rectangle.contains(x, y, getX(), getY(), getWidth(),
getHeight()));
} | java | public void mouseReleased(int button, int x, int y) {
setFocus(Rectangle.contains(x, y, getX(), getY(), getWidth(),
getHeight()));
} | [
"public",
"void",
"mouseReleased",
"(",
"int",
"button",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"setFocus",
"(",
"Rectangle",
".",
"contains",
"(",
"x",
",",
"y",
",",
"getX",
"(",
")",
",",
"getY",
"(",
")",
",",
"getWidth",
"(",
")",
",",
... | Gives the focus to this component with a click of the mouse.
@see org.newdawn.slick.gui.AbstractComponent#mouseReleased(int, int, int) | [
"Gives",
"the",
"focus",
"to",
"this",
"component",
"with",
"a",
"click",
"of",
"the",
"mouse",
"."
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/gui/AbstractComponent.java#L178-L181 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java | CPOptionPersistenceImpl.findByUUID_G | @Override
public CPOption findByUUID_G(String uuid, long groupId)
throws NoSuchCPOptionException {
"""
Returns the cp option where uuid = ? and groupId = ? or throws a {@link NoSuchCPOptionException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching cp ... | java | @Override
public CPOption findByUUID_G(String uuid, long groupId)
throws NoSuchCPOptionException {
CPOption cpOption = fetchByUUID_G(uuid, groupId);
if (cpOption == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("uuid=");
msg.append(uuid);
ms... | [
"@",
"Override",
"public",
"CPOption",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPOptionException",
"{",
"CPOption",
"cpOption",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";",
"if",
"(",
"cpOption",
"==... | Returns the cp option where uuid = ? and groupId = ? or throws a {@link NoSuchCPOptionException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching cp option
@throws NoSuchCPOptionException if a matching cp option could not be found | [
"Returns",
"the",
"cp",
"option",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPOptionException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java#L659-L685 |
geomajas/geomajas-project-server | plugin/staticsecurity/staticsecurity-ldap/src/main/java/org/geomajas/plugin/staticsecurity/ldap/LdapAuthenticationService.java | LdapAuthenticationService.setNamedRoles | @Api
public void setNamedRoles(Map<String, List<NamedRoleInfo>> namedRoles) {
"""
Set the named roles which may be defined.
@param roles map with roles, keys are the values for {@link #rolesAttribute}, probably DN values
@since 1.10.0
"""
this.namedRoles = namedRoles;
ldapRoleMapping = new HashMap<Str... | java | @Api
public void setNamedRoles(Map<String, List<NamedRoleInfo>> namedRoles) {
this.namedRoles = namedRoles;
ldapRoleMapping = new HashMap<String, Set<String>>();
for (String roleName : namedRoles.keySet()) {
if (!ldapRoleMapping.containsKey(roleName)) {
ldapRoleMapping.put(roleName, new HashSet<String>())... | [
"@",
"Api",
"public",
"void",
"setNamedRoles",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"NamedRoleInfo",
">",
">",
"namedRoles",
")",
"{",
"this",
".",
"namedRoles",
"=",
"namedRoles",
";",
"ldapRoleMapping",
"=",
"new",
"HashMap",
"<",
"String",
",",
... | Set the named roles which may be defined.
@param roles map with roles, keys are the values for {@link #rolesAttribute}, probably DN values
@since 1.10.0 | [
"Set",
"the",
"named",
"roles",
"which",
"may",
"be",
"defined",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/staticsecurity/staticsecurity-ldap/src/main/java/org/geomajas/plugin/staticsecurity/ldap/LdapAuthenticationService.java#L284-L296 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/Lock.java | Lock.setScope | public void setScope(String scope) throws ApplicationException {
"""
set the value scope Specifies the scope as one of the following: Application, Server, or Session.
This attribute is mutually exclusive with the name attribute.
@param scope value to set
@throws ApplicationException
"""
scope = scope.toL... | java | public void setScope(String scope) throws ApplicationException {
scope = scope.toLowerCase().trim();
if (scope.equals("server")) this.scope = SCOPE_SERVER;
else if (scope.equals("application")) this.scope = SCOPE_APPLICATION;
else if (scope.equals("session")) this.scope = SCOPE_SESSION;
else if (scope.equals("req... | [
"public",
"void",
"setScope",
"(",
"String",
"scope",
")",
"throws",
"ApplicationException",
"{",
"scope",
"=",
"scope",
".",
"toLowerCase",
"(",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"scope",
".",
"equals",
"(",
"\"server\"",
")",
")",
"this",
"... | set the value scope Specifies the scope as one of the following: Application, Server, or Session.
This attribute is mutually exclusive with the name attribute.
@param scope value to set
@throws ApplicationException | [
"set",
"the",
"value",
"scope",
"Specifies",
"the",
"scope",
"as",
"one",
"of",
"the",
"following",
":",
"Application",
"Server",
"or",
"Session",
".",
"This",
"attribute",
"is",
"mutually",
"exclusive",
"with",
"the",
"name",
"attribute",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Lock.java#L168-L176 |
roboconf/roboconf-platform | core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerUtils.java | DockerUtils.findImageById | public static Image findImageById( String imageId, List<Image> images ) {
"""
Finds an image by ID.
@param imageId the image ID (not null)
@param images a non-null list of images
@return an image, or null if none was found
"""
Image result = null;
for( Image img : images ) {
if( img.getId().equals(i... | java | public static Image findImageById( String imageId, List<Image> images ) {
Image result = null;
for( Image img : images ) {
if( img.getId().equals(imageId)) {
result = img;
break;
}
}
return result;
} | [
"public",
"static",
"Image",
"findImageById",
"(",
"String",
"imageId",
",",
"List",
"<",
"Image",
">",
"images",
")",
"{",
"Image",
"result",
"=",
"null",
";",
"for",
"(",
"Image",
"img",
":",
"images",
")",
"{",
"if",
"(",
"img",
".",
"getId",
"(",... | Finds an image by ID.
@param imageId the image ID (not null)
@param images a non-null list of images
@return an image, or null if none was found | [
"Finds",
"an",
"image",
"by",
"ID",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerUtils.java#L141-L152 |
NessComputing/components-ness-scopes | src/main/java/com/nesscomputing/scopes/threaddelegate/ThreadDelegatedContext.java | ThreadDelegatedContext.putIfAbsent | @SuppressWarnings("PMD.UnnecessaryLocalBeforeReturn")
<T> T putIfAbsent(@Nonnull final Key<T> key, @Nonnull final Provider<T> valueComputer) throws InterruptedException, ExecutionException {
"""
Compute and enter a value into the context unless the value has already been computed.
@param key the key to associ... | java | @SuppressWarnings("PMD.UnnecessaryLocalBeforeReturn")
<T> T putIfAbsent(@Nonnull final Key<T> key, @Nonnull final Provider<T> valueComputer) throws InterruptedException, ExecutionException
{
Preconditions.checkArgument(key != null, "Key must not be null!");
// Fast path, if the value exists, re... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.UnnecessaryLocalBeforeReturn\"",
")",
"<",
"T",
">",
"T",
"putIfAbsent",
"(",
"@",
"Nonnull",
"final",
"Key",
"<",
"T",
">",
"key",
",",
"@",
"Nonnull",
"final",
"Provider",
"<",
"T",
">",
"valueComputer",
")",
"throws",
... | Compute and enter a value into the context unless the value has already been computed.
@param key the key to associate this value with
@param valueComputer the Provider that will compute the value if necessary
@return the old value, if it already existed, or the freshly computed value | [
"Compute",
"and",
"enter",
"a",
"value",
"into",
"the",
"context",
"unless",
"the",
"value",
"has",
"already",
"been",
"computed",
"."
] | train | https://github.com/NessComputing/components-ness-scopes/blob/f055ea4897b0cca9ee6dc815b7a42c0dc53ffbd4/src/main/java/com/nesscomputing/scopes/threaddelegate/ThreadDelegatedContext.java#L74-L117 |
mikereedell/sunrisesunsetlib-java | src/main/java/com/luckycatlabs/sunrisesunset/calculator/SolarEventCalculator.java | SolarEventCalculator.getLocalTimeAsCalendar | protected Calendar getLocalTimeAsCalendar(BigDecimal localTimeParam, Calendar date) {
"""
Returns the local rise/set time in the form HH:MM.
@param localTimeParam
<code>BigDecimal</code> representation of the local rise/set time.
@return <code>Calendar</code> representation of the local time as a calendar, or... | java | protected Calendar getLocalTimeAsCalendar(BigDecimal localTimeParam, Calendar date) {
if (localTimeParam == null) {
return null;
}
// Create a clone of the input calendar so we get locale/timezone information.
Calendar resultTime = (Calendar) date.clone();
BigDecima... | [
"protected",
"Calendar",
"getLocalTimeAsCalendar",
"(",
"BigDecimal",
"localTimeParam",
",",
"Calendar",
"date",
")",
"{",
"if",
"(",
"localTimeParam",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Create a clone of the input calendar so we get locale/timezone i... | Returns the local rise/set time in the form HH:MM.
@param localTimeParam
<code>BigDecimal</code> representation of the local rise/set time.
@return <code>Calendar</code> representation of the local time as a calendar, or null for none. | [
"Returns",
"the",
"local",
"rise",
"/",
"set",
"time",
"in",
"the",
"form",
"HH",
":",
"MM",
"."
] | train | https://github.com/mikereedell/sunrisesunsetlib-java/blob/6e6de23f1d11429eef58de2541582cbde9b85b92/src/main/java/com/luckycatlabs/sunrisesunset/calculator/SolarEventCalculator.java#L334-L368 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplaceManager.java | CmsWorkplaceManager.getUploadHook | public String getUploadHook(CmsObject cms, String uploadFolder) {
"""
Gets the upload hook URI which should be opened for an upload to a given folder.<p>
This method will return null if no upload hook should be used for the given upload folder.<p>
The API for this upload hook is as follows:
The upload hook ... | java | public String getUploadHook(CmsObject cms, String uploadFolder) {
if (m_postUploadHandler != null) {
return m_postUploadHandler.getUploadHook(cms, uploadFolder);
}
I_CmsDialogHandler handler = getDialogHandler(CmsDialogSelector.DIALOG_PROPERTY);
if ((handler != null) && (han... | [
"public",
"String",
"getUploadHook",
"(",
"CmsObject",
"cms",
",",
"String",
"uploadFolder",
")",
"{",
"if",
"(",
"m_postUploadHandler",
"!=",
"null",
")",
"{",
"return",
"m_postUploadHandler",
".",
"getUploadHook",
"(",
"cms",
",",
"uploadFolder",
")",
";",
"... | Gets the upload hook URI which should be opened for an upload to a given folder.<p>
This method will return null if no upload hook should be used for the given upload folder.<p>
The API for this upload hook is as follows:
The upload hook will be called with the following parameters:
resources (required): a comma sep... | [
"Gets",
"the",
"upload",
"hook",
"URI",
"which",
"should",
"be",
"opened",
"for",
"an",
"upload",
"to",
"a",
"given",
"folder",
".",
"<p",
">",
"This",
"method",
"will",
"return",
"null",
"if",
"no",
"upload",
"hook",
"should",
"be",
"used",
"for",
"th... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplaceManager.java#L1476-L1487 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.