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 |
|---|---|---|---|---|---|---|---|---|---|---|
opencredo/opencredo-esper | esper-template/src/main/java/org/opencredo/esper/config/xml/EsperStatementParser.java | EsperStatementParser.parseStatements | @SuppressWarnings("unchecked")
public ManagedSet parseStatements(Element element, ParserContext parserContext) {
"""
Parses out the individual statement elements for further processing.
@param element
the esper-template context
@param parserContext
the parser's context
@return a set of initialized esper... | java | @SuppressWarnings("unchecked")
public ManagedSet parseStatements(Element element, ParserContext parserContext) {
ManagedSet statements = new ManagedSet();
NodeList childNodes = element.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node child = childNodes.it... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"ManagedSet",
"parseStatements",
"(",
"Element",
"element",
",",
"ParserContext",
"parserContext",
")",
"{",
"ManagedSet",
"statements",
"=",
"new",
"ManagedSet",
"(",
")",
";",
"NodeList",
"childNodes",
... | Parses out the individual statement elements for further processing.
@param element
the esper-template context
@param parserContext
the parser's context
@return a set of initialized esper statements | [
"Parses",
"out",
"the",
"individual",
"statement",
"elements",
"for",
"further",
"processing",
"."
] | train | https://github.com/opencredo/opencredo-esper/blob/a88c9fd0301a4d6962da70d85577c27d50d08825/esper-template/src/main/java/org/opencredo/esper/config/xml/EsperStatementParser.java#L100-L125 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/MessageMap.java | MessageMap.getMultiChoice | private static BigInteger getMultiChoice(int[] choices, JSchema schema, JSVariant var) throws JMFUninitializedAccessException {
"""
Compute the multiChoice code or contribution for an individual variant
"""
int choice = choices[var.getIndex()];
if (choice == -1)
throw new JMFUninitializedAccessEx... | java | private static BigInteger getMultiChoice(int[] choices, JSchema schema, JSVariant var) throws JMFUninitializedAccessException {
int choice = choices[var.getIndex()];
if (choice == -1)
throw new JMFUninitializedAccessException(schema.getPathName(var));
BigInteger ans = BigInteger.ZERO;
// First, ad... | [
"private",
"static",
"BigInteger",
"getMultiChoice",
"(",
"int",
"[",
"]",
"choices",
",",
"JSchema",
"schema",
",",
"JSVariant",
"var",
")",
"throws",
"JMFUninitializedAccessException",
"{",
"int",
"choice",
"=",
"choices",
"[",
"var",
".",
"getIndex",
"(",
"... | Compute the multiChoice code or contribution for an individual variant | [
"Compute",
"the",
"multiChoice",
"code",
"or",
"contribution",
"for",
"an",
"individual",
"variant"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/MessageMap.java#L194-L209 |
real-logic/agrona | agrona/src/main/java/org/agrona/IoUtil.java | IoUtil.checkFileExists | public static void checkFileExists(final File file, final String name) {
"""
Check that a file exists and throw an exception if not.
@param file to check existence of.
@param name to associate for the exception
"""
if (!file.exists())
{
final String msg = "missing file for " + n... | java | public static void checkFileExists(final File file, final String name)
{
if (!file.exists())
{
final String msg = "missing file for " + name + " : " + file.getAbsolutePath();
throw new IllegalStateException(msg);
}
} | [
"public",
"static",
"void",
"checkFileExists",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"!",
"file",
".",
"exists",
"(",
")",
")",
"{",
"final",
"String",
"msg",
"=",
"\"missing file for \"",
"+",
"name",
"+",
... | Check that a file exists and throw an exception if not.
@param file to check existence of.
@param name to associate for the exception | [
"Check",
"that",
"a",
"file",
"exists",
"and",
"throw",
"an",
"exception",
"if",
"not",
"."
] | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/IoUtil.java#L425-L432 |
teatrove/teatrove | build-tools/teatools/src/main/java/org/teatrove/teatools/TextCompiler.java | TextCompiler.createTextSourceReader | public static SourceReader createTextSourceReader(char[] text) {
"""
A utility method that creates a Tea SourceReader for the specified text.
The text should contain Tea code.
<p>
This method can be used to create a SourceReader for a section of text.
@param text the Text to read
@return a SourceReader fo... | java | public static SourceReader createTextSourceReader(char[] text) {
Reader r = new BufferedReader(new CharArrayReader(text));
return new SourceReader(r, BEGIN_CODE_TAG, END_CODE_TAG);
} | [
"public",
"static",
"SourceReader",
"createTextSourceReader",
"(",
"char",
"[",
"]",
"text",
")",
"{",
"Reader",
"r",
"=",
"new",
"BufferedReader",
"(",
"new",
"CharArrayReader",
"(",
"text",
")",
")",
";",
"return",
"new",
"SourceReader",
"(",
"r",
",",
"... | A utility method that creates a Tea SourceReader for the specified text.
The text should contain Tea code.
<p>
This method can be used to create a SourceReader for a section of text.
@param text the Text to read
@return a SourceReader for the specified text | [
"A",
"utility",
"method",
"that",
"creates",
"a",
"Tea",
"SourceReader",
"for",
"the",
"specified",
"text",
".",
"The",
"text",
"should",
"contain",
"Tea",
"code",
".",
"<p",
">",
"This",
"method",
"can",
"be",
"used",
"to",
"create",
"a",
"SourceReader",
... | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/build-tools/teatools/src/main/java/org/teatrove/teatools/TextCompiler.java#L45-L49 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.noNullElements | @ArgumentsChecked
@Throws( {
"""
Ensures that an iterable reference is neither {@code null} nor contains any elements that are {@code null}.
@param iterable
the iterable reference which should not contain {@code null}
@param name
name of object reference (in source code)
@return the passed reference which ... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalNullElementsException.class })
public static <T extends Iterable<?>> T noNullElements(@Nonnull final T iterable, final String name) {
Check.notNull(iterable, "iterable");
for (final Object element : iterable) {
if (element == null) {
th... | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalNullElementsException",
".",
"class",
"}",
")",
"public",
"static",
"<",
"T",
"extends",
"Iterable",
"<",
"?",
">",
">",
"T",
"noNullElements",
"(",
"@... | Ensures that an iterable reference is neither {@code null} nor contains any elements that are {@code null}.
@param iterable
the iterable reference which should not contain {@code null}
@param name
name of object reference (in source code)
@return the passed reference which contains no elements that are {@code null}
@t... | [
"Ensures",
"that",
"an",
"iterable",
"reference",
"is",
"neither",
"{",
"@code",
"null",
"}",
"nor",
"contains",
"any",
"elements",
"that",
"are",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L1842-L1852 |
alkacon/opencms-core | src/org/opencms/publish/CmsPublishManager.java | CmsPublishManager.getPublishList | public CmsPublishList getPublishList(
CmsObject cms,
List<CmsResource> directPublishResources,
boolean directPublishSiblings,
boolean publishSubResources) throws CmsException {
"""
Returns a publish list with all new/changed/deleted resources of the current (offline)
project that a... | java | public CmsPublishList getPublishList(
CmsObject cms,
List<CmsResource> directPublishResources,
boolean directPublishSiblings,
boolean publishSubResources) throws CmsException {
return m_securityManager.fillPublishList(
cms.getRequestContext(),
new CmsPubl... | [
"public",
"CmsPublishList",
"getPublishList",
"(",
"CmsObject",
"cms",
",",
"List",
"<",
"CmsResource",
">",
"directPublishResources",
",",
"boolean",
"directPublishSiblings",
",",
"boolean",
"publishSubResources",
")",
"throws",
"CmsException",
"{",
"return",
"m_securi... | Returns a publish list with all new/changed/deleted resources of the current (offline)
project that actually get published for a direct publish of a List of resources.<p>
@param cms the cms request context
@param directPublishResources the {@link CmsResource} objects which will be directly published
@param directPubli... | [
"Returns",
"a",
"publish",
"list",
"with",
"all",
"new",
"/",
"changed",
"/",
"deleted",
"resources",
"of",
"the",
"current",
"(",
"offline",
")",
"project",
"that",
"actually",
"get",
"published",
"for",
"a",
"direct",
"publish",
"of",
"a",
"List",
"of",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/publish/CmsPublishManager.java#L350-L359 |
prestodb/presto | presto-accumulo/src/main/java/com/facebook/presto/accumulo/io/AccumuloRecordCursor.java | AccumuloRecordCursor.checkFieldType | private void checkFieldType(int field, Type... expected) {
"""
Checks that the given field is one of the provided types.
@param field Ordinal of the field
@param expected An array of expected types
@throws IllegalArgumentException If the given field does not match one of the types
"""
Type actual ... | java | private void checkFieldType(int field, Type... expected)
{
Type actual = getType(field);
for (Type type : expected) {
if (actual.equals(type)) {
return;
}
}
throw new IllegalArgumentException(format("Expected field %s to be a type of %s but is... | [
"private",
"void",
"checkFieldType",
"(",
"int",
"field",
",",
"Type",
"...",
"expected",
")",
"{",
"Type",
"actual",
"=",
"getType",
"(",
"field",
")",
";",
"for",
"(",
"Type",
"type",
":",
"expected",
")",
"{",
"if",
"(",
"actual",
".",
"equals",
"... | Checks that the given field is one of the provided types.
@param field Ordinal of the field
@param expected An array of expected types
@throws IllegalArgumentException If the given field does not match one of the types | [
"Checks",
"that",
"the",
"given",
"field",
"is",
"one",
"of",
"the",
"provided",
"types",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-accumulo/src/main/java/com/facebook/presto/accumulo/io/AccumuloRecordCursor.java#L298-L308 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/PippoSettings.java | PippoSettings.getDurationInMinutes | public long getDurationInMinutes(String name, long defaultValue) {
"""
Gets the duration setting and converts it to minutes.
<p/>
The setting must be use one of the following conventions:
<ul>
<li>n MILLISECONDS
<li>n SECONDS
<li>n MINUTES
<li>n HOURS
<li>n DAYS
</ul>
@param name
@param defaultValue i... | java | public long getDurationInMinutes(String name, long defaultValue) {
TimeUnit timeUnit = extractTimeUnit(name, defaultValue + " MINUTES");
long duration = getLong(name, defaultValue);
return timeUnit.toMinutes(duration);
} | [
"public",
"long",
"getDurationInMinutes",
"(",
"String",
"name",
",",
"long",
"defaultValue",
")",
"{",
"TimeUnit",
"timeUnit",
"=",
"extractTimeUnit",
"(",
"name",
",",
"defaultValue",
"+",
"\" MINUTES\"",
")",
";",
"long",
"duration",
"=",
"getLong",
"(",
"n... | Gets the duration setting and converts it to minutes.
<p/>
The setting must be use one of the following conventions:
<ul>
<li>n MILLISECONDS
<li>n SECONDS
<li>n MINUTES
<li>n HOURS
<li>n DAYS
</ul>
@param name
@param defaultValue in minutes
@return minutes | [
"Gets",
"the",
"duration",
"setting",
"and",
"converts",
"it",
"to",
"minutes",
".",
"<p",
"/",
">",
"The",
"setting",
"must",
"be",
"use",
"one",
"of",
"the",
"following",
"conventions",
":",
"<ul",
">",
"<li",
">",
"n",
"MILLISECONDS",
"<li",
">",
"n... | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L887-L892 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/service/data/process/EngineDataAccessDB.java | EngineDataAccessDB.removeEventWaitForActivityInstance | public void removeEventWaitForActivityInstance(Long activityInstanceId, String reason) throws SQLException {
"""
remove other wait instances when an activity receives one event
"""
String query = "delete from EVENT_WAIT_INSTANCE where EVENT_WAIT_INSTANCE_OWNER_ID=?";
db.runUpdate(query, activit... | java | public void removeEventWaitForActivityInstance(Long activityInstanceId, String reason) throws SQLException {
String query = "delete from EVENT_WAIT_INSTANCE where EVENT_WAIT_INSTANCE_OWNER_ID=?";
db.runUpdate(query, activityInstanceId);
this.recordEventHistory("All Events", EventLog.SUBCAT_DEREG... | [
"public",
"void",
"removeEventWaitForActivityInstance",
"(",
"Long",
"activityInstanceId",
",",
"String",
"reason",
")",
"throws",
"SQLException",
"{",
"String",
"query",
"=",
"\"delete from EVENT_WAIT_INSTANCE where EVENT_WAIT_INSTANCE_OWNER_ID=?\"",
";",
"db",
".",
"runUpda... | remove other wait instances when an activity receives one event | [
"remove",
"other",
"wait",
"instances",
"when",
"an",
"activity",
"receives",
"one",
"event"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/service/data/process/EngineDataAccessDB.java#L621-L628 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/ArtifactManagingServiceImpl.java | ArtifactManagingServiceImpl.importFilesToJCR | private void importFilesToJCR(SessionProvider sp, File folder) throws Exception {
"""
/*
This method provides adding to JCR artifacts. this means that jar-files and appropriate pom
files would be added. Main logic: scan all files & if it is a pair jar/pom -add it.
"""
for (File file : folder.listFiles... | java | private void importFilesToJCR(SessionProvider sp, File folder) throws Exception
{
for (File file : folder.listFiles(new DefaultFileFilter()))
{
if (file.isDirectory())
{
importFilesToJCR(sp, file);
}
String ext = FilenameUtils.getExtension(file.getAbsolu... | [
"private",
"void",
"importFilesToJCR",
"(",
"SessionProvider",
"sp",
",",
"File",
"folder",
")",
"throws",
"Exception",
"{",
"for",
"(",
"File",
"file",
":",
"folder",
".",
"listFiles",
"(",
"new",
"DefaultFileFilter",
"(",
")",
")",
")",
"{",
"if",
"(",
... | /*
This method provides adding to JCR artifacts. this means that jar-files and appropriate pom
files would be added. Main logic: scan all files & if it is a pair jar/pom -add it. | [
"/",
"*",
"This",
"method",
"provides",
"adding",
"to",
"JCR",
"artifacts",
".",
"this",
"means",
"that",
"jar",
"-",
"files",
"and",
"appropriate",
"pom",
"files",
"would",
"be",
"added",
".",
"Main",
"logic",
":",
"scan",
"all",
"files",
"&",
"if",
"... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/ArtifactManagingServiceImpl.java#L482-L519 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AgentRegistrationInformationsInner.java | AgentRegistrationInformationsInner.regenerateKey | public AgentRegistrationInner regenerateKey(String resourceGroupName, String automationAccountName, AgentRegistrationRegenerateKeyParameter parameters) {
"""
Regenerate a primary or secondary agent registration key.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name... | java | public AgentRegistrationInner regenerateKey(String resourceGroupName, String automationAccountName, AgentRegistrationRegenerateKeyParameter parameters) {
return regenerateKeyWithServiceResponseAsync(resourceGroupName, automationAccountName, parameters).toBlocking().single().body();
} | [
"public",
"AgentRegistrationInner",
"regenerateKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"AgentRegistrationRegenerateKeyParameter",
"parameters",
")",
"{",
"return",
"regenerateKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",... | Regenerate a primary or secondary agent registration key.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param parameters The name of the agent registration key to be regenerated
@throws IllegalArgumentException thrown if parameters fail the ... | [
"Regenerate",
"a",
"primary",
"or",
"secondary",
"agent",
"registration",
"key",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AgentRegistrationInformationsInner.java#L163-L165 |
Samsung/GearVRf | GVRf/Extensions/3DCursor/IODevices/io_hand_template/src/main/java/com/sample/hand/template/IOBaseComponent.java | IOBaseComponent.setRotation | public void setRotation(float w, float x, float y, float z) {
"""
Set the rotation for the {@link IOBaseComponent}
@param w the w value of the quaternion
@param x the x value of the quaternion
@param y the y value of the quaternion
@param z the z value of the quaternion
"""
componentRotation.set(... | java | public void setRotation(float w, float x, float y, float z) {
componentRotation.set(w, x, y, z);
if (sceneObject != null) {
sceneObject.getTransform().setRotation(w, x, y, z);
}
} | [
"public",
"void",
"setRotation",
"(",
"float",
"w",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"componentRotation",
".",
"set",
"(",
"w",
",",
"x",
",",
"y",
",",
"z",
")",
";",
"if",
"(",
"sceneObject",
"!=",
"null",
")",... | Set the rotation for the {@link IOBaseComponent}
@param w the w value of the quaternion
@param x the x value of the quaternion
@param y the y value of the quaternion
@param z the z value of the quaternion | [
"Set",
"the",
"rotation",
"for",
"the",
"{",
"@link",
"IOBaseComponent",
"}"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/3DCursor/IODevices/io_hand_template/src/main/java/com/sample/hand/template/IOBaseComponent.java#L73-L78 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java | ConstructorBuilder.buildSignature | public void buildSignature(XMLNode node, Content constructorDocTree) {
"""
Build the signature.
@param node the XML element that specifies which components to document
@param constructorDocTree the content tree to which the documentation will be added
"""
constructorDocTree.addContent(writer.getSig... | java | public void buildSignature(XMLNode node, Content constructorDocTree) {
constructorDocTree.addContent(writer.getSignature(currentConstructor));
} | [
"public",
"void",
"buildSignature",
"(",
"XMLNode",
"node",
",",
"Content",
"constructorDocTree",
")",
"{",
"constructorDocTree",
".",
"addContent",
"(",
"writer",
".",
"getSignature",
"(",
"currentConstructor",
")",
")",
";",
"}"
] | Build the signature.
@param node the XML element that specifies which components to document
@param constructorDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"signature",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java#L179-L181 |
h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/descriptor/JsonModelDescriptorReader.java | JsonModelDescriptorReader.findInJson | private static JsonElement findInJson(JsonElement jsonElement, String jsonPath) {
"""
Finds an element in GSON's JSON document representation
@param jsonElement A (potentially complex) element to search in
@param jsonPath Path in the given JSON to the desired table. Levels are dot-separated.
E.g. 'model._o... | java | private static JsonElement findInJson(JsonElement jsonElement, String jsonPath) {
final String[] route = JSON_PATH_PATTERN.split(jsonPath);
JsonElement result = jsonElement;
for (String key : route) {
key = key.trim();
if (key.isEmpty())
continue;
... | [
"private",
"static",
"JsonElement",
"findInJson",
"(",
"JsonElement",
"jsonElement",
",",
"String",
"jsonPath",
")",
"{",
"final",
"String",
"[",
"]",
"route",
"=",
"JSON_PATH_PATTERN",
".",
"split",
"(",
"jsonPath",
")",
";",
"JsonElement",
"result",
"=",
"js... | Finds an element in GSON's JSON document representation
@param jsonElement A (potentially complex) element to search in
@param jsonPath Path in the given JSON to the desired table. Levels are dot-separated.
E.g. 'model._output.variable_importances'.
@return JsonElement, if found. Otherwise {@link JsonNull}. | [
"Finds",
"an",
"element",
"in",
"GSON",
"s",
"JSON",
"document",
"representation"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/descriptor/JsonModelDescriptorReader.java#L103-L127 |
sdl/odata | odata_client_api/src/main/java/com/sdl/odata/client/property/PropertyUtils.java | PropertyUtils.getStringProperty | public static String getStringProperty(Properties properties, String key) {
"""
Get a string property from the properties.
@param properties the provided properties
@return the string property
"""
String property = properties.getProperty(key);
return property != null && property.trim().isEm... | java | public static String getStringProperty(Properties properties, String key) {
String property = properties.getProperty(key);
return property != null && property.trim().isEmpty() ? null : property;
} | [
"public",
"static",
"String",
"getStringProperty",
"(",
"Properties",
"properties",
",",
"String",
"key",
")",
"{",
"String",
"property",
"=",
"properties",
".",
"getProperty",
"(",
"key",
")",
";",
"return",
"property",
"!=",
"null",
"&&",
"property",
".",
... | Get a string property from the properties.
@param properties the provided properties
@return the string property | [
"Get",
"a",
"string",
"property",
"from",
"the",
"properties",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_client_api/src/main/java/com/sdl/odata/client/property/PropertyUtils.java#L67-L70 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getClosedListAsync | public Observable<ClosedListEntityExtractor> getClosedListAsync(UUID appId, String versionId, UUID clEntityId) {
"""
Gets information of a closed list model.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list model ID.
@throws IllegalArgumentException thrown i... | java | public Observable<ClosedListEntityExtractor> getClosedListAsync(UUID appId, String versionId, UUID clEntityId) {
return getClosedListWithServiceResponseAsync(appId, versionId, clEntityId).map(new Func1<ServiceResponse<ClosedListEntityExtractor>, ClosedListEntityExtractor>() {
@Override
p... | [
"public",
"Observable",
"<",
"ClosedListEntityExtractor",
">",
"getClosedListAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"clEntityId",
")",
"{",
"return",
"getClosedListWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"clEntit... | Gets information of a closed list model.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list model ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ClosedListEntityExtractor object | [
"Gets",
"information",
"of",
"a",
"closed",
"list",
"model",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L4245-L4252 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.order_orderId_refund_GET | public OvhRefund order_orderId_refund_GET(Long orderId) throws IOException {
"""
Get this object properties
REST: GET /me/order/{orderId}/refund
@param orderId [required]
"""
String qPath = "/me/order/{orderId}/refund";
StringBuilder sb = path(qPath, orderId);
String resp = exec(qPath, "GET", sb.toSt... | java | public OvhRefund order_orderId_refund_GET(Long orderId) throws IOException {
String qPath = "/me/order/{orderId}/refund";
StringBuilder sb = path(qPath, orderId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhRefund.class);
} | [
"public",
"OvhRefund",
"order_orderId_refund_GET",
"(",
"Long",
"orderId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/order/{orderId}/refund\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"orderId",
")",
";",
"String",
"resp... | Get this object properties
REST: GET /me/order/{orderId}/refund
@param orderId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1828-L1833 |
dyu/protostuff-1.0.x | protostuff-me/src/main/java/com/dyuproject/protostuff/me/ProtostuffIOUtil.java | ProtostuffIOUtil.parseListFrom | public static Vector parseListFrom(final InputStream in, final Schema schema)
throws IOException {
"""
Parses the {@code messages} (delimited) from the {@link InputStream}
using the given {@code schema}.
@return the list containing the messages.
"""
int size = in.read();
if(size == ... | java | public static Vector parseListFrom(final InputStream in, final Schema schema)
throws IOException
{
int size = in.read();
if(size == -1)
return new Vector();
if(size > 0x7f)
size = CodedInput.readRawVarint32(in, size);
final Vec... | [
"public",
"static",
"Vector",
"parseListFrom",
"(",
"final",
"InputStream",
"in",
",",
"final",
"Schema",
"schema",
")",
"throws",
"IOException",
"{",
"int",
"size",
"=",
"in",
".",
"read",
"(",
")",
";",
"if",
"(",
"size",
"==",
"-",
"1",
")",
"return... | Parses the {@code messages} (delimited) from the {@link InputStream}
using the given {@code schema}.
@return the list containing the messages. | [
"Parses",
"the",
"{",
"@code",
"messages",
"}",
"(",
"delimited",
")",
"from",
"the",
"{",
"@link",
"InputStream",
"}",
"using",
"the",
"given",
"{",
"@code",
"schema",
"}",
"."
] | train | https://github.com/dyu/protostuff-1.0.x/blob/d7c964ec20da3fe44699d86ee95c2677ddffde96/protostuff-me/src/main/java/com/dyuproject/protostuff/me/ProtostuffIOUtil.java#L305-L328 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java | Agg.minBy | public static <T, U> Collector<T, ?, Optional<T>> minBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
"""
Get a {@link Collector} that calculates the <code>MIN()</code> function.
"""
return maxBy(function, comparator.reversed());
} | java | public static <T, U> Collector<T, ?, Optional<T>> minBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
return maxBy(function, comparator.reversed());
} | [
"public",
"static",
"<",
"T",
",",
"U",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Optional",
"<",
"T",
">",
">",
"minBy",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"U",
">",
"function",
",",
"Comparator",
"<",
"?",
"super",
... | Get a {@link Collector} that calculates the <code>MIN()</code> function. | [
"Get",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java#L214-L216 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheListUtil.java | CacheListUtil.isEmpty | public static Single<Boolean> isEmpty(CacheConfigBean cacheConfigBean, String cacheKey) {
"""
check whether the cached list is empty or not.
@param cacheConfigBean the data source of the cache
@param cacheKey the key for the cached list
@return true is the cached list is empty or does not exists, other... | java | public static Single<Boolean> isEmpty(CacheConfigBean cacheConfigBean, String cacheKey) {
return length(cacheConfigBean, cacheKey).map(length -> length == 0);
} | [
"public",
"static",
"Single",
"<",
"Boolean",
">",
"isEmpty",
"(",
"CacheConfigBean",
"cacheConfigBean",
",",
"String",
"cacheKey",
")",
"{",
"return",
"length",
"(",
"cacheConfigBean",
",",
"cacheKey",
")",
".",
"map",
"(",
"length",
"->",
"length",
"==",
"... | check whether the cached list is empty or not.
@param cacheConfigBean the data source of the cache
@param cacheKey the key for the cached list
@return true is the cached list is empty or does not exists, other wise false. | [
"check",
"whether",
"the",
"cached",
"list",
"is",
"empty",
"or",
"not",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheListUtil.java#L93-L95 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/StringUtils.java | StringUtils.trimTo | public static String trimTo(final String aString, final String aDefault) {
"""
Trims a string; if there is nothing left after the trimming, returns whatever the default value passed in is.
@param aString The string to be trimmed
@param aDefault A default string to return if a null string is passed in
@return ... | java | public static String trimTo(final String aString, final String aDefault) {
if (aString == null) {
return aDefault;
}
final String trimmed = aString.trim();
return trimmed.length() == 0 ? aDefault : trimmed;
} | [
"public",
"static",
"String",
"trimTo",
"(",
"final",
"String",
"aString",
",",
"final",
"String",
"aDefault",
")",
"{",
"if",
"(",
"aString",
"==",
"null",
")",
"{",
"return",
"aDefault",
";",
"}",
"final",
"String",
"trimmed",
"=",
"aString",
".",
"tri... | Trims a string; if there is nothing left after the trimming, returns whatever the default value passed in is.
@param aString The string to be trimmed
@param aDefault A default string to return if a null string is passed in
@return The trimmed string or the default value if string is empty | [
"Trims",
"a",
"string",
";",
"if",
"there",
"is",
"nothing",
"left",
"after",
"the",
"trimming",
"returns",
"whatever",
"the",
"default",
"value",
"passed",
"in",
"is",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/StringUtils.java#L68-L75 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Collectors.java | Collectors.maxAll | @SuppressWarnings("rawtypes")
public static <T extends Comparable> Collector<T, ?, List<T>> maxAll(final boolean areAllLargestSame) {
"""
Use occurrences to save the count of largest objects if {@code areAllLargestSame = true}(e.g. {@code Number/String/...}) and return a list by repeat the largest object {@co... | java | @SuppressWarnings("rawtypes")
public static <T extends Comparable> Collector<T, ?, List<T>> maxAll(final boolean areAllLargestSame) {
return maxAll(Integer.MAX_VALUE, areAllLargestSame);
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Comparable",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"List",
"<",
"T",
">",
">",
"maxAll",
"(",
"final",
"boolean",
"areAllLargestSame",
")",
"{",
"return",
"... | Use occurrences to save the count of largest objects if {@code areAllLargestSame = true}(e.g. {@code Number/String/...}) and return a list by repeat the largest object {@code n} times.
@param areAllLargestSame
@return
@see Collectors#maxAll(Comparator, int, boolean) | [
"Use",
"occurrences",
"to",
"save",
"the",
"count",
"of",
"largest",
"objects",
"if",
"{",
"@code",
"areAllLargestSame",
"=",
"true",
"}",
"(",
"e",
".",
"g",
".",
"{",
"@code",
"Number",
"/",
"String",
"/",
"...",
"}",
")",
"and",
"return",
"a",
"li... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Collectors.java#L2173-L2176 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/lang/Strings.java | Strings.removeWord | public static String removeWord(final String host, final String word, final String delimiter) {
"""
<p>
removeWord.
</p>
@param host
a {@link java.lang.String} object.
@param word
a {@link java.lang.String} object.
@param delimiter
a {@link java.lang.String} object.
@return a {@link java.lang.String} ob... | java | public static String removeWord(final String host, final String word, final String delimiter) {
if (host.indexOf(word) == -1) {
return host;
} else {
int beginIndex = host.indexOf(word);
int endIndex = beginIndex + word.length();
if (beginIndex == 0) { return host.substring(endIndex + 1)... | [
"public",
"static",
"String",
"removeWord",
"(",
"final",
"String",
"host",
",",
"final",
"String",
"word",
",",
"final",
"String",
"delimiter",
")",
"{",
"if",
"(",
"host",
".",
"indexOf",
"(",
"word",
")",
"==",
"-",
"1",
")",
"{",
"return",
"host",
... | <p>
removeWord.
</p>
@param host
a {@link java.lang.String} object.
@param word
a {@link java.lang.String} object.
@param delimiter
a {@link java.lang.String} object.
@return a {@link java.lang.String} object. | [
"<p",
">",
"removeWord",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/lang/Strings.java#L648-L663 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/jta/UserTransactionFactory.java | UserTransactionFactory.getReference | public static Reference getReference(Serializable object) throws NamingException {
"""
Method to return reference for serialized object.(i.e.
KunderJTAUserTransaction)
@param object
serilized object.
@return reference to that object.
@throws NamingException
naming exception.
"""
ByteArrayOutput... | java | public static Reference getReference(Serializable object) throws NamingException
{
ByteArrayOutputStream outStream;
try
{
outStream = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(outStream);
out.writeObject(object);
... | [
"public",
"static",
"Reference",
"getReference",
"(",
"Serializable",
"object",
")",
"throws",
"NamingException",
"{",
"ByteArrayOutputStream",
"outStream",
";",
"try",
"{",
"outStream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"ObjectOutputStream",
"out",
... | Method to return reference for serialized object.(i.e.
KunderJTAUserTransaction)
@param object
serilized object.
@return reference to that object.
@throws NamingException
naming exception. | [
"Method",
"to",
"return",
"reference",
"for",
"serialized",
"object",
".",
"(",
"i",
".",
"e",
".",
"KunderJTAUserTransaction",
")"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/jta/UserTransactionFactory.java#L84-L102 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.vps_serviceName_plesk_GET | public ArrayList<String> vps_serviceName_plesk_GET(String serviceName, OvhPleskLicenseDomainNumberEnum domainNumber) throws IOException {
"""
Get allowed durations for 'plesk' option
REST: GET /order/vps/{serviceName}/plesk
@param domainNumber [required] Domain number you want to order a licence for
@param se... | java | public ArrayList<String> vps_serviceName_plesk_GET(String serviceName, OvhPleskLicenseDomainNumberEnum domainNumber) throws IOException {
String qPath = "/order/vps/{serviceName}/plesk";
StringBuilder sb = path(qPath, serviceName);
query(sb, "domainNumber", domainNumber);
String resp = exec(qPath, "GET", sb.toS... | [
"public",
"ArrayList",
"<",
"String",
">",
"vps_serviceName_plesk_GET",
"(",
"String",
"serviceName",
",",
"OvhPleskLicenseDomainNumberEnum",
"domainNumber",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/vps/{serviceName}/plesk\"",
";",
"StringBuilder... | Get allowed durations for 'plesk' option
REST: GET /order/vps/{serviceName}/plesk
@param domainNumber [required] Domain number you want to order a licence for
@param serviceName [required] The internal name of your VPS offer
@deprecated | [
"Get",
"allowed",
"durations",
"for",
"plesk",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L3308-L3314 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/SessionUtil.java | SessionUtil.handleFederatedFlowError | private static void handleFederatedFlowError(LoginInput loginInput, Exception ex)
throws SnowflakeSQLException {
"""
Logs an error generated during the federated authentication flow and
re-throws it as a SnowflakeSQLException.
Note that we seperate IOExceptions since those tend to be network related.
@param... | java | private static void handleFederatedFlowError(LoginInput loginInput, Exception ex)
throws SnowflakeSQLException
{
if (ex instanceof IOException)
{
logger.error("IOException when authenticating with " +
loginInput.getAuthenticator(), ex);
throw new SnowflakeSQLException(ex, Sql... | [
"private",
"static",
"void",
"handleFederatedFlowError",
"(",
"LoginInput",
"loginInput",
",",
"Exception",
"ex",
")",
"throws",
"SnowflakeSQLException",
"{",
"if",
"(",
"ex",
"instanceof",
"IOException",
")",
"{",
"logger",
".",
"error",
"(",
"\"IOException when au... | Logs an error generated during the federated authentication flow and
re-throws it as a SnowflakeSQLException.
Note that we seperate IOExceptions since those tend to be network related.
@param loginInput
@param ex
@throws SnowflakeSQLException | [
"Logs",
"an",
"error",
"generated",
"during",
"the",
"federated",
"authentication",
"flow",
"and",
"re",
"-",
"throws",
"it",
"as",
"a",
"SnowflakeSQLException",
".",
"Note",
"that",
"we",
"seperate",
"IOExceptions",
"since",
"those",
"tend",
"to",
"be",
"netw... | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/SessionUtil.java#L1352-L1371 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java | DocumentSubscriptions.getSubscriptionWorkerForRevisions | public <T> SubscriptionWorker<Revision<T>> getSubscriptionWorkerForRevisions(Class<T> clazz, SubscriptionWorkerOptions options) {
"""
It opens a subscription and starts pulling documents since a last processed document for that subscription.
The connection options determine client and server cooperation rules lik... | java | public <T> SubscriptionWorker<Revision<T>> getSubscriptionWorkerForRevisions(Class<T> clazz, SubscriptionWorkerOptions options) {
return getSubscriptionWorkerForRevisions(clazz, options, null);
} | [
"public",
"<",
"T",
">",
"SubscriptionWorker",
"<",
"Revision",
"<",
"T",
">",
">",
"getSubscriptionWorkerForRevisions",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"SubscriptionWorkerOptions",
"options",
")",
"{",
"return",
"getSubscriptionWorkerForRevisions",
"(",
... | It opens a subscription and starts pulling documents since a last processed document for that subscription.
The connection options determine client and server cooperation rules like document batch sizes or a timeout in a matter of which a client
needs to acknowledge that batch has been processed. The acknowledgment is ... | [
"It",
"opens",
"a",
"subscription",
"and",
"starts",
"pulling",
"documents",
"since",
"a",
"last",
"processed",
"document",
"for",
"that",
"subscription",
".",
"The",
"connection",
"options",
"determine",
"client",
"and",
"server",
"cooperation",
"rules",
"like",
... | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java#L281-L283 |
RuedigerMoeller/kontraktor | modules/kontraktor-bare/src/main/java/org/nustaq/kontraktor/barebone/Promise.java | Promise.complete | public void complete( T result, Object error ) {
"""
to be called by code returning an result or error.
@param result
@param error
"""
synchronized (this) {
if ( isComplete ) {
throw new RuntimeException("Promise can be completed only once");
}
th... | java | public void complete( T result, Object error ) {
synchronized (this) {
if ( isComplete ) {
throw new RuntimeException("Promise can be completed only once");
}
this.result = result;
this.error = error;
isComplete = true;
tryF... | [
"public",
"void",
"complete",
"(",
"T",
"result",
",",
"Object",
"error",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"isComplete",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Promise can be completed only once\"",
")",
";",
"}",
"t... | to be called by code returning an result or error.
@param result
@param error | [
"to",
"be",
"called",
"by",
"code",
"returning",
"an",
"result",
"or",
"error",
"."
] | train | https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/modules/kontraktor-bare/src/main/java/org/nustaq/kontraktor/barebone/Promise.java#L59-L69 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.deleteStorageAccount | public DeletedStorageBundle deleteStorageAccount(String vaultBaseUrl, String storageAccountName) {
"""
Deletes a storage account. This operation requires the storage/delete permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the sto... | java | public DeletedStorageBundle deleteStorageAccount(String vaultBaseUrl, String storageAccountName) {
return deleteStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).toBlocking().single().body();
} | [
"public",
"DeletedStorageBundle",
"deleteStorageAccount",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
")",
"{",
"return",
"deleteStorageAccountWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"storageAccountName",
")",
".",
"toBlocking",
"(",
")"... | Deletes a storage account. This operation requires the storage/delete permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws KeyVaultErrorEx... | [
"Deletes",
"a",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"delete",
"permission",
"."
] | 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#L9697-L9699 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | StrBuilder.indexOf | public int indexOf(final StrMatcher matcher, int startIndex) {
"""
Searches the string builder using the matcher to find the first
match searching from the given index.
<p>
Matchers can be used to perform advanced searching behaviour.
For example you could write a matcher to find the character 'a'
followed by... | java | public int indexOf(final StrMatcher matcher, int startIndex) {
startIndex = (startIndex < 0 ? 0 : startIndex);
if (matcher == null || startIndex >= size) {
return -1;
}
final int len = size;
final char[] buf = buffer;
for (int i = startIndex; i < len; i++) {
... | [
"public",
"int",
"indexOf",
"(",
"final",
"StrMatcher",
"matcher",
",",
"int",
"startIndex",
")",
"{",
"startIndex",
"=",
"(",
"startIndex",
"<",
"0",
"?",
"0",
":",
"startIndex",
")",
";",
"if",
"(",
"matcher",
"==",
"null",
"||",
"startIndex",
">=",
... | Searches the string builder using the matcher to find the first
match searching from the given index.
<p>
Matchers can be used to perform advanced searching behaviour.
For example you could write a matcher to find the character 'a'
followed by a number.
@param matcher the matcher to use, null returns -1
@param startI... | [
"Searches",
"the",
"string",
"builder",
"using",
"the",
"matcher",
"to",
"find",
"the",
"first",
"match",
"searching",
"from",
"the",
"given",
"index",
".",
"<p",
">",
"Matchers",
"can",
"be",
"used",
"to",
"perform",
"advanced",
"searching",
"behaviour",
".... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2508-L2521 |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java | AlexaInput.hasSlotIsPhoneticallyEqual | public boolean hasSlotIsPhoneticallyEqual(final String slotName, final String value) {
"""
Checks if a slot is contained in the intent request and has a value which is a
phonetic sibling of the string given to this method. This method picks the correct
algorithm depending on the locale coming in with the speechl... | java | public boolean hasSlotIsPhoneticallyEqual(final String slotName, final String value) {
return getLocale().equals("de-DE") ? hasSlotIsCologneEqual(slotName, value) :
hasSlotIsDoubleMetaphoneEqual(slotName, value);
} | [
"public",
"boolean",
"hasSlotIsPhoneticallyEqual",
"(",
"final",
"String",
"slotName",
",",
"final",
"String",
"value",
")",
"{",
"return",
"getLocale",
"(",
")",
".",
"equals",
"(",
"\"de-DE\"",
")",
"?",
"hasSlotIsCologneEqual",
"(",
"slotName",
",",
"value",
... | Checks if a slot is contained in the intent request and has a value which is a
phonetic sibling of the string given to this method. This method picks the correct
algorithm depending on the locale coming in with the speechlet request. For example the
German locale compares the slot value and the given value with the Col... | [
"Checks",
"if",
"a",
"slot",
"is",
"contained",
"in",
"the",
"intent",
"request",
"and",
"has",
"a",
"value",
"which",
"is",
"a",
"phonetic",
"sibling",
"of",
"the",
"string",
"given",
"to",
"this",
"method",
".",
"This",
"method",
"picks",
"the",
"corre... | train | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L169-L172 |
c2nes/ircbot | brewtab-irc/src/main/java/com/brewtab/irc/impl/ChannelImpl.java | ChannelImpl.refreshNames | public void refreshNames() {
"""
Makes a NAMES request to the server for this channel. Store the result
replacing any existing names list. The list can be retrieved with
IRCChannel#getNames
"""
Message namesMessage = new Message(MessageType.NAMES, this.channelName);
List<Message> response;
... | java | public void refreshNames() {
Message namesMessage = new Message(MessageType.NAMES, this.channelName);
List<Message> response;
try {
response = connection.request(
MessageFilters.message(MessageType.RPL_NAMREPLY, null, "=", channelName),
MessageFilters... | [
"public",
"void",
"refreshNames",
"(",
")",
"{",
"Message",
"namesMessage",
"=",
"new",
"Message",
"(",
"MessageType",
".",
"NAMES",
",",
"this",
".",
"channelName",
")",
";",
"List",
"<",
"Message",
">",
"response",
";",
"try",
"{",
"response",
"=",
"co... | Makes a NAMES request to the server for this channel. Store the result
replacing any existing names list. The list can be retrieved with
IRCChannel#getNames | [
"Makes",
"a",
"NAMES",
"request",
"to",
"the",
"server",
"for",
"this",
"channel",
".",
"Store",
"the",
"result",
"replacing",
"any",
"existing",
"names",
"list",
".",
"The",
"list",
"can",
"be",
"retrieved",
"with",
"IRCChannel#getNames"
] | train | https://github.com/c2nes/ircbot/blob/29cfc5b921ceee2a35e7d6077c5660e6db63ef35/brewtab-irc/src/main/java/com/brewtab/irc/impl/ChannelImpl.java#L203-L229 |
infinispan/infinispan | core/src/main/java/org/infinispan/distribution/ch/impl/ScatteredConsistentHashFactory.java | ScatteredConsistentHashFactory.union | @Override
public ScatteredConsistentHash union(ScatteredConsistentHash dch1, ScatteredConsistentHash dch2) {
"""
Merges two consistent hash objects that have the same number of segments, numOwners and hash function.
For each segment, the primary owner of the first CH has priority, the other primary owners beco... | java | @Override
public ScatteredConsistentHash union(ScatteredConsistentHash dch1, ScatteredConsistentHash dch2) {
return dch1.union(dch2);
} | [
"@",
"Override",
"public",
"ScatteredConsistentHash",
"union",
"(",
"ScatteredConsistentHash",
"dch1",
",",
"ScatteredConsistentHash",
"dch2",
")",
"{",
"return",
"dch1",
".",
"union",
"(",
"dch2",
")",
";",
"}"
] | Merges two consistent hash objects that have the same number of segments, numOwners and hash function.
For each segment, the primary owner of the first CH has priority, the other primary owners become backups. | [
"Merges",
"two",
"consistent",
"hash",
"objects",
"that",
"have",
"the",
"same",
"number",
"of",
"segments",
"numOwners",
"and",
"hash",
"function",
".",
"For",
"each",
"segment",
"the",
"primary",
"owner",
"of",
"the",
"first",
"CH",
"has",
"priority",
"the... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/distribution/ch/impl/ScatteredConsistentHashFactory.java#L101-L104 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/server/AzkabanServer.java | AzkabanServer.loadConfigurationFromAzkabanHome | private static Props loadConfigurationFromAzkabanHome() {
"""
Loads the Azkaban property file from the AZKABAN_HOME conf directory
@return Props instance
"""
final String azkabanHome = System.getenv("AZKABAN_HOME");
if (azkabanHome == null) {
logger.error("AZKABAN_HOME not set. Will try defau... | java | private static Props loadConfigurationFromAzkabanHome() {
final String azkabanHome = System.getenv("AZKABAN_HOME");
if (azkabanHome == null) {
logger.error("AZKABAN_HOME not set. Will try default.");
return null;
}
if (!new File(azkabanHome).isDirectory() || !new File(azkabanHome).canRead()... | [
"private",
"static",
"Props",
"loadConfigurationFromAzkabanHome",
"(",
")",
"{",
"final",
"String",
"azkabanHome",
"=",
"System",
".",
"getenv",
"(",
"\"AZKABAN_HOME\"",
")",
";",
"if",
"(",
"azkabanHome",
"==",
"null",
")",
"{",
"logger",
".",
"error",
"(",
... | Loads the Azkaban property file from the AZKABAN_HOME conf directory
@return Props instance | [
"Loads",
"the",
"Azkaban",
"property",
"file",
"from",
"the",
"AZKABAN_HOME",
"conf",
"directory"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/server/AzkabanServer.java#L126-L145 |
phax/ph-css | ph-css/src/main/java/com/helger/css/reader/CSSReaderDeclarationList.java | CSSReaderDeclarationList.readFromReader | @Nullable
public static CSSDeclarationList readFromReader (@Nonnull @WillClose final Reader aReader,
@Nonnull final ECSSVersion eVersion) {
"""
Read the CSS from the passed {@link Reader}.
@param aReader
The reader to use. Will be closed automatically after ... | java | @Nullable
public static CSSDeclarationList readFromReader (@Nonnull @WillClose final Reader aReader,
@Nonnull final ECSSVersion eVersion)
{
return readFromReader (aReader, new CSSReaderSettings ().setCSSVersion (eVersion));
} | [
"@",
"Nullable",
"public",
"static",
"CSSDeclarationList",
"readFromReader",
"(",
"@",
"Nonnull",
"@",
"WillClose",
"final",
"Reader",
"aReader",
",",
"@",
"Nonnull",
"final",
"ECSSVersion",
"eVersion",
")",
"{",
"return",
"readFromReader",
"(",
"aReader",
",",
... | Read the CSS from the passed {@link Reader}.
@param aReader
The reader to use. Will be closed automatically after reading -
independent of success or error. May not be <code>null</code>.
@param eVersion
The CSS version to use. May not be <code>null</code>.
@return <code>null</code> if reading failed, the CSS declarati... | [
"Read",
"the",
"CSS",
"from",
"the",
"passed",
"{",
"@link",
"Reader",
"}",
"."
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/reader/CSSReaderDeclarationList.java#L663-L668 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java | DecimalFormat.getEquivalentDecimals | private UnicodeSet getEquivalentDecimals(String decimal, boolean strictParse) {
"""
Returns a set of characters equivalent to the given desimal separator used for
parsing number. This method may return an empty set.
"""
UnicodeSet equivSet = UnicodeSet.EMPTY;
if (strictParse) {
if... | java | private UnicodeSet getEquivalentDecimals(String decimal, boolean strictParse) {
UnicodeSet equivSet = UnicodeSet.EMPTY;
if (strictParse) {
if (strictDotEquivalents.contains(decimal)) {
equivSet = strictDotEquivalents;
} else if (strictCommaEquivalents.contains(dec... | [
"private",
"UnicodeSet",
"getEquivalentDecimals",
"(",
"String",
"decimal",
",",
"boolean",
"strictParse",
")",
"{",
"UnicodeSet",
"equivSet",
"=",
"UnicodeSet",
".",
"EMPTY",
";",
"if",
"(",
"strictParse",
")",
"{",
"if",
"(",
"strictDotEquivalents",
".",
"cont... | Returns a set of characters equivalent to the given desimal separator used for
parsing number. This method may return an empty set. | [
"Returns",
"a",
"set",
"of",
"characters",
"equivalent",
"to",
"the",
"given",
"desimal",
"separator",
"used",
"for",
"parsing",
"number",
".",
"This",
"method",
"may",
"return",
"an",
"empty",
"set",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java#L2824-L2840 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/types/SampleCount.java | SampleCount.valueOf | public static SampleCount valueOf(final String countAndRate) {
"""
Parse a sample count & timebase as <code>samples@[str_timebase|nom[:denom]]</code>
N.B. This does NOT consider the case where only a sample count is specified: it MUST include a timebase
@param countAndRate
A sample count and a time base. The... | java | public static SampleCount valueOf(final String countAndRate)
{
if (countAndRate == null)
return null;
final String[] parts = countAndRate.split("@");
if (parts.length == 2)
{
final long samples = Long.parseLong(parts[0]);
final Timebase timebase = Timebase.getInstance(parts[1]);
return new Sampl... | [
"public",
"static",
"SampleCount",
"valueOf",
"(",
"final",
"String",
"countAndRate",
")",
"{",
"if",
"(",
"countAndRate",
"==",
"null",
")",
"return",
"null",
";",
"final",
"String",
"[",
"]",
"parts",
"=",
"countAndRate",
".",
"split",
"(",
"\"@\"",
")",... | Parse a sample count & timebase as <code>samples@[str_timebase|nom[:denom]]</code>
N.B. This does NOT consider the case where only a sample count is specified: it MUST include a timebase
@param countAndRate
A sample count and a time base. The syntax is {number of samples}@{textual representation of time base} 124222@... | [
"Parse",
"a",
"sample",
"count",
"&",
"timebase",
"as",
"<code",
">",
"samples@",
"[",
"str_timebase|nom",
"[",
":",
"denom",
"]]",
"<",
"/",
"code",
">",
"N",
".",
"B",
".",
"This",
"does",
"NOT",
"consider",
"the",
"case",
"where",
"only",
"a",
"sa... | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/SampleCount.java#L202-L222 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/ReflectApiUtil.java | ReflectApiUtil.newInstanceForClassName | public static Object newInstanceForClassName(final String className) {
"""
Find class for name and make an instance through call of the default constructor.
@param className the class name to be instantiated, must not be null
@return new instance of the class, must not be null
@throws Error if it is impossibl... | java | public static Object newInstanceForClassName(final String className) {
try {
return newInstance(Class.forName(className));
} catch (Exception ex) {
throw new Error(String.format("Can't create instance of %s for error %s", className, ex.getMessage()), ex);
}
} | [
"public",
"static",
"Object",
"newInstanceForClassName",
"(",
"final",
"String",
"className",
")",
"{",
"try",
"{",
"return",
"newInstance",
"(",
"Class",
".",
"forName",
"(",
"className",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"thr... | Find class for name and make an instance through call of the default constructor.
@param className the class name to be instantiated, must not be null
@return new instance of the class, must not be null
@throws Error if it is impossible to build instance for an exception | [
"Find",
"class",
"for",
"name",
"and",
"make",
"an",
"instance",
"through",
"call",
"of",
"the",
"default",
"constructor",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/ReflectApiUtil.java#L68-L74 |
alkacon/opencms-core | src/org/opencms/ui/apps/CmsFileExplorer.java | CmsFileExplorer.readTreeLevel | void readTreeLevel(CmsUUID parentId, String openPathFragment) {
"""
Reads the given tree level.<p>
@param parentId the parent id
@param openPathFragment the open path fragment
"""
CmsObject cms = A_CmsUI.getCmsObject();
boolean openedFragment = false;
try {
CmsResource ... | java | void readTreeLevel(CmsUUID parentId, String openPathFragment) {
CmsObject cms = A_CmsUI.getCmsObject();
boolean openedFragment = false;
try {
CmsResource parent = cms.readResource(parentId, CmsResourceFilter.IGNORE_EXPIRATION);
String folderPath = cms.getSitePath(parent)... | [
"void",
"readTreeLevel",
"(",
"CmsUUID",
"parentId",
",",
"String",
"openPathFragment",
")",
"{",
"CmsObject",
"cms",
"=",
"A_CmsUI",
".",
"getCmsObject",
"(",
")",
";",
"boolean",
"openedFragment",
"=",
"false",
";",
"try",
"{",
"CmsResource",
"parent",
"=",
... | Reads the given tree level.<p>
@param parentId the parent id
@param openPathFragment the open path fragment | [
"Reads",
"the",
"given",
"tree",
"level",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/CmsFileExplorer.java#L1539-L1567 |
opentelecoms-org/jsmpp | jsmpp/src/main/java/org/jsmpp/session/SMPPSession.java | SMPPSession.connectAndBind | public String connectAndBind(String host, int port,
BindParameter bindParam)
throws IOException {
"""
Open connection and bind immediately.
@param host is the SMSC host address.
@param port is the SMSC listen port.
@param bindParam is the bind parameters.
@return the SMSC system id.
... | java | public String connectAndBind(String host, int port,
BindParameter bindParam)
throws IOException {
return connectAndBind(host, port, bindParam, 60000);
} | [
"public",
"String",
"connectAndBind",
"(",
"String",
"host",
",",
"int",
"port",
",",
"BindParameter",
"bindParam",
")",
"throws",
"IOException",
"{",
"return",
"connectAndBind",
"(",
"host",
",",
"port",
",",
"bindParam",
",",
"60000",
")",
";",
"}"
] | Open connection and bind immediately.
@param host is the SMSC host address.
@param port is the SMSC listen port.
@param bindParam is the bind parameters.
@return the SMSC system id.
@throws IOException if there is an IO error found. | [
"Open",
"connection",
"and",
"bind",
"immediately",
"."
] | train | https://github.com/opentelecoms-org/jsmpp/blob/acc15e73e7431deabc803731971b15323315baaf/jsmpp/src/main/java/org/jsmpp/session/SMPPSession.java#L198-L202 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/dispatching/composing/PipelinedBinaryConsumer.java | PipelinedBinaryConsumer.accept | @Override
public void accept(E1 former, E2 latter) {
"""
Performs every composed consumer.
@param former the former value
@param latter the latter value
"""
for (BiConsumer<E1, E2> consumer : consumers) {
consumer.accept(former, latter);
}
} | java | @Override
public void accept(E1 former, E2 latter) {
for (BiConsumer<E1, E2> consumer : consumers) {
consumer.accept(former, latter);
}
} | [
"@",
"Override",
"public",
"void",
"accept",
"(",
"E1",
"former",
",",
"E2",
"latter",
")",
"{",
"for",
"(",
"BiConsumer",
"<",
"E1",
",",
"E2",
">",
"consumer",
":",
"consumers",
")",
"{",
"consumer",
".",
"accept",
"(",
"former",
",",
"latter",
")"... | Performs every composed consumer.
@param former the former value
@param latter the latter value | [
"Performs",
"every",
"composed",
"consumer",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/dispatching/composing/PipelinedBinaryConsumer.java#L29-L34 |
Activiti/Activiti | activiti-engine/src/main/java/org/activiti/engine/impl/calendar/CronExpression.java | CronExpression.setCalendarHour | protected void setCalendarHour(Calendar cal, int hour) {
"""
Advance the calendar to the particular hour paying particular attention to daylight saving problems.
@param cal
@param hour
"""
cal.set(Calendar.HOUR_OF_DAY, hour);
if (cal.get(Calendar.HOUR_OF_DAY) != hour && hour != 24) {
cal.set(... | java | protected void setCalendarHour(Calendar cal, int hour) {
cal.set(Calendar.HOUR_OF_DAY, hour);
if (cal.get(Calendar.HOUR_OF_DAY) != hour && hour != 24) {
cal.set(Calendar.HOUR_OF_DAY, hour + 1);
}
} | [
"protected",
"void",
"setCalendarHour",
"(",
"Calendar",
"cal",
",",
"int",
"hour",
")",
"{",
"cal",
".",
"set",
"(",
"Calendar",
".",
"HOUR_OF_DAY",
",",
"hour",
")",
";",
"if",
"(",
"cal",
".",
"get",
"(",
"Calendar",
".",
"HOUR_OF_DAY",
")",
"!=",
... | Advance the calendar to the particular hour paying particular attention to daylight saving problems.
@param cal
@param hour | [
"Advance",
"the",
"calendar",
"to",
"the",
"particular",
"hour",
"paying",
"particular",
"attention",
"to",
"daylight",
"saving",
"problems",
"."
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/calendar/CronExpression.java#L1313-L1318 |
devnied/Bit-lib4j | src/main/java/fr/devnied/bitlib/BitUtils.java | BitUtils.setNextInteger | public void setNextInteger(final int pValue, final int pLength) {
"""
Add Integer to the current position with the specified size
Be careful with java integer bit sign
@param pValue
the value to set
@param pLength
the length of the integer
"""
if (pLength > Integer.SIZE) {
throw new Illegal... | java | public void setNextInteger(final int pValue, final int pLength) {
if (pLength > Integer.SIZE) {
throw new IllegalArgumentException("Integer overflow with length > 32");
}
setNextValue(pValue, pLength, Integer.SIZE - 1);
} | [
"public",
"void",
"setNextInteger",
"(",
"final",
"int",
"pValue",
",",
"final",
"int",
"pLength",
")",
"{",
"if",
"(",
"pLength",
">",
"Integer",
".",
"SIZE",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Integer overflow with length > 32\"",
")... | Add Integer to the current position with the specified size
Be careful with java integer bit sign
@param pValue
the value to set
@param pLength
the length of the integer | [
"Add",
"Integer",
"to",
"the",
"current",
"position",
"with",
"the",
"specified",
"size"
] | train | https://github.com/devnied/Bit-lib4j/blob/bdfa79fd12e7e3d5cf1196291825ef1bb12a1ee0/src/main/java/fr/devnied/bitlib/BitUtils.java#L629-L636 |
pwheel/spring-security-oauth2-client | src/main/java/com/racquettrack/security/oauth/OAuth2UserDetailsService.java | OAuth2UserDetailsService.getUserId | protected I getUserId(Map<String, Object> userInfo) {
"""
Gets the user id from the JSON object returned by the OAuth Provider. Uses the
{@link OAuth2ServiceProperties#getUserIdName()} to obtain the property from the
map.
@param userInfo The JSON string converted into a {@link Map}.
@return The user id, a {@li... | java | protected I getUserId(Map<String, Object> userInfo) {
I id;
String idAsString = (String) userInfo.get(oAuth2ServiceProperties.getUserIdName());
if (idConverter != null) {
id = idConverter.convert(idAsString);
} else {
id = (I) idAsString;
}
return... | [
"protected",
"I",
"getUserId",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"userInfo",
")",
"{",
"I",
"id",
";",
"String",
"idAsString",
"=",
"(",
"String",
")",
"userInfo",
".",
"get",
"(",
"oAuth2ServiceProperties",
".",
"getUserIdName",
"(",
")",
"... | Gets the user id from the JSON object returned by the OAuth Provider. Uses the
{@link OAuth2ServiceProperties#getUserIdName()} to obtain the property from the
map.
@param userInfo The JSON string converted into a {@link Map}.
@return The user id, a {@link UUID}. | [
"Gets",
"the",
"user",
"id",
"from",
"the",
"JSON",
"object",
"returned",
"by",
"the",
"OAuth",
"Provider",
".",
"Uses",
"the",
"{"
] | train | https://github.com/pwheel/spring-security-oauth2-client/blob/c0258823493e268495c9752c5d752f74c6809c6b/src/main/java/com/racquettrack/security/oauth/OAuth2UserDetailsService.java#L112-L122 |
spring-projects/spring-analytics | src/main/java/org/springframework/analytics/rest/controller/AggregateCounterController.java | AggregateCounterController.display | @ResponseBody
@RequestMapping(value = "/ {
"""
Retrieve counts for a given time interval, using some precision.
@param name the name of the aggregate counter we want to retrieve data from
@param from the start-time for the interval, default depends on the resolution (e.g. go back 1 day for hourly
... | java | @ResponseBody
@RequestMapping(value = "/{name}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public AggregateCounterResource display(
@PathVariable("name") String name,
@RequestParam(value = "from", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) DateTime from,... | [
"@",
"ResponseBody",
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/{name}\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
",",
"produces",
"=",
"MediaType",
".",
"APPLICATION_JSON_VALUE",
")",
"public",
"AggregateCounterResource",
"display",
"(",
"@",
"PathVa... | Retrieve counts for a given time interval, using some precision.
@param name the name of the aggregate counter we want to retrieve data from
@param from the start-time for the interval, default depends on the resolution (e.g. go back 1 day for hourly
buckets)
@param to the end-time for the interval... | [
"Retrieve",
"counts",
"for",
"a",
"given",
"time",
"interval",
"using",
"some",
"precision",
"."
] | train | https://github.com/spring-projects/spring-analytics/blob/e3ef19d2b794d6dc10265c171bba46cd757b1abd/src/main/java/org/springframework/analytics/rest/controller/AggregateCounterController.java#L151-L162 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.bucketSort | public static void bucketSort(final Object[] a, final int fromIndex, final int toIndex) {
"""
Note: All the objects with same value will be replaced with first element with the same value.
@param a the elements in the array must implements the <code>Comparable</code> interface.
@param fromIndex
@param toIndex... | java | public static void bucketSort(final Object[] a, final int fromIndex, final int toIndex) {
Array.bucketSort(a, fromIndex, toIndex);
} | [
"public",
"static",
"void",
"bucketSort",
"(",
"final",
"Object",
"[",
"]",
"a",
",",
"final",
"int",
"fromIndex",
",",
"final",
"int",
"toIndex",
")",
"{",
"Array",
".",
"bucketSort",
"(",
"a",
",",
"fromIndex",
",",
"toIndex",
")",
";",
"}"
] | Note: All the objects with same value will be replaced with first element with the same value.
@param a the elements in the array must implements the <code>Comparable</code> interface.
@param fromIndex
@param toIndex | [
"Note",
":",
"All",
"the",
"objects",
"with",
"same",
"value",
"will",
"be",
"replaced",
"with",
"first",
"element",
"with",
"the",
"same",
"value",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L12008-L12010 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/template/Section.java | Section.renderTagId | private final String renderTagId(InternalStringBuilder buffer)
throws JspException {
"""
This method will handle creating the tagId attribute. The tagId attribute indentifies the
tag in the generated HTML. There is a lookup table created in JavaScript mapping the <coe>tagId</code>
to the actual name. ... | java | private final String renderTagId(InternalStringBuilder buffer)
throws JspException {
assert(_name != null);
// @todo: this is busted. It should be writing out inline.
String realName = rewriteName(_name);
String idScript = mapLegacyTagId(_name, realName);
// some tags ... | [
"private",
"final",
"String",
"renderTagId",
"(",
"InternalStringBuilder",
"buffer",
")",
"throws",
"JspException",
"{",
"assert",
"(",
"_name",
"!=",
"null",
")",
";",
"// @todo: this is busted. It should be writing out inline.",
"String",
"realName",
"=",
"rewriteName"... | This method will handle creating the tagId attribute. The tagId attribute indentifies the
tag in the generated HTML. There is a lookup table created in JavaScript mapping the <coe>tagId</code>
to the actual name. The tagId is also run through the naming service so it can be scoped. Some tags will
write that <code>t... | [
"This",
"method",
"will",
"handle",
"creating",
"the",
"tagId",
"attribute",
".",
"The",
"tagId",
"attribute",
"indentifies",
"the",
"tag",
"in",
"the",
"generated",
"HTML",
".",
"There",
"is",
"a",
"lookup",
"table",
"created",
"in",
"JavaScript",
"mapping",
... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/template/Section.java#L333-L344 |
arnaudroger/SimpleFlatMapper | sfm-map/src/main/java/org/simpleflatmapper/map/mapper/MapperBuilder.java | MapperBuilder.addMapping | public final B addMapping(final String column, final Object... properties) {
"""
add a new mapping to the specified property with the specified columnDefinition and an undefined type. The index is incremented for each non indexed property mapping.
@param column the property name
@param properties the... | java | public final B addMapping(final String column, final Object... properties) {
return addMapping(column, calculatedIndex++, properties);
} | [
"public",
"final",
"B",
"addMapping",
"(",
"final",
"String",
"column",
",",
"final",
"Object",
"...",
"properties",
")",
"{",
"return",
"addMapping",
"(",
"column",
",",
"calculatedIndex",
"++",
",",
"properties",
")",
";",
"}"
] | add a new mapping to the specified property with the specified columnDefinition and an undefined type. The index is incremented for each non indexed property mapping.
@param column the property name
@param properties the definition
@return the current builder | [
"add",
"a",
"new",
"mapping",
"to",
"the",
"specified",
"property",
"with",
"the",
"specified",
"columnDefinition",
"and",
"an",
"undefined",
"type",
".",
"The",
"index",
"is",
"incremented",
"for",
"each",
"non",
"indexed",
"property",
"mapping",
"."
] | train | https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-map/src/main/java/org/simpleflatmapper/map/mapper/MapperBuilder.java#L88-L90 |
Jasig/uPortal | uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/UpdatePreferencesServlet.java | UpdatePreferencesServlet.updateAttributes | @RequestMapping(method = RequestMethod.POST, params = "action=updateAttributes")
public ModelAndView updateAttributes(
HttpServletRequest request,
HttpServletResponse response,
@RequestParam("targetId") String targetId,
@RequestBody Map<String, Map<String, String>> at... | java | @RequestMapping(method = RequestMethod.POST, params = "action=updateAttributes")
public ModelAndView updateAttributes(
HttpServletRequest request,
HttpServletResponse response,
@RequestParam("targetId") String targetId,
@RequestBody Map<String, Map<String, String>> at... | [
"@",
"RequestMapping",
"(",
"method",
"=",
"RequestMethod",
".",
"POST",
",",
"params",
"=",
"\"action=updateAttributes\"",
")",
"public",
"ModelAndView",
"updateAttributes",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"@",
"Requ... | Update the attributes for the node. Unrecognized attributes will log a warning, but are
otherwise ignored.
@param request
@param response
@param targetId - the id of the node whose attributes will be updated.
@param attributes - parse the JSON name-value pairs in the body as the attributes of the
folder. e.g. : { "str... | [
"Update",
"the",
"attributes",
"for",
"the",
"node",
".",
"Unrecognized",
"attributes",
"will",
"log",
"a",
"warning",
"but",
"are",
"otherwise",
"ignored",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/UpdatePreferencesServlet.java#L1053-L1105 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/LightWeightLinkedSet.java | LightWeightLinkedSet.pollNToList | public void pollNToList(int n, List<T> retList) {
"""
Remove and return first n elements on the linked list of all elements.
Put elements into the given list.
"""
if (n >= size) {
// if we need to remove all elements then do fast polling
pollAllToList(retList);
}
while (n-- > 0 && head... | java | public void pollNToList(int n, List<T> retList) {
if (n >= size) {
// if we need to remove all elements then do fast polling
pollAllToList(retList);
}
while (n-- > 0 && head != null) {
T curr = head.element;
this.removeElem(curr);
retList.add(curr);
}
shrinkIfNecessary(... | [
"public",
"void",
"pollNToList",
"(",
"int",
"n",
",",
"List",
"<",
"T",
">",
"retList",
")",
"{",
"if",
"(",
"n",
">=",
"size",
")",
"{",
"// if we need to remove all elements then do fast polling",
"pollAllToList",
"(",
"retList",
")",
";",
"}",
"while",
"... | Remove and return first n elements on the linked list of all elements.
Put elements into the given list. | [
"Remove",
"and",
"return",
"first",
"n",
"elements",
"on",
"the",
"linked",
"list",
"of",
"all",
"elements",
".",
"Put",
"elements",
"into",
"the",
"given",
"list",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightLinkedSet.java#L189-L200 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.waitForCondition | public boolean waitForCondition(Condition condition, int timeout) {
"""
Waits for a condition to be satisfied.
@param condition the condition to wait for
@param timeout the amount of time in milliseconds to wait
@return {@code true} if condition is satisfied and {@code false} if it is not satisfied before the... | java | public boolean waitForCondition(Condition condition, int timeout){
final long endTime = SystemClock.uptimeMillis() + timeout;
while (true) {
final boolean timedOut = SystemClock.uptimeMillis() > endTime;
if (timedOut){
return false;
}
sleeper.sleep();
if (condition.isSatisfied()){
return t... | [
"public",
"boolean",
"waitForCondition",
"(",
"Condition",
"condition",
",",
"int",
"timeout",
")",
"{",
"final",
"long",
"endTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
"+",
"timeout",
";",
"while",
"(",
"true",
")",
"{",
"final",
"boolean",
... | Waits for a condition to be satisfied.
@param condition the condition to wait for
@param timeout the amount of time in milliseconds to wait
@return {@code true} if condition is satisfied and {@code false} if it is not satisfied before the timeout | [
"Waits",
"for",
"a",
"condition",
"to",
"be",
"satisfied",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L515-L530 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.summarizeForResource | public SummarizeResultsInner summarizeForResource(String resourceId, QueryOptions queryOptions) {
"""
Summarizes policy states for the resource.
@param resourceId Resource ID.
@param queryOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
... | java | public SummarizeResultsInner summarizeForResource(String resourceId, QueryOptions queryOptions) {
return summarizeForResourceWithServiceResponseAsync(resourceId, queryOptions).toBlocking().single().body();
} | [
"public",
"SummarizeResultsInner",
"summarizeForResource",
"(",
"String",
"resourceId",
",",
"QueryOptions",
"queryOptions",
")",
"{",
"return",
"summarizeForResourceWithServiceResponseAsync",
"(",
"resourceId",
",",
"queryOptions",
")",
".",
"toBlocking",
"(",
")",
".",
... | Summarizes policy states for the resource.
@param resourceId Resource ID.
@param queryOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@throws QueryFailureException thrown if the request is rejected by server
@throws RuntimeException all other wr... | [
"Summarizes",
"policy",
"states",
"for",
"the",
"resource",
"."
] | 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/PolicyStatesInner.java#L1565-L1567 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java | AbstractEJBRuntime.countInterfaces | private int countInterfaces(BeanMetaData bmd, boolean local) // F743-23167 {
"""
Determine the number of remote or local interfaces exposed by a bean.
@param bmd the bean
@param local <tt>true</tt> if local interfaces should be counted, or
<tt>false</tt> if remote interfaces should be counted
@return the num... | java | private int countInterfaces(BeanMetaData bmd, boolean local) // F743-23167
{
// Note that these variables must be kept in sync with bindInterfaces.
String homeInterfaceClassName = local ? bmd.localHomeInterfaceClassName : bmd.homeInterfaceClassName;
boolean hasLocalBean = local && bmd.ivLoca... | [
"private",
"int",
"countInterfaces",
"(",
"BeanMetaData",
"bmd",
",",
"boolean",
"local",
")",
"// F743-23167",
"{",
"// Note that these variables must be kept in sync with bindInterfaces.",
"String",
"homeInterfaceClassName",
"=",
"local",
"?",
"bmd",
".",
"localHomeInterfac... | Determine the number of remote or local interfaces exposed by a bean.
@param bmd the bean
@param local <tt>true</tt> if local interfaces should be counted, or
<tt>false</tt> if remote interfaces should be counted
@return the number of remote or local interfaces | [
"Determine",
"the",
"number",
"of",
"remote",
"or",
"local",
"interfaces",
"exposed",
"by",
"a",
"bean",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L874-L888 |
alkacon/opencms-core | src/org/opencms/main/CmsShellCommands.java | CmsShellCommands.createFolder | @SuppressWarnings("deprecation")
public CmsResource createFolder(String targetFolder, String folderName) throws Exception {
"""
Creates a new folder in the given target folder.<p>
@param targetFolder the target folder
@param folderName the new folder to create in the target folder
@return the created fold... | java | @SuppressWarnings("deprecation")
public CmsResource createFolder(String targetFolder, String folderName) throws Exception {
if (m_cms.existsResource(targetFolder + folderName)) {
m_shell.getOut().println(
getMessages().key(Messages.GUI_SHELL_FOLDER_ALREADY_EXISTS_1, targetFolder... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"CmsResource",
"createFolder",
"(",
"String",
"targetFolder",
",",
"String",
"folderName",
")",
"throws",
"Exception",
"{",
"if",
"(",
"m_cms",
".",
"existsResource",
"(",
"targetFolder",
"+",
"folder... | Creates a new folder in the given target folder.<p>
@param targetFolder the target folder
@param folderName the new folder to create in the target folder
@return the created folder
@throws Exception if somthing goes wrong | [
"Creates",
"a",
"new",
"folder",
"in",
"the",
"given",
"target",
"folder",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L332-L341 |
hawkular/hawkular-inventory | hawkular-inventory-impl-tinkerpop-parent/hawkular-inventory-impl-tinkerpop/src/main/java/org/hawkular/inventory/impl/tinkerpop/FilterApplicator.java | FilterApplicator.applyAll | public static <S, E> void applyAll(Query filterTree, GraphTraversal<S, E> q) {
"""
Applies all the filters from the applicator tree to the provided Gremlin query.
@param filterTree the tree of filters to apply to the query
@param q the query to update with filters from the tree
@param <S> type... | java | public static <S, E> void applyAll(Query filterTree, GraphTraversal<S, E> q) {
if (filterTree == null) {
return;
}
QueryTranslationState state = new QueryTranslationState();
applyAll(filterTree, q, false, state);
} | [
"public",
"static",
"<",
"S",
",",
"E",
">",
"void",
"applyAll",
"(",
"Query",
"filterTree",
",",
"GraphTraversal",
"<",
"S",
",",
"E",
">",
"q",
")",
"{",
"if",
"(",
"filterTree",
"==",
"null",
")",
"{",
"return",
";",
"}",
"QueryTranslationState",
... | Applies all the filters from the applicator tree to the provided Gremlin query.
@param filterTree the tree of filters to apply to the query
@param q the query to update with filters from the tree
@param <S> type of the source of the query
@param <E> type of the output of the query | [
"Applies",
"all",
"the",
"filters",
"from",
"the",
"applicator",
"tree",
"to",
"the",
"provided",
"Gremlin",
"query",
"."
] | train | https://github.com/hawkular/hawkular-inventory/blob/f56dc10323dca21777feb5b609a9e9cc70ffaf62/hawkular-inventory-impl-tinkerpop-parent/hawkular-inventory-impl-tinkerpop/src/main/java/org/hawkular/inventory/impl/tinkerpop/FilterApplicator.java#L129-L137 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newServiceInvocationException | public static ServiceInvocationException newServiceInvocationException(Throwable cause,
String message, Object... args) {
"""
Constructs and initializes a new {@link ServiceInvocationException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] argumen... | java | public static ServiceInvocationException newServiceInvocationException(Throwable cause,
String message, Object... args) {
return new ServiceInvocationException(format(message, args), cause);
} | [
"public",
"static",
"ServiceInvocationException",
"newServiceInvocationException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"ServiceInvocationException",
"(",
"format",
"(",
"message",
",",
"args",
... | Constructs and initializes a new {@link ServiceInvocationException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link ServiceInvocationException} was thrown.
@param message {@link St... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"ServiceInvocationException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L685-L689 |
Erudika/para | para-server/src/main/java/com/erudika/para/persistence/AWSDynamoUtils.java | AWSDynamoUtils.createSharedTable | public static boolean createSharedTable(long readCapacity, long writeCapacity) {
"""
Creates a table in AWS DynamoDB which will be shared between apps.
@param readCapacity read capacity
@param writeCapacity write capacity
@return true if created
"""
if (StringUtils.isBlank(SHARED_TABLE) || StringUtils.con... | java | public static boolean createSharedTable(long readCapacity, long writeCapacity) {
if (StringUtils.isBlank(SHARED_TABLE) || StringUtils.containsWhitespace(SHARED_TABLE) ||
existsTable(SHARED_TABLE)) {
return false;
}
try {
GlobalSecondaryIndex secIndex = new GlobalSecondaryIndex().
withIndexName(getS... | [
"public",
"static",
"boolean",
"createSharedTable",
"(",
"long",
"readCapacity",
",",
"long",
"writeCapacity",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"SHARED_TABLE",
")",
"||",
"StringUtils",
".",
"containsWhitespace",
"(",
"SHARED_TABLE",
")",
... | Creates a table in AWS DynamoDB which will be shared between apps.
@param readCapacity read capacity
@param writeCapacity write capacity
@return true if created | [
"Creates",
"a",
"table",
"in",
"AWS",
"DynamoDB",
"which",
"will",
"be",
"shared",
"between",
"apps",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/persistence/AWSDynamoUtils.java#L254-L282 |
trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/metadata/IfmapMetadataFactory.java | IfmapMetadataFactory.createAndAppendElement | protected Element createAndAppendElement(Document doc, Element parent, String elName) {
"""
Helper to create an {@link Element} without a namespace in {@link Document} doc and append it to the
{@link Element} given by
parent.
@param doc
the target {@link Document}
@param parent
the parent {@link Element}
... | java | protected Element createAndAppendElement(Document doc, Element parent, String elName) {
Element el = doc.createElementNS(null, elName);
parent.appendChild(el);
return el;
} | [
"protected",
"Element",
"createAndAppendElement",
"(",
"Document",
"doc",
",",
"Element",
"parent",
",",
"String",
"elName",
")",
"{",
"Element",
"el",
"=",
"doc",
".",
"createElementNS",
"(",
"null",
",",
"elName",
")",
";",
"parent",
".",
"appendChild",
"(... | Helper to create an {@link Element} without a namespace in {@link Document} doc and append it to the
{@link Element} given by
parent.
@param doc
the target {@link Document}
@param parent
the parent {@link Element}
@param elName
the name of the new {@link Element}
@return the new {@link Element} | [
"Helper",
"to",
"create",
"an",
"{",
"@link",
"Element",
"}",
"without",
"a",
"namespace",
"in",
"{",
"@link",
"Document",
"}",
"doc",
"and",
"append",
"it",
"to",
"the",
"{",
"@link",
"Element",
"}",
"given",
"by",
"parent",
"."
] | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/metadata/IfmapMetadataFactory.java#L178-L182 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/StreamUtils.java | StreamUtils.findAny | public static <T> T findAny( Stream<T> stream, Predicate<T> predicate ) {
"""
Find an element in the stream.
@param stream the stream to check. This should be parallel.
@param predicate the predicate to use.
@return the element or null.
"""
Optional<T> element = stream.filter(predicate).findAny();... | java | public static <T> T findAny( Stream<T> stream, Predicate<T> predicate ) {
Optional<T> element = stream.filter(predicate).findAny();
return element.orElse(null);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"findAny",
"(",
"Stream",
"<",
"T",
">",
"stream",
",",
"Predicate",
"<",
"T",
">",
"predicate",
")",
"{",
"Optional",
"<",
"T",
">",
"element",
"=",
"stream",
".",
"filter",
"(",
"predicate",
")",
".",
"find... | Find an element in the stream.
@param stream the stream to check. This should be parallel.
@param predicate the predicate to use.
@return the element or null. | [
"Find",
"an",
"element",
"in",
"the",
"stream",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/StreamUtils.java#L197-L200 |
jbake-org/jbake | jbake-core/src/main/java/org/jbake/app/UtensilsFactory.java | UtensilsFactory.createDefaultUtensils | public static Utensils createDefaultUtensils(JBakeConfiguration config) {
"""
Create default {@link Utensils} by a given {@link JBakeConfiguration}
@param config a {@link JBakeConfiguration}
@return a default {@link Utensils} instance
"""
JBakeConfigurationInspector inspector = new JBakeConfiguratio... | java | public static Utensils createDefaultUtensils(JBakeConfiguration config) {
JBakeConfigurationInspector inspector = new JBakeConfigurationInspector(config);
inspector.inspect();
Utensils utensils = new Utensils();
utensils.setConfiguration(config);
ContentStore contentStore = DBU... | [
"public",
"static",
"Utensils",
"createDefaultUtensils",
"(",
"JBakeConfiguration",
"config",
")",
"{",
"JBakeConfigurationInspector",
"inspector",
"=",
"new",
"JBakeConfigurationInspector",
"(",
"config",
")",
";",
"inspector",
".",
"inspect",
"(",
")",
";",
"Utensil... | Create default {@link Utensils} by a given {@link JBakeConfiguration}
@param config a {@link JBakeConfiguration}
@return a default {@link Utensils} instance | [
"Create",
"default",
"{"
] | train | https://github.com/jbake-org/jbake/blob/beb9042a54bf0eb168821d524c88b9ea0bee88dc/jbake-core/src/main/java/org/jbake/app/UtensilsFactory.java#L16-L30 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.println | public static void println(Closure self, Object value) {
"""
Print a value (followed by a newline) to the standard output stream.
This method delegates to the owner to execute the method.
@param self a closure
@param value the value to print
@since 1.0
"""
Object owner = getClosureOwner(self);
... | java | public static void println(Closure self, Object value) {
Object owner = getClosureOwner(self);
InvokerHelper.invokeMethod(owner, "println", new Object[]{value});
} | [
"public",
"static",
"void",
"println",
"(",
"Closure",
"self",
",",
"Object",
"value",
")",
"{",
"Object",
"owner",
"=",
"getClosureOwner",
"(",
"self",
")",
";",
"InvokerHelper",
".",
"invokeMethod",
"(",
"owner",
",",
"\"println\"",
",",
"new",
"Object",
... | Print a value (followed by a newline) to the standard output stream.
This method delegates to the owner to execute the method.
@param self a closure
@param value the value to print
@since 1.0 | [
"Print",
"a",
"value",
"(",
"followed",
"by",
"a",
"newline",
")",
"to",
"the",
"standard",
"output",
"stream",
".",
"This",
"method",
"delegates",
"to",
"the",
"owner",
"to",
"execute",
"the",
"method",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L837-L840 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java | SqlExecutor.execute | public static int execute(Connection conn, String sql, Object... params) throws SQLException {
"""
执行非查询语句<br>
语句包括 插入、更新、删除<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param params 参数
@return 影响的行数
@throws SQLException SQL执行异常
"""
PreparedStatement ps = null;
try {
ps = Statement... | java | public static int execute(Connection conn, String sql, Object... params) throws SQLException {
PreparedStatement ps = null;
try {
ps = StatementUtil.prepareStatement(conn, sql, params);
return ps.executeUpdate();
} finally {
DbUtil.close(ps);
}
} | [
"public",
"static",
"int",
"execute",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"ps",
"=",
"null",
";",
"try",
"{",
"ps",
"=",
"StatementUtil",
".",
"prepareState... | 执行非查询语句<br>
语句包括 插入、更新、删除<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param params 参数
@return 影响的行数
@throws SQLException SQL执行异常 | [
"执行非查询语句<br",
">",
"语句包括",
"插入、更新、删除<br",
">",
"此方法不会关闭Connection"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java#L53-L61 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java | ClusterJoinManager.validateJoinRequest | private boolean validateJoinRequest(JoinRequest joinRequest, Address target) {
"""
Invoked from master node while executing a join request to validate it, delegating to
{@link com.hazelcast.instance.NodeExtension#validateJoinRequest(JoinMessage)}
"""
if (clusterService.isMaster()) {
try {
... | java | private boolean validateJoinRequest(JoinRequest joinRequest, Address target) {
if (clusterService.isMaster()) {
try {
node.getNodeExtension().validateJoinRequest(joinRequest);
} catch (Exception e) {
logger.warning(e.getMessage());
nodeEngi... | [
"private",
"boolean",
"validateJoinRequest",
"(",
"JoinRequest",
"joinRequest",
",",
"Address",
"target",
")",
"{",
"if",
"(",
"clusterService",
".",
"isMaster",
"(",
")",
")",
"{",
"try",
"{",
"node",
".",
"getNodeExtension",
"(",
")",
".",
"validateJoinReque... | Invoked from master node while executing a join request to validate it, delegating to
{@link com.hazelcast.instance.NodeExtension#validateJoinRequest(JoinMessage)} | [
"Invoked",
"from",
"master",
"node",
"while",
"executing",
"a",
"join",
"request",
"to",
"validate",
"it",
"delegating",
"to",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java#L386-L397 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java | Operators.binaryPromotion | Type binaryPromotion(Type t1, Type t2) {
"""
Perform binary promotion of a pair of types; this routine implements JLS 5.6.2.
If the input types are not supported by unary promotion, if such types are identical to
a type C, then C is returned, otherwise Object is returned.
"""
Type unboxedT1 = types.u... | java | Type binaryPromotion(Type t1, Type t2) {
Type unboxedT1 = types.unboxedTypeOrType(t1);
Type unboxedT2 = types.unboxedTypeOrType(t2);
if (unboxedT1.isNumeric() && unboxedT2.isNumeric()) {
if (unboxedT1.hasTag(TypeTag.DOUBLE) || unboxedT2.hasTag(TypeTag.DOUBLE)) {
retu... | [
"Type",
"binaryPromotion",
"(",
"Type",
"t1",
",",
"Type",
"t2",
")",
"{",
"Type",
"unboxedT1",
"=",
"types",
".",
"unboxedTypeOrType",
"(",
"t1",
")",
";",
"Type",
"unboxedT2",
"=",
"types",
".",
"unboxedTypeOrType",
"(",
"t2",
")",
";",
"if",
"(",
"u... | Perform binary promotion of a pair of types; this routine implements JLS 5.6.2.
If the input types are not supported by unary promotion, if such types are identical to
a type C, then C is returned, otherwise Object is returned. | [
"Perform",
"binary",
"promotion",
"of",
"a",
"pair",
"of",
"types",
";",
"this",
"routine",
"implements",
"JLS",
"5",
".",
"6",
".",
"2",
".",
"If",
"the",
"input",
"types",
"are",
"not",
"supported",
"by",
"unary",
"promotion",
"if",
"such",
"types",
... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java#L125-L144 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java | AttributesImpl.getIndex | public int getIndex (String uri, String localName) {
"""
Look up an attribute's index by Namespace name.
<p>In many cases, it will be more efficient to look up the name once and
use the index query methods rather than using the name query methods
repeatedly.</p>
@param uri The attribute's Namespace URI, or... | java | public int getIndex (String uri, String localName)
{
int max = length * 5;
for (int i = 0; i < max; i += 5) {
if (data[i].equals(uri) && data[i+1].equals(localName)) {
return i / 5;
}
}
return -1;
} | [
"public",
"int",
"getIndex",
"(",
"String",
"uri",
",",
"String",
"localName",
")",
"{",
"int",
"max",
"=",
"length",
"*",
"5",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"max",
";",
"i",
"+=",
"5",
")",
"{",
"if",
"(",
"data",
"["... | Look up an attribute's index by Namespace name.
<p>In many cases, it will be more efficient to look up the name once and
use the index query methods rather than using the name query methods
repeatedly.</p>
@param uri The attribute's Namespace URI, or the empty
string if none is available.
@param localName The attribu... | [
"Look",
"up",
"an",
"attribute",
"s",
"index",
"by",
"Namespace",
"name",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java#L199-L208 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/codec/RTMPProtocolEncoder.java | RTMPProtocolEncoder.getHeaderType | private byte getHeaderType(final Header header, final Header lastHeader) {
"""
Determine type of header to use.
@param header RTMP message header
@param lastHeader Previous header
@return Header type to use
"""
//int lastFullTs = ((RTMPConnection) Red5.getConnectionLocal()).getState().getLastFull... | java | private byte getHeaderType(final Header header, final Header lastHeader) {
//int lastFullTs = ((RTMPConnection) Red5.getConnectionLocal()).getState().getLastFullTimestampWritten(header.getChannelId());
if (lastHeader == null || header.getStreamId() != lastHeader.getStreamId() || header.getTimer() < la... | [
"private",
"byte",
"getHeaderType",
"(",
"final",
"Header",
"header",
",",
"final",
"Header",
"lastHeader",
")",
"{",
"//int lastFullTs = ((RTMPConnection) Red5.getConnectionLocal()).getState().getLastFullTimestampWritten(header.getChannelId());\r",
"if",
"(",
"lastHeader",
"==",
... | Determine type of header to use.
@param header RTMP message header
@param lastHeader Previous header
@return Header type to use | [
"Determine",
"type",
"of",
"header",
"to",
"use",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/codec/RTMPProtocolEncoder.java#L356-L370 |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java | OMVRBTree.putAll | @Override
public void putAll(final Map<? extends K, ? extends V> map) {
"""
Copies all of the mappings from the specified map to this map. These mappings replace any mappings that this map had for any of
the keys currently in the specified map.
@param map
mappings to be stored in this map
@throws ClassCas... | java | @Override
public void putAll(final Map<? extends K, ? extends V> map) {
int mapSize = map.size();
if (size() == 0 && mapSize != 0 && map instanceof SortedMap) {
Comparator<?> c = ((SortedMap<? extends K, ? extends V>) map).comparator();
if (c == comparator || (c != null && c.equals(comparator... | [
"@",
"Override",
"public",
"void",
"putAll",
"(",
"final",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"map",
")",
"{",
"int",
"mapSize",
"=",
"map",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
"(",
")",
"==",
"0",
"&&",
... | Copies all of the mappings from the specified map to this map. These mappings replace any mappings that this map had for any of
the keys currently in the specified map.
@param map
mappings to be stored in this map
@throws ClassCastException
if the class of a key or value in the specified map prevents it from being sto... | [
"Copies",
"all",
"of",
"the",
"mappings",
"from",
"the",
"specified",
"map",
"to",
"this",
"map",
".",
"These",
"mappings",
"replace",
"any",
"mappings",
"that",
"this",
"map",
"had",
"for",
"any",
"of",
"the",
"keys",
"currently",
"in",
"the",
"specified"... | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java#L316-L332 |
osglworks/java-tool | src/main/java/org/osgl/util/KVStore.java | KVStore.putValues | @Override
public KVStore putValues(Map<String, Object> kvMap) {
"""
Put a map of (key, value) pair into the store. The value could be any type
that supported by {@link ValueObject}
@param kvMap a map of {key, value} pair
"""
for (String key : kvMap.keySet()) {
put(key, ValueObject.of(... | java | @Override
public KVStore putValues(Map<String, Object> kvMap) {
for (String key : kvMap.keySet()) {
put(key, ValueObject.of(kvMap.get(key)));
}
return this;
} | [
"@",
"Override",
"public",
"KVStore",
"putValues",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"kvMap",
")",
"{",
"for",
"(",
"String",
"key",
":",
"kvMap",
".",
"keySet",
"(",
")",
")",
"{",
"put",
"(",
"key",
",",
"ValueObject",
".",
"of",
"("... | Put a map of (key, value) pair into the store. The value could be any type
that supported by {@link ValueObject}
@param kvMap a map of {key, value} pair | [
"Put",
"a",
"map",
"of",
"(",
"key",
"value",
")",
"pair",
"into",
"the",
"store",
".",
"The",
"value",
"could",
"be",
"any",
"type",
"that",
"supported",
"by",
"{"
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/KVStore.java#L90-L96 |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/PathImpl.java | PathImpl.openReadWrite | public ReadWritePair openReadWrite(boolean isAutoFlush) throws IOException {
"""
Opens a ReadWritePair for reading and writing.
<p>A chat channel, for example, would open its socket using this
interface.
"""
clearStatusCache();
StreamImpl impl = openReadWriteImpl();
//impl.setPath(this);
... | java | public ReadWritePair openReadWrite(boolean isAutoFlush) throws IOException
{
clearStatusCache();
StreamImpl impl = openReadWriteImpl();
//impl.setPath(this);
WriteStreamOld writeStream = new WriteStreamOld(impl);
ReadStreamOld readStream;
if (isAutoFlush)
readStream = new ReadStreamOl... | [
"public",
"ReadWritePair",
"openReadWrite",
"(",
"boolean",
"isAutoFlush",
")",
"throws",
"IOException",
"{",
"clearStatusCache",
"(",
")",
";",
"StreamImpl",
"impl",
"=",
"openReadWriteImpl",
"(",
")",
";",
"//impl.setPath(this);",
"WriteStreamOld",
"writeStream",
"=... | Opens a ReadWritePair for reading and writing.
<p>A chat channel, for example, would open its socket using this
interface. | [
"Opens",
"a",
"ReadWritePair",
"for",
"reading",
"and",
"writing",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/PathImpl.java#L1219-L1235 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateCertificateAsync | public Observable<CertificateBundle> updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map<String, String> tags) {
"""
Updates the specified attributes associated with the given certificat... | java | public Observable<CertificateBundle> updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map<String, String> tags) {
return updateCertificateWithServiceResponseAsync(vaultBaseUrl, certifi... | [
"public",
"Observable",
"<",
"CertificateBundle",
">",
"updateCertificateAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"String",
"certificateVersion",
",",
"CertificatePolicy",
"certificatePolicy",
",",
"CertificateAttributes",
"certificateAttr... | Updates the specified attributes associated with the given certificate.
The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission.
@param vaultBaseUrl The vault name, for ... | [
"Updates",
"the",
"specified",
"attributes",
"associated",
"with",
"the",
"given",
"certificate",
".",
"The",
"UpdateCertificate",
"operation",
"applies",
"the",
"specified",
"update",
"on",
"the",
"given",
"certificate",
";",
"the",
"only",
"elements",
"updated",
... | 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#L7470-L7477 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/view/ViewQueryResponseMapper.java | ViewQueryResponseMapper.mapToSpatialViewResult | public static Observable<AsyncSpatialViewResult> mapToSpatialViewResult(final AsyncBucket bucket,
final SpatialViewQuery query, final ViewQueryResponse response) {
"""
Maps a raw {@link ViewQueryResponse} into a {@link AsyncSpatialViewResult}.
@param bucket reference to the bucket.
@param query the ori... | java | public static Observable<AsyncSpatialViewResult> mapToSpatialViewResult(final AsyncBucket bucket,
final SpatialViewQuery query, final ViewQueryResponse response) {
return response
.info()
.singleOrDefault(null)
.map(new ByteBufToJsonObject())
.map(new Bui... | [
"public",
"static",
"Observable",
"<",
"AsyncSpatialViewResult",
">",
"mapToSpatialViewResult",
"(",
"final",
"AsyncBucket",
"bucket",
",",
"final",
"SpatialViewQuery",
"query",
",",
"final",
"ViewQueryResponse",
"response",
")",
"{",
"return",
"response",
".",
"info"... | Maps a raw {@link ViewQueryResponse} into a {@link AsyncSpatialViewResult}.
@param bucket reference to the bucket.
@param query the original query object.
@param response the response from the server.
@return a converted {@link AsyncSpatialViewResult}. | [
"Maps",
"a",
"raw",
"{",
"@link",
"ViewQueryResponse",
"}",
"into",
"a",
"{",
"@link",
"AsyncSpatialViewResult",
"}",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/view/ViewQueryResponseMapper.java#L78-L86 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java | EventSubscriptionsInner.createOrUpdateAsync | public Observable<EventSubscriptionInner> createOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) {
"""
Create or update an event subscription.
Asynchronously creates a new event subscription or updates an existing event subscription based on the specified sco... | java | public Observable<EventSubscriptionInner> createOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) {
return createOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).map(new Func1<ServiceResponse<EventSubscriptionInner>, Even... | [
"public",
"Observable",
"<",
"EventSubscriptionInner",
">",
"createOrUpdateAsync",
"(",
"String",
"scope",
",",
"String",
"eventSubscriptionName",
",",
"EventSubscriptionInner",
"eventSubscriptionInfo",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"scope... | Create or update an event subscription.
Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
@param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource grou... | [
"Create",
"or",
"update",
"an",
"event",
"subscription",
".",
"Asynchronously",
"creates",
"a",
"new",
"event",
"subscription",
"or",
"updates",
"an",
"existing",
"event",
"subscription",
"based",
"on",
"the",
"specified",
"scope",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java#L264-L271 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java | AbstractHibernateCriteriaBuilder.groupProperty | public org.grails.datastore.mapping.query.api.ProjectionList groupProperty(String propertyName, String alias) {
"""
Adds a projection that allows the criteria's result to be grouped by a property
@param propertyName The name of the property
@param alias The alias to use
"""
final PropertyProjection... | java | public org.grails.datastore.mapping.query.api.ProjectionList groupProperty(String propertyName, String alias) {
final PropertyProjection proj = Projections.groupProperty(calculatePropertyName(propertyName));
addProjectionToList(proj, alias);
return this;
} | [
"public",
"org",
".",
"grails",
".",
"datastore",
".",
"mapping",
".",
"query",
".",
"api",
".",
"ProjectionList",
"groupProperty",
"(",
"String",
"propertyName",
",",
"String",
"alias",
")",
"{",
"final",
"PropertyProjection",
"proj",
"=",
"Projections",
".",... | Adds a projection that allows the criteria's result to be grouped by a property
@param propertyName The name of the property
@param alias The alias to use | [
"Adds",
"a",
"projection",
"that",
"allows",
"the",
"criteria",
"s",
"result",
"to",
"be",
"grouped",
"by",
"a",
"property"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L451-L455 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_firewall_ipOnFirewall_rule_POST | public OvhFirewallNetworkRule ip_firewall_ipOnFirewall_rule_POST(String ip, String ipOnFirewall, OvhFirewallActionEnum action, Long destinationPort, OvhFirewallProtocolEnum protocol, OvhFirewallSequenceRangeEnum sequence, String source, Long sourcePort, OvhFirewallOptionTCP tcpOption) throws IOException {
"""
Anti... | java | public OvhFirewallNetworkRule ip_firewall_ipOnFirewall_rule_POST(String ip, String ipOnFirewall, OvhFirewallActionEnum action, Long destinationPort, OvhFirewallProtocolEnum protocol, OvhFirewallSequenceRangeEnum sequence, String source, Long sourcePort, OvhFirewallOptionTCP tcpOption) throws IOException {
String qPat... | [
"public",
"OvhFirewallNetworkRule",
"ip_firewall_ipOnFirewall_rule_POST",
"(",
"String",
"ip",
",",
"String",
"ipOnFirewall",
",",
"OvhFirewallActionEnum",
"action",
",",
"Long",
"destinationPort",
",",
"OvhFirewallProtocolEnum",
"protocol",
",",
"OvhFirewallSequenceRangeEnum",... | AntiDDOS option. Add new rule on your IP
REST: POST /ip/{ip}/firewall/{ipOnFirewall}/rule
@param protocol [required] Network protocol
@param destinationPort [required] Destination port for your rule. Only with TCP/UDP protocol
@param action [required] Action on this rule
@param tcpOption [required] Option on your rule... | [
"AntiDDOS",
"option",
".",
"Add",
"new",
"rule",
"on",
"your",
"IP"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L1100-L1113 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java | SftpClient.get | public SftpFileAttributes get(String remote, String local, boolean resume)
throws FileNotFoundException, SftpStatusException, SshException,
TransferCancelledException {
"""
Download the remote file into the local file.
@param remote
@param local
@param resume
attempt to resume an interrupted download
... | java | public SftpFileAttributes get(String remote, String local, boolean resume)
throws FileNotFoundException, SftpStatusException, SshException,
TransferCancelledException {
return get(remote, local, null, resume);
} | [
"public",
"SftpFileAttributes",
"get",
"(",
"String",
"remote",
",",
"String",
"local",
",",
"boolean",
"resume",
")",
"throws",
"FileNotFoundException",
",",
"SftpStatusException",
",",
"SshException",
",",
"TransferCancelledException",
"{",
"return",
"get",
"(",
"... | Download the remote file into the local file.
@param remote
@param local
@param resume
attempt to resume an interrupted download
@return the downloaded file's attributes
@throws FileNotFoundException
@throws SftpStatusException
@throws SshException
@throws TransferCancelledException | [
"Download",
"the",
"remote",
"file",
"into",
"the",
"local",
"file",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java#L1107-L1111 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/search/bingcustomimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customimagesearch/implementation/BingCustomInstancesImpl.java | BingCustomInstancesImpl.imageSearchAsync | public Observable<Images> imageSearchAsync(long customConfig, String query, ImageSearchOptionalParameter imageSearchOptionalParameter) {
"""
The Custom Image Search API lets you send an image search query to Bing and get image results found in your custom view of the web.
@param customConfig The identifier for ... | java | public Observable<Images> imageSearchAsync(long customConfig, String query, ImageSearchOptionalParameter imageSearchOptionalParameter) {
return imageSearchWithServiceResponseAsync(customConfig, query, imageSearchOptionalParameter).map(new Func1<ServiceResponse<Images>, Images>() {
@Override
... | [
"public",
"Observable",
"<",
"Images",
">",
"imageSearchAsync",
"(",
"long",
"customConfig",
",",
"String",
"query",
",",
"ImageSearchOptionalParameter",
"imageSearchOptionalParameter",
")",
"{",
"return",
"imageSearchWithServiceResponseAsync",
"(",
"customConfig",
",",
"... | The Custom Image Search API lets you send an image search query to Bing and get image results found in your custom view of the web.
@param customConfig The identifier for the custom search configuration
@param query The user's search query term. The term cannot be empty. The term may contain [Bing Advanced Operators](... | [
"The",
"Custom",
"Image",
"Search",
"API",
"lets",
"you",
"send",
"an",
"image",
"search",
"query",
"to",
"Bing",
"and",
"get",
"image",
"results",
"found",
"in",
"your",
"custom",
"view",
"of",
"the",
"web",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/search/bingcustomimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customimagesearch/implementation/BingCustomInstancesImpl.java#L109-L116 |
agaricusb/SpecialSourceMP | src/main/java/net/md_5/specialsource/mavenplugin/InstallRemappedFileMojo.java | InstallRemappedFileMojo.installChecksum | private void installChecksum( File originalFile, File installedFile, Digester digester, String ext )
throws MojoExecutionException {
"""
Installs a checksum for the specified file.
@param originalFile The path to the file from which the checksum is generated, must not be <code>null</code>.
@param i... | java | private void installChecksum( File originalFile, File installedFile, Digester digester, String ext )
throws MojoExecutionException
{
String checksum;
getLog().debug( "Calculating " + digester.getAlgorithm() + " checksum for " + originalFile );
try
{
checksum =... | [
"private",
"void",
"installChecksum",
"(",
"File",
"originalFile",
",",
"File",
"installedFile",
",",
"Digester",
"digester",
",",
"String",
"ext",
")",
"throws",
"MojoExecutionException",
"{",
"String",
"checksum",
";",
"getLog",
"(",
")",
".",
"debug",
"(",
... | Installs a checksum for the specified file.
@param originalFile The path to the file from which the checksum is generated, must not be <code>null</code>.
@param installedFile The base path from which the path to the checksum files is derived by appending the given
file extension, must not be <code>null</code>.
@param ... | [
"Installs",
"a",
"checksum",
"for",
"the",
"specified",
"file",
"."
] | train | https://github.com/agaricusb/SpecialSourceMP/blob/350daa04831fb93a51a57a30009c572ade0a88bf/src/main/java/net/md_5/specialsource/mavenplugin/InstallRemappedFileMojo.java#L578-L604 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDataListServletExample.java | WDataListServletExample.addField | private void addField(final WComponent input, final String labelText, final String labelHint) {
"""
Adds a field to the example's layout.
@param input the input field to add.
@param labelText the label text for the field.
@param labelHint the optional label hint for the field.
"""
WLabel label = new WLa... | java | private void addField(final WComponent input, final String labelText, final String labelHint) {
WLabel label = new WLabel(labelText, input);
if (labelHint != null) {
label.setHint(labelHint);
}
layout.addField(label, input);
} | [
"private",
"void",
"addField",
"(",
"final",
"WComponent",
"input",
",",
"final",
"String",
"labelText",
",",
"final",
"String",
"labelHint",
")",
"{",
"WLabel",
"label",
"=",
"new",
"WLabel",
"(",
"labelText",
",",
"input",
")",
";",
"if",
"(",
"labelHint... | Adds a field to the example's layout.
@param input the input field to add.
@param labelText the label text for the field.
@param labelHint the optional label hint for the field. | [
"Adds",
"a",
"field",
"to",
"the",
"example",
"s",
"layout",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDataListServletExample.java#L137-L144 |
AlmogBaku/IntlPhoneInput | intlphoneinput/src/main/java/net/rimoto/intlphoneinput/IntlPhoneInput.java | IntlPhoneInput.setOnKeyboardDone | public void setOnKeyboardDone(final IntlPhoneInputListener listener) {
"""
Set keyboard done listener to detect when the user click "DONE" on his keyboard
@param listener IntlPhoneInputListener
"""
mPhoneEdit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
... | java | public void setOnKeyboardDone(final IntlPhoneInputListener listener) {
mPhoneEdit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DO... | [
"public",
"void",
"setOnKeyboardDone",
"(",
"final",
"IntlPhoneInputListener",
"listener",
")",
"{",
"mPhoneEdit",
".",
"setOnEditorActionListener",
"(",
"new",
"TextView",
".",
"OnEditorActionListener",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"onEditorAc... | Set keyboard done listener to detect when the user click "DONE" on his keyboard
@param listener IntlPhoneInputListener | [
"Set",
"keyboard",
"done",
"listener",
"to",
"detect",
"when",
"the",
"user",
"click",
"DONE",
"on",
"his",
"keyboard"
] | train | https://github.com/AlmogBaku/IntlPhoneInput/blob/ac7313a2d1683feb4d535d5dbee6676b53879059/intlphoneinput/src/main/java/net/rimoto/intlphoneinput/IntlPhoneInput.java#L397-L407 |
JodaOrg/joda-time | src/main/java/org/joda/time/tz/ZoneInfoProvider.java | ZoneInfoProvider.readZoneInfoMap | private static void readZoneInfoMap(DataInputStream din, Map<String, Object> zimap) throws IOException {
"""
Reads the zone info map from file.
@param din the input stream
@param zimap gets filled with string id to string id mappings
"""
// Read the string pool.
int size = din.readUnsigne... | java | private static void readZoneInfoMap(DataInputStream din, Map<String, Object> zimap) throws IOException {
// Read the string pool.
int size = din.readUnsignedShort();
String[] pool = new String[size];
for (int i=0; i<size; i++) {
pool[i] = din.readUTF().intern();
}
... | [
"private",
"static",
"void",
"readZoneInfoMap",
"(",
"DataInputStream",
"din",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"zimap",
")",
"throws",
"IOException",
"{",
"// Read the string pool.",
"int",
"size",
"=",
"din",
".",
"readUnsignedShort",
"(",
")",
... | Reads the zone info map from file.
@param din the input stream
@param zimap gets filled with string id to string id mappings | [
"Reads",
"the",
"zone",
"info",
"map",
"from",
"file",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/ZoneInfoProvider.java#L286-L303 |
wildfly/wildfly-maven-plugin | core/src/main/java/org/wildfly/plugin/core/ServerHelper.java | ServerHelper.waitForStandalone | public static void waitForStandalone(final Process process, final ModelControllerClient client, final long startupTimeout)
throws InterruptedException, RuntimeException, TimeoutException {
"""
Waits the given amount of time in seconds for a standalone server to start.
<p>
If the {@code process} is no... | java | public static void waitForStandalone(final Process process, final ModelControllerClient client, final long startupTimeout)
throws InterruptedException, RuntimeException, TimeoutException {
Assert.checkNotNullParam("client", client);
long timeout = startupTimeout * 1000;
final long sl... | [
"public",
"static",
"void",
"waitForStandalone",
"(",
"final",
"Process",
"process",
",",
"final",
"ModelControllerClient",
"client",
",",
"final",
"long",
"startupTimeout",
")",
"throws",
"InterruptedException",
",",
"RuntimeException",
",",
"TimeoutException",
"{",
... | Waits the given amount of time in seconds for a standalone server to start.
<p>
If the {@code process} is not {@code null} and a timeout occurs the process will be
{@linkplain Process#destroy() destroyed}.
</p>
@param process the Java process can be {@code null} if no process is available
@param client ... | [
"Waits",
"the",
"given",
"amount",
"of",
"time",
"in",
"seconds",
"for",
"a",
"standalone",
"server",
"to",
"start",
".",
"<p",
">",
"If",
"the",
"{",
"@code",
"process",
"}",
"is",
"not",
"{",
"@code",
"null",
"}",
"and",
"a",
"timeout",
"occurs",
"... | train | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/core/src/main/java/org/wildfly/plugin/core/ServerHelper.java#L307-L329 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.setTableAliasForPath | private void setTableAliasForPath(String aPath, List hintClasses, TableAlias anAlias) {
"""
Set the TableAlias for aPath
@param aPath
@param hintClasses
@param TableAlias
"""
m_pathToAlias.put(buildAliasKey(aPath, hintClasses), anAlias);
} | java | private void setTableAliasForPath(String aPath, List hintClasses, TableAlias anAlias)
{
m_pathToAlias.put(buildAliasKey(aPath, hintClasses), anAlias);
} | [
"private",
"void",
"setTableAliasForPath",
"(",
"String",
"aPath",
",",
"List",
"hintClasses",
",",
"TableAlias",
"anAlias",
")",
"{",
"m_pathToAlias",
".",
"put",
"(",
"buildAliasKey",
"(",
"aPath",
",",
"hintClasses",
")",
",",
"anAlias",
")",
";",
"}"
] | Set the TableAlias for aPath
@param aPath
@param hintClasses
@param TableAlias | [
"Set",
"the",
"TableAlias",
"for",
"aPath"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L1370-L1373 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPOptimizer.java | AFPOptimizer.updateScore | public static void updateScore(FatCatParameters params, AFPChain afpChain) {
"""
to update the chaining score after block delete and merge processed
the blockScore value is important for significance evaluation
"""
int i, j, bknow, bkold, g1, g2;
afpChain.setConn(0d);
afpChain.setDVar(0d);
int ... | java | public static void updateScore(FatCatParameters params, AFPChain afpChain)
{
int i, j, bknow, bkold, g1, g2;
afpChain.setConn(0d);
afpChain.setDVar(0d);
int blockNum = afpChain.getBlockNum();
int alignScoreUpdate = 0;
double[] blockScore = afpChain.getBlockScore();
int[] blockGap = afpChain.getBlo... | [
"public",
"static",
"void",
"updateScore",
"(",
"FatCatParameters",
"params",
",",
"AFPChain",
"afpChain",
")",
"{",
"int",
"i",
",",
"j",
",",
"bknow",
",",
"bkold",
",",
"g1",
",",
"g2",
";",
"afpChain",
".",
"setConn",
"(",
"0d",
")",
";",
"afpChain... | to update the chaining score after block delete and merge processed
the blockScore value is important for significance evaluation | [
"to",
"update",
"the",
"chaining",
"score",
"after",
"block",
"delete",
"and",
"merge",
"processed",
"the",
"blockScore",
"value",
"is",
"important",
"for",
"significance",
"evaluation"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPOptimizer.java#L209-L260 |
apache/incubator-druid | server/src/main/java/org/apache/druid/server/coordinator/helper/NewestSegmentFirstIterator.java | NewestSegmentFirstIterator.filterSkipIntervals | @VisibleForTesting
static List<Interval> filterSkipIntervals(Interval totalInterval, List<Interval> skipIntervals) {
"""
Returns a list of intervals which are contained by totalInterval but don't ovarlap with skipIntervals.
@param totalInterval total interval
@param skipIntervals intervals to skip. This shou... | java | @VisibleForTesting
static List<Interval> filterSkipIntervals(Interval totalInterval, List<Interval> skipIntervals)
{
final List<Interval> filteredIntervals = new ArrayList<>(skipIntervals.size() + 1);
DateTime remainingStart = totalInterval.getStart();
DateTime remainingEnd = totalInterval.getEnd();
... | [
"@",
"VisibleForTesting",
"static",
"List",
"<",
"Interval",
">",
"filterSkipIntervals",
"(",
"Interval",
"totalInterval",
",",
"List",
"<",
"Interval",
">",
"skipIntervals",
")",
"{",
"final",
"List",
"<",
"Interval",
">",
"filteredIntervals",
"=",
"new",
"Arra... | Returns a list of intervals which are contained by totalInterval but don't ovarlap with skipIntervals.
@param totalInterval total interval
@param skipIntervals intervals to skip. This should be sorted by {@link Comparators#intervalsByStartThenEnd()}. | [
"Returns",
"a",
"list",
"of",
"intervals",
"which",
"are",
"contained",
"by",
"totalInterval",
"but",
"don",
"t",
"ovarlap",
"with",
"skipIntervals",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/server/coordinator/helper/NewestSegmentFirstIterator.java#L458-L488 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaagroup_auditnslogpolicy_binding.java | aaagroup_auditnslogpolicy_binding.count_filtered | public static long count_filtered(nitro_service service, String groupname, String filter) throws Exception {
"""
Use this API to count the filtered set of aaagroup_auditnslogpolicy_binding resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
"""
aaagroup_auditnslogpolicy_binding... | java | public static long count_filtered(nitro_service service, String groupname, String filter) throws Exception{
aaagroup_auditnslogpolicy_binding obj = new aaagroup_auditnslogpolicy_binding();
obj.set_groupname(groupname);
options option = new options();
option.set_count(true);
option.set_filter(filter);
aaagro... | [
"public",
"static",
"long",
"count_filtered",
"(",
"nitro_service",
"service",
",",
"String",
"groupname",
",",
"String",
"filter",
")",
"throws",
"Exception",
"{",
"aaagroup_auditnslogpolicy_binding",
"obj",
"=",
"new",
"aaagroup_auditnslogpolicy_binding",
"(",
")",
... | Use this API to count the filtered set of aaagroup_auditnslogpolicy_binding resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP". | [
"Use",
"this",
"API",
"to",
"count",
"the",
"filtered",
"set",
"of",
"aaagroup_auditnslogpolicy_binding",
"resources",
".",
"filter",
"string",
"should",
"be",
"in",
"JSON",
"format",
".",
"eg",
":",
"port",
":",
"80",
"servicetype",
":",
"HTTP",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaagroup_auditnslogpolicy_binding.java#L298-L309 |
alkacon/opencms-core | src/org/opencms/site/xmlsitemap/CmsXmlSitemapGenerator.java | CmsXmlSitemapGenerator.replaceServerUri | public static String replaceServerUri(String link, String server) {
"""
Replaces the protocol/host/port of a link with the ones from the given server URI, if it's not empty.<p>
@param link the link to change
@param server the server URI string
@return the changed link
"""
String serverUriStr ... | java | public static String replaceServerUri(String link, String server) {
String serverUriStr = server;
if (CmsStringUtil.isEmptyOrWhitespaceOnly(serverUriStr)) {
return link;
}
try {
URI serverUri = new URI(serverUriStr);
URI linkUri = new URI(li... | [
"public",
"static",
"String",
"replaceServerUri",
"(",
"String",
"link",
",",
"String",
"server",
")",
"{",
"String",
"serverUriStr",
"=",
"server",
";",
"if",
"(",
"CmsStringUtil",
".",
"isEmptyOrWhitespaceOnly",
"(",
"serverUriStr",
")",
")",
"{",
"return",
... | Replaces the protocol/host/port of a link with the ones from the given server URI, if it's not empty.<p>
@param link the link to change
@param server the server URI string
@return the changed link | [
"Replaces",
"the",
"protocol",
"/",
"host",
"/",
"port",
"of",
"a",
"link",
"with",
"the",
"ones",
"from",
"the",
"given",
"server",
"URI",
"if",
"it",
"s",
"not",
"empty",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/xmlsitemap/CmsXmlSitemapGenerator.java#L211-L233 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/query/algebra/materialize/TempRecordPage.java | TempRecordPage.findSmallestFrom | private int findSmallestFrom(int startId, List<String> sortFlds, List<Integer> sortDirs) {
"""
Scan id larger than startId to find smallest record (included startId)
@param startId
@param sortFlds
@param sortDirs
@return the id of smallest record
"""
int minId = startId;
moveToId(startId);
while... | java | private int findSmallestFrom(int startId, List<String> sortFlds, List<Integer> sortDirs) {
int minId = startId;
moveToId(startId);
while (super.next()) {
int id = currentId();
if (minId < 0 || compareRecords(minId, id, sortFlds, sortDirs) > 0)
minId = id;
moveToId(id);
}
return minId;
... | [
"private",
"int",
"findSmallestFrom",
"(",
"int",
"startId",
",",
"List",
"<",
"String",
">",
"sortFlds",
",",
"List",
"<",
"Integer",
">",
"sortDirs",
")",
"{",
"int",
"minId",
"=",
"startId",
";",
"moveToId",
"(",
"startId",
")",
";",
"while",
"(",
"... | Scan id larger than startId to find smallest record (included startId)
@param startId
@param sortFlds
@param sortDirs
@return the id of smallest record | [
"Scan",
"id",
"larger",
"than",
"startId",
"to",
"find",
"smallest",
"record",
"(",
"included",
"startId",
")"
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/query/algebra/materialize/TempRecordPage.java#L113-L123 |
akarnokd/ixjava | src/main/java/ix/Ix.java | Ix.subscribe | public final void subscribe(IxConsumer<? super T> onNext, IxConsumer<Throwable> onError) {
"""
Iterates over this sequence and calls the given onNext action with
each element and calls the onError with any exception thrown by the iteration
or the onNext action.
@param onNext the consumer to call with each eleme... | java | public final void subscribe(IxConsumer<? super T> onNext, IxConsumer<Throwable> onError) {
try {
for (T v : this) {
onNext.accept(v);
}
} catch (Throwable ex) {
onError.accept(ex);
}
} | [
"public",
"final",
"void",
"subscribe",
"(",
"IxConsumer",
"<",
"?",
"super",
"T",
">",
"onNext",
",",
"IxConsumer",
"<",
"Throwable",
">",
"onError",
")",
"{",
"try",
"{",
"for",
"(",
"T",
"v",
":",
"this",
")",
"{",
"onNext",
".",
"accept",
"(",
... | Iterates over this sequence and calls the given onNext action with
each element and calls the onError with any exception thrown by the iteration
or the onNext action.
@param onNext the consumer to call with each element
@param onError the consumer to call with the exception thrown
@throws NullPointerException if onErro... | [
"Iterates",
"over",
"this",
"sequence",
"and",
"calls",
"the",
"given",
"onNext",
"action",
"with",
"each",
"element",
"and",
"calls",
"the",
"onError",
"with",
"any",
"exception",
"thrown",
"by",
"the",
"iteration",
"or",
"the",
"onNext",
"action",
"."
] | train | https://github.com/akarnokd/ixjava/blob/add721bba550c36541faa450e40a975bb65e78d7/src/main/java/ix/Ix.java#L2589-L2597 |
authlete/authlete-java-common | src/main/java/com/authlete/common/util/TypedProperties.java | TypedProperties.setEnum | public <TEnum extends Enum<TEnum>> void setEnum(String key, TEnum value) {
"""
Equivalent to {@link #setString(String, String)
setString}{@code (key, (value == null) ? null : value.name())}.
"""
setString(key, (value == null) ? null : value.name());
} | java | public <TEnum extends Enum<TEnum>> void setEnum(String key, TEnum value)
{
setString(key, (value == null) ? null : value.name());
} | [
"public",
"<",
"TEnum",
"extends",
"Enum",
"<",
"TEnum",
">",
">",
"void",
"setEnum",
"(",
"String",
"key",
",",
"TEnum",
"value",
")",
"{",
"setString",
"(",
"key",
",",
"(",
"value",
"==",
"null",
")",
"?",
"null",
":",
"value",
".",
"name",
"(",... | Equivalent to {@link #setString(String, String)
setString}{@code (key, (value == null) ? null : value.name())}. | [
"Equivalent",
"to",
"{"
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/TypedProperties.java#L751-L754 |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/gateway/client/impl/ws/WebSocketCompositeHandler.java | WebSocketCompositeHandler.processConnect | @Override
public void processConnect(WebSocketChannel channel, WSURI location, String[] protocols) {
"""
Connect the WebSocket object to the remote location
@param channel WebSocket channel
@param location location of the WebSocket
@param protocol protocol spoken over the WebSocket
"""
LOG.enter... | java | @Override
public void processConnect(WebSocketChannel channel, WSURI location, String[] protocols) {
LOG.entering(CLASS_NAME, "connect", channel);
WebSocketCompositeChannel compositeChannel = (WebSocketCompositeChannel)channel;
if (compositeChannel.readyState != ReadyState.CLOSED) {... | [
"@",
"Override",
"public",
"void",
"processConnect",
"(",
"WebSocketChannel",
"channel",
",",
"WSURI",
"location",
",",
"String",
"[",
"]",
"protocols",
")",
"{",
"LOG",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"connect\"",
",",
"channel",
")",
";",
"WebSo... | Connect the WebSocket object to the remote location
@param channel WebSocket channel
@param location location of the WebSocket
@param protocol protocol spoken over the WebSocket | [
"Connect",
"the",
"WebSocket",
"object",
"to",
"the",
"remote",
"location"
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/impl/ws/WebSocketCompositeHandler.java#L145-L182 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.unshareProject | public void unshareProject(Object projectIdOrPath, Integer groupId) throws GitLabApiException {
"""
Unshare the project from the group.
<pre><code>DELETE /projects/:id/share/:group_id</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project insta... | java | public void unshareProject(Object projectIdOrPath, Integer groupId) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects", getProjectIdOrPath(projectIdOrPath), "share", groupId... | [
"public",
"void",
"unshareProject",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"groupId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
".",
"Status",
"expectedStatus",
"=",
"(",
"isApiVersion",
"(",
"ApiVersion",
".",
"V3",
")",
"?",
"Response",
... | Unshare the project from the group.
<pre><code>DELETE /projects/:id/share/:group_id</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param groupId the ID of the group to unshare, required
@throws GitLabApiException if any excep... | [
"Unshare",
"the",
"project",
"from",
"the",
"group",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L2100-L2103 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/utils/BtcFormat.java | BtcFormat.getMicroInstance | public static BtcFormat getMicroInstance(Locale locale, int scale, int... groups) {
"""
Return a new microcoin-denominated formatter for the given locale with the specified
fractional decimal placing. The returned object will format the fractional part of
numbers with the given minimum number of fractional deci... | java | public static BtcFormat getMicroInstance(Locale locale, int scale, int... groups) {
return getInstance(MICROCOIN_SCALE, locale, scale, boxAsList(groups));
} | [
"public",
"static",
"BtcFormat",
"getMicroInstance",
"(",
"Locale",
"locale",
",",
"int",
"scale",
",",
"int",
"...",
"groups",
")",
"{",
"return",
"getInstance",
"(",
"MICROCOIN_SCALE",
",",
"locale",
",",
"scale",
",",
"boxAsList",
"(",
"groups",
")",
")",... | Return a new microcoin-denominated formatter for the given locale with the specified
fractional decimal placing. The returned object will format the fractional part of
numbers with the given minimum number of fractional decimal places. Optionally,
repeating integer arguments can be passed, each indicating the size of... | [
"Return",
"a",
"new",
"microcoin",
"-",
"denominated",
"formatter",
"for",
"the",
"given",
"locale",
"with",
"the",
"specified",
"fractional",
"decimal",
"placing",
".",
"The",
"returned",
"object",
"will",
"format",
"the",
"fractional",
"part",
"of",
"numbers",... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/utils/BtcFormat.java#L1048-L1050 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/annotation/AnnotationValue.java | AnnotationValue.getAnnotation | public @Nonnull final <T extends Annotation> Optional<AnnotationValue<T>> getAnnotation(String member, Class<T> type) {
"""
Gets a list of {@link AnnotationValue} for the given member.
@param member The member
@param type The type
@param <T> The type
@throws IllegalStateException If no member is available th... | java | public @Nonnull final <T extends Annotation> Optional<AnnotationValue<T>> getAnnotation(String member, Class<T> type) {
return getAnnotations(member, type).stream().findFirst();
} | [
"public",
"@",
"Nonnull",
"final",
"<",
"T",
"extends",
"Annotation",
">",
"Optional",
"<",
"AnnotationValue",
"<",
"T",
">",
">",
"getAnnotation",
"(",
"String",
"member",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"getAnnotations",
"(",
"... | Gets a list of {@link AnnotationValue} for the given member.
@param member The member
@param type The type
@param <T> The type
@throws IllegalStateException If no member is available that conforms to the given name and type
@return The result | [
"Gets",
"a",
"list",
"of",
"{",
"@link",
"AnnotationValue",
"}",
"for",
"the",
"given",
"member",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/annotation/AnnotationValue.java#L264-L266 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildMethodTags | public void buildMethodTags(XMLNode node, Content methodsContentTree) {
"""
Build the method tags.
@param node the XML element that specifies which components to document
@param methodsContentTree content tree to which the documentation will be added
"""
methodWriter.addMemberTags((ExecutableElemen... | java | public void buildMethodTags(XMLNode node, Content methodsContentTree) {
methodWriter.addMemberTags((ExecutableElement)currentMember, methodsContentTree);
ExecutableElement method = (ExecutableElement)currentMember;
if (method.getSimpleName().toString().compareTo("writeExternal") == 0
... | [
"public",
"void",
"buildMethodTags",
"(",
"XMLNode",
"node",
",",
"Content",
"methodsContentTree",
")",
"{",
"methodWriter",
".",
"addMemberTags",
"(",
"(",
"ExecutableElement",
")",
"currentMember",
",",
"methodsContentTree",
")",
";",
"ExecutableElement",
"method",
... | Build the method tags.
@param node the XML element that specifies which components to document
@param methodsContentTree content tree to which the documentation will be added | [
"Build",
"the",
"method",
"tags",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java#L366-L378 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java | AtomicReferenceFieldUpdater.getAndUpdate | public final V getAndUpdate(T obj, UnaryOperator<V> updateFunction) {
"""
Atomically updates the field of the given object managed by this updater
with the results of applying the given function, returning the previous
value. The function should be side-effect-free, since it may be
re-applied when attempted upd... | java | public final V getAndUpdate(T obj, UnaryOperator<V> updateFunction) {
V prev, next;
do {
prev = get(obj);
next = updateFunction.apply(prev);
} while (!compareAndSet(obj, prev, next));
return prev;
} | [
"public",
"final",
"V",
"getAndUpdate",
"(",
"T",
"obj",
",",
"UnaryOperator",
"<",
"V",
">",
"updateFunction",
")",
"{",
"V",
"prev",
",",
"next",
";",
"do",
"{",
"prev",
"=",
"get",
"(",
"obj",
")",
";",
"next",
"=",
"updateFunction",
".",
"apply",... | Atomically updates the field of the given object managed by this updater
with the results of applying the given function, returning the previous
value. The function should be side-effect-free, since it may be
re-applied when attempted updates fail due to contention among threads.
@param obj An object whose field to ge... | [
"Atomically",
"updates",
"the",
"field",
"of",
"the",
"given",
"object",
"managed",
"by",
"this",
"updater",
"with",
"the",
"results",
"of",
"applying",
"the",
"given",
"function",
"returning",
"the",
"previous",
"value",
".",
"The",
"function",
"should",
"be"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java#L205-L212 |
alkacon/opencms-core | src/org/opencms/workplace/tools/CmsToolGroup.java | CmsToolGroup.addAdminTool | public void addAdminTool(CmsTool adminTool, float position) {
"""
Adds an admin tool at the given position.<p>
@param adminTool the admin tool
@param position the position
@see org.opencms.workplace.tools.CmsIdentifiableObjectContainer#addIdentifiableObject(String, Object, float)
"""
m_containe... | java | public void addAdminTool(CmsTool adminTool, float position) {
m_container.addIdentifiableObject(adminTool.getId(), adminTool, position);
} | [
"public",
"void",
"addAdminTool",
"(",
"CmsTool",
"adminTool",
",",
"float",
"position",
")",
"{",
"m_container",
".",
"addIdentifiableObject",
"(",
"adminTool",
".",
"getId",
"(",
")",
",",
"adminTool",
",",
"position",
")",
";",
"}"
] | Adds an admin tool at the given position.<p>
@param adminTool the admin tool
@param position the position
@see org.opencms.workplace.tools.CmsIdentifiableObjectContainer#addIdentifiableObject(String, Object, float) | [
"Adds",
"an",
"admin",
"tool",
"at",
"the",
"given",
"position",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/tools/CmsToolGroup.java#L87-L90 |
JakeWharton/NineOldAndroids | library/src/com/nineoldandroids/animation/PropertyValuesHolder.java | PropertyValuesHolder.getMethodName | static String getMethodName(String prefix, String propertyName) {
"""
Utility method to derive a setter/getter method name from a property name, where the
prefix is typically "set" or "get" and the first letter of the property name is
capitalized.
@param prefix The precursor to the method name, before the pro... | java | static String getMethodName(String prefix, String propertyName) {
if (propertyName == null || propertyName.length() == 0) {
// shouldn't get here
return prefix;
}
char firstLetter = Character.toUpperCase(propertyName.charAt(0));
String theRest = propertyName.subst... | [
"static",
"String",
"getMethodName",
"(",
"String",
"prefix",
",",
"String",
"propertyName",
")",
"{",
"if",
"(",
"propertyName",
"==",
"null",
"||",
"propertyName",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"// shouldn't get here",
"return",
"prefix",
"... | Utility method to derive a setter/getter method name from a property name, where the
prefix is typically "set" or "get" and the first letter of the property name is
capitalized.
@param prefix The precursor to the method name, before the property name begins, typically
"set" or "get".
@param propertyName The name of th... | [
"Utility",
"method",
"to",
"derive",
"a",
"setter",
"/",
"getter",
"method",
"name",
"from",
"a",
"property",
"name",
"where",
"the",
"prefix",
"is",
"typically",
"set",
"or",
"get",
"and",
"the",
"first",
"letter",
"of",
"the",
"property",
"name",
"is",
... | train | https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/animation/PropertyValuesHolder.java#L743-L751 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicated_server_serviceName_firewall_duration_GET | public OvhOrder dedicated_server_serviceName_firewall_duration_GET(String serviceName, String duration, OvhFirewallModelEnum firewallModel) throws IOException {
"""
Get prices and contracts information
REST: GET /order/dedicated/server/{serviceName}/firewall/{duration}
@param firewallModel [required] Firewall ... | java | public OvhOrder dedicated_server_serviceName_firewall_duration_GET(String serviceName, String duration, OvhFirewallModelEnum firewallModel) throws IOException {
String qPath = "/order/dedicated/server/{serviceName}/firewall/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "firewallMod... | [
"public",
"OvhOrder",
"dedicated_server_serviceName_firewall_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhFirewallModelEnum",
"firewallModel",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/dedicated/server/{serviceName}... | Get prices and contracts information
REST: GET /order/dedicated/server/{serviceName}/firewall/{duration}
@param firewallModel [required] Firewall type
@param serviceName [required] The internal name of your dedicated server
@param duration [required] Duration | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2786-L2792 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/bci/AbstractRasClassAdapter.java | AbstractRasClassAdapter.visitAnnotation | @Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
"""
Visit the class annotations looking at the supported RAS annotations.
The result of running the visitors are only used when a {@code ClassInfo} model object was not provided during construction.
@param desc
the annotati... | java | @Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
AnnotationVisitor av = super.visitAnnotation(desc, visible);
observedAnnotations.add(Type.getType(desc));
if (classInfo == null) {
if (TRACE_OPTIONS_TYPE.getDescriptor().equals(desc)) {
... | [
"@",
"Override",
"public",
"AnnotationVisitor",
"visitAnnotation",
"(",
"String",
"desc",
",",
"boolean",
"visible",
")",
"{",
"AnnotationVisitor",
"av",
"=",
"super",
".",
"visitAnnotation",
"(",
"desc",
",",
"visible",
")",
";",
"observedAnnotations",
".",
"ad... | Visit the class annotations looking at the supported RAS annotations.
The result of running the visitors are only used when a {@code ClassInfo} model object was not provided during construction.
@param desc
the annotation descriptor
@param visible
true if the annotation is a runtime visible annotation | [
"Visit",
"the",
"class",
"annotations",
"looking",
"at",
"the",
"supported",
"RAS",
"annotations",
".",
"The",
"result",
"of",
"running",
"the",
"visitors",
"are",
"only",
"used",
"when",
"a",
"{",
"@code",
"ClassInfo",
"}",
"model",
"object",
"was",
"not",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/bci/AbstractRasClassAdapter.java#L154-L169 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/RsaEncryptedPropertyField.java | RsaEncryptedPropertyField.setupDefaultView | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) {
"""
Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param t... | java | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties)
{
converter = new PropertiesConverter((Converter)converter, "value");
converter = new RsaEncryptedConverter((Converter)converter);
... | [
"public",
"ScreenComponent",
"setupDefaultView",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"converter"... | Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param targetScreen Where to place this component (ie., Parent screen or GridBagLayout).
@param converter The converter to set the screenfield to.
@param iDisplayFieldDesc Display the labe... | [
"Set",
"up",
"the",
"default",
"screen",
"control",
"for",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/RsaEncryptedPropertyField.java#L90-L98 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.