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 |
|---|---|---|---|---|---|---|---|---|---|---|
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-kms/src/main/java/com/ibm/cloud/objectstorage/services/kms/model/EncryptRequest.java | EncryptRequest.getGrantTokens | public java.util.List<String> getGrantTokens() {
"""
<p>
A list of grant tokens.
</p>
<p>
For more information, see <a
href="http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token">Grant Tokens</a> in the
<i>AWS Key Management Service Developer Guide</i>.
</p>
@return A list of gr... | java | public java.util.List<String> getGrantTokens() {
if (grantTokens == null) {
grantTokens = new com.ibm.cloud.objectstorage.internal.SdkInternalList<String>();
}
return grantTokens;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"getGrantTokens",
"(",
")",
"{",
"if",
"(",
"grantTokens",
"==",
"null",
")",
"{",
"grantTokens",
"=",
"new",
"com",
".",
"ibm",
".",
"cloud",
".",
"objectstorage",
".",
"internal",
".",
... | <p>
A list of grant tokens.
</p>
<p>
For more information, see <a
href="http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token">Grant Tokens</a> in the
<i>AWS Key Management Service Developer Guide</i>.
</p>
@return A list of grant tokens.</p>
<p>
For more information, see <a
href="http://docs.... | [
"<p",
">",
"A",
"list",
"of",
"grant",
"tokens",
".",
"<",
"/",
"p",
">",
"<p",
">",
"For",
"more",
"information",
"see",
"<a",
"href",
"=",
"http",
":",
"//",
"docs",
".",
"aws",
".",
"amazon",
".",
"com",
"/",
"kms",
"/",
"latest",
"/",
"deve... | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-kms/src/main/java/com/ibm/cloud/objectstorage/services/kms/model/EncryptRequest.java#L423-L428 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.rotateXYZ | public Matrix4x3d rotateXYZ(Vector3d angles) {
"""
Apply rotation of <code>angles.x</code> radians about the X axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate... | java | public Matrix4x3d rotateXYZ(Vector3d angles) {
return rotateXYZ(angles.x, angles.y, angles.z);
} | [
"public",
"Matrix4x3d",
"rotateXYZ",
"(",
"Vector3d",
"angles",
")",
"{",
"return",
"rotateXYZ",
"(",
"angles",
".",
"x",
",",
"angles",
".",
"y",
",",
"angles",
".",
"z",
")",
";",
"}"
] | Apply rotation of <code>angles.x</code> radians about the X axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter... | [
"Apply",
"rotation",
"of",
"<code",
">",
"angles",
".",
"x<",
"/",
"code",
">",
"radians",
"about",
"the",
"X",
"axis",
"followed",
"by",
"a",
"rotation",
"of",
"<code",
">",
"angles",
".",
"y<",
"/",
"code",
">",
"radians",
"about",
"the",
"Y",
"axi... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L4388-L4390 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.listConnectionsAsync | public Observable<Page<VirtualNetworkGatewayConnectionListEntityInner>> listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName) {
"""
Gets all the connections in a virtual network gateway.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGateway... | java | public Observable<Page<VirtualNetworkGatewayConnectionListEntityInner>> listConnectionsAsync(final String resourceGroupName, final String virtualNetworkGatewayName) {
return listConnectionsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName)
.map(new Func1<ServiceResponse<Page<Virt... | [
"public",
"Observable",
"<",
"Page",
"<",
"VirtualNetworkGatewayConnectionListEntityInner",
">",
">",
"listConnectionsAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"virtualNetworkGatewayName",
")",
"{",
"return",
"listConnectionsWithServiceRespo... | Gets all the connections in a virtual network gateway.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<VirtualNetworkGa... | [
"Gets",
"all",
"the",
"connections",
"in",
"a",
"virtual",
"network",
"gateway",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L1077-L1085 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.listNextAsync | public Observable<Page<CloudJob>> listNextAsync(final String nextPageLink, final JobListNextOptions jobListNextOptions) {
"""
Lists all of the jobs in the specified account.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param jobListNextOptions Additional parameters for... | java | public Observable<Page<CloudJob>> listNextAsync(final String nextPageLink, final JobListNextOptions jobListNextOptions) {
return listNextWithServiceResponseAsync(nextPageLink, jobListNextOptions)
.map(new Func1<ServiceResponseWithHeaders<Page<CloudJob>, JobListHeaders>, Page<CloudJob>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"CloudJob",
">",
">",
"listNextAsync",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"JobListNextOptions",
"jobListNextOptions",
")",
"{",
"return",
"listNextWithServiceResponseAsync",
"(",
"nextPageLink",
",",
"jobLis... | Lists all of the jobs in the specified account.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param jobListNextOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<Cl... | [
"Lists",
"all",
"of",
"the",
"jobs",
"in",
"the",
"specified",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L3467-L3475 |
qatools/properties | src/main/java/ru/qatools/properties/PropertyLoader.java | PropertyLoader.convertValue | protected Object convertValue(AnnotatedElement element, String value) {
"""
Convert given value to specified type. If given element annotated with {@link Use} annotation
use {@link #getConverterForElementWithUseAnnotation(AnnotatedElement)} converter, otherwise
if element has collection type convert collection a... | java | protected Object convertValue(AnnotatedElement element, String value) {
Class<?> type = getValueType(element);
Type genericType = getValueGenericType(element);
try {
if (element.isAnnotationPresent(Use.class)) {
Converter converter = getConverterForElementWithUseAnno... | [
"protected",
"Object",
"convertValue",
"(",
"AnnotatedElement",
"element",
",",
"String",
"value",
")",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"getValueType",
"(",
"element",
")",
";",
"Type",
"genericType",
"=",
"getValueGenericType",
"(",
"element",
")",
... | Convert given value to specified type. If given element annotated with {@link Use} annotation
use {@link #getConverterForElementWithUseAnnotation(AnnotatedElement)} converter, otherwise
if element has collection type convert collection and finally try to convert element
using registered converters. | [
"Convert",
"given",
"value",
"to",
"specified",
"type",
".",
"If",
"given",
"element",
"annotated",
"with",
"{"
] | train | https://github.com/qatools/properties/blob/ae50b460a6bb4fcb21afe888b2e86a7613cd2115/src/main/java/ru/qatools/properties/PropertyLoader.java#L266-L284 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/info/XGlobalAttributeNameMap.java | XGlobalAttributeNameMap.registerMapping | public void registerMapping(String mappingName, String attributeKey, String alias) {
"""
Registers a known attribute for mapping in a given attribute name
map. <b>IMPORTANT:</b> This method should only be called when one
intends to create, or add to, the global attribute name mapping.
@param mappingName Name ... | java | public void registerMapping(String mappingName, String attributeKey, String alias) {
XAttributeNameMapImpl mapping = (XAttributeNameMapImpl)getMapping(mappingName);
mapping.registerMapping(attributeKey, alias);
} | [
"public",
"void",
"registerMapping",
"(",
"String",
"mappingName",
",",
"String",
"attributeKey",
",",
"String",
"alias",
")",
"{",
"XAttributeNameMapImpl",
"mapping",
"=",
"(",
"XAttributeNameMapImpl",
")",
"getMapping",
"(",
"mappingName",
")",
";",
"mapping",
"... | Registers a known attribute for mapping in a given attribute name
map. <b>IMPORTANT:</b> This method should only be called when one
intends to create, or add to, the global attribute name mapping.
@param mappingName Name of the mapping to register with.
@param attributeKey Attribute key to be mapped.
@param alias Alia... | [
"Registers",
"a",
"known",
"attribute",
"for",
"mapping",
"in",
"a",
"given",
"attribute",
"name",
"map",
".",
"<b",
">",
"IMPORTANT",
":",
"<",
"/",
"b",
">",
"This",
"method",
"should",
"only",
"be",
"called",
"when",
"one",
"intends",
"to",
"create",
... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/info/XGlobalAttributeNameMap.java#L272-L275 |
ykrasik/jaci | jaci-reflection-api/src/main/java/com/github/ykrasik/jaci/reflection/ReflectionUtils.java | ReflectionUtils.isAssignableFrom | public static boolean isAssignableFrom(Class<?> c1, Class<?> c2) {
"""
Determines if the class or interface represented by first Class parameter is either the same as, or is a superclass or
superinterface of, the class or interface represented by the second Class parameter.
@param c1 Class to check.
@param c2... | java | public static boolean isAssignableFrom(Class<?> c1, Class<?> c2) {
assertReflectionAccessor();
return accessor.isAssignableFrom(c1, c2);
} | [
"public",
"static",
"boolean",
"isAssignableFrom",
"(",
"Class",
"<",
"?",
">",
"c1",
",",
"Class",
"<",
"?",
">",
"c2",
")",
"{",
"assertReflectionAccessor",
"(",
")",
";",
"return",
"accessor",
".",
"isAssignableFrom",
"(",
"c1",
",",
"c2",
")",
";",
... | Determines if the class or interface represented by first Class parameter is either the same as, or is a superclass or
superinterface of, the class or interface represented by the second Class parameter.
@param c1 Class to check.
@param c2 Class to check against.
@return {@code true} if the first class parameter is ei... | [
"Determines",
"if",
"the",
"class",
"or",
"interface",
"represented",
"by",
"first",
"Class",
"parameter",
"is",
"either",
"the",
"same",
"as",
"or",
"is",
"a",
"superclass",
"or",
"superinterface",
"of",
"the",
"class",
"or",
"interface",
"represented",
"by",... | train | https://github.com/ykrasik/jaci/blob/4615edef7c76288ad5ea8d678132b161645ca1e3/jaci-reflection-api/src/main/java/com/github/ykrasik/jaci/reflection/ReflectionUtils.java#L174-L177 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/xml/suppression/SuppressionHandler.java | SuppressionHandler.startElement | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
"""
Handles the start element event.
@param uri the uri of the element being processed
@param localName the local name of the element being processed
@param qName the qName of the el... | java | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
currentAttributes = attributes;
currentText = new StringBuilder();
if (SUPPRESS.equals(qName)) {
rule = new SuppressionRule();
final String base... | [
"@",
"Override",
"public",
"void",
"startElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
",",
"Attributes",
"attributes",
")",
"throws",
"SAXException",
"{",
"currentAttributes",
"=",
"attributes",
";",
"currentText",
"=",
"ne... | Handles the start element event.
@param uri the uri of the element being processed
@param localName the local name of the element being processed
@param qName the qName of the element being processed
@param attributes the attributes of the element being processed
@throws SAXException thrown if there is an exception pr... | [
"Handles",
"the",
"start",
"element",
"event",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/suppression/SuppressionHandler.java#L119-L140 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java | AppsImpl.importMethod | public UUID importMethod(LuisApp luisApp, ImportMethodAppsOptionalParameter importMethodOptionalParameter) {
"""
Imports an application to LUIS, the application's structure should be included in in the request body.
@param luisApp A LUIS application structure.
@param importMethodOptionalParameter the object re... | java | public UUID importMethod(LuisApp luisApp, ImportMethodAppsOptionalParameter importMethodOptionalParameter) {
return importMethodWithServiceResponseAsync(luisApp, importMethodOptionalParameter).toBlocking().single().body();
} | [
"public",
"UUID",
"importMethod",
"(",
"LuisApp",
"luisApp",
",",
"ImportMethodAppsOptionalParameter",
"importMethodOptionalParameter",
")",
"{",
"return",
"importMethodWithServiceResponseAsync",
"(",
"luisApp",
",",
"importMethodOptionalParameter",
")",
".",
"toBlocking",
"(... | Imports an application to LUIS, the application's structure should be included in in the request body.
@param luisApp A LUIS application structure.
@param importMethodOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameter... | [
"Imports",
"an",
"application",
"to",
"LUIS",
"the",
"application",
"s",
"structure",
"should",
"be",
"included",
"in",
"in",
"the",
"request",
"body",
"."
] | 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/AppsImpl.java#L399-L401 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexReader.java | IndexReader.getBackpointerAttributeKey | protected UUID getBackpointerAttributeKey(long offset) {
"""
Generates a 16-byte UUID that encodes the given Offset as a Backpointer (to some other offset).
Format {0(64)}{Offset}
- MSB is 0
- LSB is Offset.
@param offset The offset to generate a backpointer from.
@return A UUID representing the Attribute K... | java | protected UUID getBackpointerAttributeKey(long offset) {
Preconditions.checkArgument(offset >= 0, "offset must be a non-negative number.");
return new UUID(TableBucket.BACKPOINTER_PREFIX, offset);
} | [
"protected",
"UUID",
"getBackpointerAttributeKey",
"(",
"long",
"offset",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"offset",
">=",
"0",
",",
"\"offset must be a non-negative number.\"",
")",
";",
"return",
"new",
"UUID",
"(",
"TableBucket",
".",
"BACKPO... | Generates a 16-byte UUID that encodes the given Offset as a Backpointer (to some other offset).
Format {0(64)}{Offset}
- MSB is 0
- LSB is Offset.
@param offset The offset to generate a backpointer from.
@return A UUID representing the Attribute Key. | [
"Generates",
"a",
"16",
"-",
"byte",
"UUID",
"that",
"encodes",
"the",
"given",
"Offset",
"as",
"a",
"Backpointer",
"(",
"to",
"some",
"other",
"offset",
")",
".",
"Format",
"{",
"0",
"(",
"64",
")",
"}",
"{",
"Offset",
"}",
"-",
"MSB",
"is",
"0",
... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexReader.java#L193-L196 |
ajoberstar/gradle-git | src/main/groovy/org/ajoberstar/gradle/git/auth/BasicPasswordCredentials.java | BasicPasswordCredentials.toGrgit | public Credentials toGrgit() {
"""
Converts to credentials for use in Grgit.
@return {@code null} if both username and password are {@code null},
otherwise returns credentials in Grgit format.
"""
if (username != null && password != null) {
return new Credentials(username, password);
... | java | public Credentials toGrgit() {
if (username != null && password != null) {
return new Credentials(username, password);
} else {
return null;
}
} | [
"public",
"Credentials",
"toGrgit",
"(",
")",
"{",
"if",
"(",
"username",
"!=",
"null",
"&&",
"password",
"!=",
"null",
")",
"{",
"return",
"new",
"Credentials",
"(",
"username",
",",
"password",
")",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
... | Converts to credentials for use in Grgit.
@return {@code null} if both username and password are {@code null},
otherwise returns credentials in Grgit format. | [
"Converts",
"to",
"credentials",
"for",
"use",
"in",
"Grgit",
"."
] | train | https://github.com/ajoberstar/gradle-git/blob/03b08b9f8dd2b2ff0ee9228906a6e9781b85ec79/src/main/groovy/org/ajoberstar/gradle/git/auth/BasicPasswordCredentials.java#L87-L93 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsVfsDriver.java | CmsVfsDriver.prepareResourceCondition | protected void prepareResourceCondition(CmsUUID projectId, int mode, StringBuffer conditions) {
"""
Appends the appropriate selection criteria related with the read mode.<p>
@param projectId the id of the project of the resources
@param mode the selection mode
@param conditions buffer to append the selection ... | java | protected void prepareResourceCondition(CmsUUID projectId, int mode, StringBuffer conditions) {
if ((mode & CmsDriverManager.READMODE_ONLY_FOLDERS) > 0) {
// C_READMODE_ONLY_FOLDERS: add condition to match only folders
conditions.append(BEGIN_INCLUDE_CONDITION);
conditions.a... | [
"protected",
"void",
"prepareResourceCondition",
"(",
"CmsUUID",
"projectId",
",",
"int",
"mode",
",",
"StringBuffer",
"conditions",
")",
"{",
"if",
"(",
"(",
"mode",
"&",
"CmsDriverManager",
".",
"READMODE_ONLY_FOLDERS",
")",
">",
"0",
")",
"{",
"// C_READMODE_... | Appends the appropriate selection criteria related with the read mode.<p>
@param projectId the id of the project of the resources
@param mode the selection mode
@param conditions buffer to append the selection criteria | [
"Appends",
"the",
"appropriate",
"selection",
"criteria",
"related",
"with",
"the",
"read",
"mode",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsVfsDriver.java#L4388-L4401 |
JM-Lab/utils-elasticsearch | src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchSearchAndCount.java | JMElasticsearchSearchAndCount.searchAllWithTargetCount | public SearchResponse searchAllWithTargetCount(String index, String type,
AggregationBuilder[] aggregationBuilders) {
"""
Search all with target count search response.
@param index the index
@param type the type
@param aggregationBuilders the aggregation builders
@ret... | java | public SearchResponse searchAllWithTargetCount(String index, String type,
AggregationBuilder[] aggregationBuilders) {
return searchAllWithTargetCount(index, type, null, aggregationBuilders);
} | [
"public",
"SearchResponse",
"searchAllWithTargetCount",
"(",
"String",
"index",
",",
"String",
"type",
",",
"AggregationBuilder",
"[",
"]",
"aggregationBuilders",
")",
"{",
"return",
"searchAllWithTargetCount",
"(",
"index",
",",
"type",
",",
"null",
",",
"aggregati... | Search all with target count search response.
@param index the index
@param type the type
@param aggregationBuilders the aggregation builders
@return the search response | [
"Search",
"all",
"with",
"target",
"count",
"search",
"response",
"."
] | train | https://github.com/JM-Lab/utils-elasticsearch/blob/6ccec90e1e51d65d2af5efbb6d7b9f9bad90e638/src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchSearchAndCount.java#L664-L667 |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RegisteredResources.java | RegisteredResources.generateNewBranch | protected Xid generateNewBranch() {
"""
Generates a new XidImpl to represent a new branch of this
transaction.
@return A new XidImpl representing a new branch of this transaction.
"""
if (tc.isEntryEnabled())
Tr.entry(tc, "generateNewBranch");
// Create a new Xid branch
... | java | protected Xid generateNewBranch() {
if (tc.isEntryEnabled())
Tr.entry(tc, "generateNewBranch");
// Create a new Xid branch
final XidImpl result = new XidImpl(_txServiceXid, ++_branchCount);
if (tc.isEntryEnabled())
Tr.exit(tc, "generateNewBranch", result);
... | [
"protected",
"Xid",
"generateNewBranch",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"generateNewBranch\"",
")",
";",
"// Create a new Xid branch",
"final",
"XidImpl",
"result",
"=",
"new",
"Xid... | Generates a new XidImpl to represent a new branch of this
transaction.
@return A new XidImpl representing a new branch of this transaction. | [
"Generates",
"a",
"new",
"XidImpl",
"to",
"represent",
"a",
"new",
"branch",
"of",
"this",
"transaction",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RegisteredResources.java#L630-L640 |
cloudant/java-cloudant | cloudant-http/src/main/java/com/cloudant/http/internal/interceptors/UserAgentInterceptor.java | UserAgentInterceptor.loadUA | private static String loadUA(ClassLoader loader, String filename) {
"""
Loads the properties file using the classloader provided. Creating a string from the properties
"user.agent.name" and "user.agent.version".
@param loader The class loader to use to load the resource.
@param filename The name of the file to ... | java | private static String loadUA(ClassLoader loader, String filename){
String ua = "cloudant-http";
String version = "unknown";
final InputStream propStream = loader.getResourceAsStream(filename);
final Properties properties = new Properties();
try {
if (propStream != nul... | [
"private",
"static",
"String",
"loadUA",
"(",
"ClassLoader",
"loader",
",",
"String",
"filename",
")",
"{",
"String",
"ua",
"=",
"\"cloudant-http\"",
";",
"String",
"version",
"=",
"\"unknown\"",
";",
"final",
"InputStream",
"propStream",
"=",
"loader",
".",
"... | Loads the properties file using the classloader provided. Creating a string from the properties
"user.agent.name" and "user.agent.version".
@param loader The class loader to use to load the resource.
@param filename The name of the file to load.
@return A string that represents the first part of the UA string eg java-c... | [
"Loads",
"the",
"properties",
"file",
"using",
"the",
"classloader",
"provided",
".",
"Creating",
"a",
"string",
"from",
"the",
"properties",
"user",
".",
"agent",
".",
"name",
"and",
"user",
".",
"agent",
".",
"version",
"."
] | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-http/src/main/java/com/cloudant/http/internal/interceptors/UserAgentInterceptor.java#L73-L93 |
knowm/XChange | xchange-core/src/main/java/org/knowm/xchange/utils/Assert.java | Assert.hasSize | public static void hasSize(Collection<?> input, int length, String message) {
"""
Asserts that a Collection is not null and of a certain size
@param input The input under test
@param message The message for any exception
"""
notNull(input, message);
if (input.size() != length) {
throw new Il... | java | public static void hasSize(Collection<?> input, int length, String message) {
notNull(input, message);
if (input.size() != length) {
throw new IllegalArgumentException(message);
}
} | [
"public",
"static",
"void",
"hasSize",
"(",
"Collection",
"<",
"?",
">",
"input",
",",
"int",
"length",
",",
"String",
"message",
")",
"{",
"notNull",
"(",
"input",
",",
"message",
")",
";",
"if",
"(",
"input",
".",
"size",
"(",
")",
"!=",
"length",
... | Asserts that a Collection is not null and of a certain size
@param input The input under test
@param message The message for any exception | [
"Asserts",
"that",
"a",
"Collection",
"is",
"not",
"null",
"and",
"of",
"a",
"certain",
"size"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-core/src/main/java/org/knowm/xchange/utils/Assert.java#L60-L66 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.setHeader | @Deprecated
public static void setHeader(HttpMessage message, String name, Object value) {
"""
@deprecated Use {@link #set(CharSequence, Object)} instead.
@see #setHeader(HttpMessage, CharSequence, Object)
"""
message.headers().set(name, value);
} | java | @Deprecated
public static void setHeader(HttpMessage message, String name, Object value) {
message.headers().set(name, value);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"setHeader",
"(",
"HttpMessage",
"message",
",",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"message",
".",
"headers",
"(",
")",
".",
"set",
"(",
"name",
",",
"value",
")",
";",
"}"
] | @deprecated Use {@link #set(CharSequence, Object)} instead.
@see #setHeader(HttpMessage, CharSequence, Object) | [
"@deprecated",
"Use",
"{",
"@link",
"#set",
"(",
"CharSequence",
"Object",
")",
"}",
"instead",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L599-L602 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/scp/ScpClient.java | ScpClient.get | public void get(String localFile, String remoteFile, boolean recursive)
throws SshException, ChannelOpenException {
"""
<p>
Downloads a remote file onto the local computer.
</p>
@param localFile
The path to place the file
@param remoteFile
The path of the file on the remote server
@param recursive
rec... | java | public void get(String localFile, String remoteFile, boolean recursive)
throws SshException, ChannelOpenException {
get(localFile, remoteFile, recursive, null);
} | [
"public",
"void",
"get",
"(",
"String",
"localFile",
",",
"String",
"remoteFile",
",",
"boolean",
"recursive",
")",
"throws",
"SshException",
",",
"ChannelOpenException",
"{",
"get",
"(",
"localFile",
",",
"remoteFile",
",",
"recursive",
",",
"null",
")",
";",... | <p>
Downloads a remote file onto the local computer.
</p>
@param localFile
The path to place the file
@param remoteFile
The path of the file on the remote server
@param recursive
recursivly copy the contents of a directory
@throws IOException
if an IO error occurs during the operation | [
"<p",
">",
"Downloads",
"a",
"remote",
"file",
"onto",
"the",
"local",
"computer",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/scp/ScpClient.java#L360-L363 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/tiles/user/TileDaoUtils.java | TileDaoUtils.getMinLength | public static double getMinLength(double[] widths, double[] heights) {
"""
Get the min distance length that matches the tile widths and heights
@param widths
sorted tile matrix widths
@param heights
sorted tile matrix heights
@return min length
@since 1.2.0
"""
double minWidth = getMinLength(widths);... | java | public static double getMinLength(double[] widths, double[] heights) {
double minWidth = getMinLength(widths);
double minHeight = getMinLength(heights);
double minLength = Math.max(minWidth, minHeight);
return minLength;
} | [
"public",
"static",
"double",
"getMinLength",
"(",
"double",
"[",
"]",
"widths",
",",
"double",
"[",
"]",
"heights",
")",
"{",
"double",
"minWidth",
"=",
"getMinLength",
"(",
"widths",
")",
";",
"double",
"minHeight",
"=",
"getMinLength",
"(",
"heights",
"... | Get the min distance length that matches the tile widths and heights
@param widths
sorted tile matrix widths
@param heights
sorted tile matrix heights
@return min length
@since 1.2.0 | [
"Get",
"the",
"min",
"distance",
"length",
"that",
"matches",
"the",
"tile",
"widths",
"and",
"heights"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/user/TileDaoUtils.java#L432-L437 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/ntp_server.java | ntp_server.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
ntp_server_responses result = (ntp_server_responses) service.get_payloa... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ntp_server_responses result = (ntp_server_responses) service.get_payload_formatter().string_to_resource(ntp_server_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == S... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ntp_server_responses",
"result",
"=",
"(",
"ntp_server_responses",
")",
"service",
".",
"get_payload_formatte... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/ntp_server.java#L395-L412 |
PinaeOS/nala | src/main/java/org/pinae/nala/xb/marshal/parser/ListParser.java | ListParser.parse | @SuppressWarnings("rawtypes")
public NodeConfig parse(String nodeName, List list) throws MarshalException {
"""
采用循环的方式, 通过List解析生成NodeConfig格式
@param nodeName 根节点名称
@param list 需要解析的List对象
@return 解析后的NodeConfig格式
@throws MarshalException 编组异常
"""
NodeConfig nodeConfig = new NodeConfig();
List<... | java | @SuppressWarnings("rawtypes")
public NodeConfig parse(String nodeName, List list) throws MarshalException {
NodeConfig nodeConfig = new NodeConfig();
List<NodeConfig> nodeConfigList = new ArrayList<NodeConfig>();
if (list != null) {
for (Object item : list) {
nodeConfigList.add(super.parse(nodeName, item... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"NodeConfig",
"parse",
"(",
"String",
"nodeName",
",",
"List",
"list",
")",
"throws",
"MarshalException",
"{",
"NodeConfig",
"nodeConfig",
"=",
"new",
"NodeConfig",
"(",
")",
";",
"List",
"<",
"NodeC... | 采用循环的方式, 通过List解析生成NodeConfig格式
@param nodeName 根节点名称
@param list 需要解析的List对象
@return 解析后的NodeConfig格式
@throws MarshalException 编组异常 | [
"采用循环的方式",
"通过List解析生成NodeConfig格式"
] | train | https://github.com/PinaeOS/nala/blob/2047ade4af197cec938278d300d111ea94af6fbf/src/main/java/org/pinae/nala/xb/marshal/parser/ListParser.java#L28-L41 |
apache/incubator-druid | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ParallelCombiner.java | ParallelCombiner.computeRequiredBufferNum | private int computeRequiredBufferNum(int numChildNodes, int combineDegree) {
"""
Recursively compute the number of required buffers for a combining tree in a bottom-up manner. Since each node of
the combining tree represents a combining task and each combining task requires one buffer, the number of required
bu... | java | private int computeRequiredBufferNum(int numChildNodes, int combineDegree)
{
// numChildrenForLastNode used to determine that the last node is needed for the current level.
// Please see buildCombineTree() for more details.
final int numChildrenForLastNode = numChildNodes % combineDegree;
final int nu... | [
"private",
"int",
"computeRequiredBufferNum",
"(",
"int",
"numChildNodes",
",",
"int",
"combineDegree",
")",
"{",
"// numChildrenForLastNode used to determine that the last node is needed for the current level.",
"// Please see buildCombineTree() for more details.",
"final",
"int",
"nu... | Recursively compute the number of required buffers for a combining tree in a bottom-up manner. Since each node of
the combining tree represents a combining task and each combining task requires one buffer, the number of required
buffers is the number of nodes of the combining tree.
@param numChildNodes number of chil... | [
"Recursively",
"compute",
"the",
"number",
"of",
"required",
"buffers",
"for",
"a",
"combining",
"tree",
"in",
"a",
"bottom",
"-",
"up",
"manner",
".",
"Since",
"each",
"node",
"of",
"the",
"combining",
"tree",
"represents",
"a",
"combining",
"task",
"and",
... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ParallelCombiner.java#L282-L296 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java | SwingBindingFactory.createBoundList | public Binding createBoundList(String selectionFormProperty, Object selectableItems,
String renderedProperty, Integer forceSelectMode) {
"""
Binds the value(s) specified in <code>selectableItems</code> to
a {@link JList}, with any
user selection being placed in the form property referred to by
<code... | java | public Binding createBoundList(String selectionFormProperty, Object selectableItems,
String renderedProperty, Integer forceSelectMode) {
final Map context = new HashMap();
if (forceSelectMode != null) {
context.put(ListBinder.SELECTION_MODE_KEY, forceSelectMode);
}
... | [
"public",
"Binding",
"createBoundList",
"(",
"String",
"selectionFormProperty",
",",
"Object",
"selectableItems",
",",
"String",
"renderedProperty",
",",
"Integer",
"forceSelectMode",
")",
"{",
"final",
"Map",
"context",
"=",
"new",
"HashMap",
"(",
")",
";",
"if",... | Binds the value(s) specified in <code>selectableItems</code> to
a {@link JList}, with any
user selection being placed in the form property referred to by
<code>selectionFormProperty</code>. Each item in the list will be
rendered by looking up a property on the item by the name contained
in <code>renderedProperty</code... | [
"Binds",
"the",
"value",
"(",
"s",
")",
"specified",
"in",
"<code",
">",
"selectableItems<",
"/",
"code",
">",
"to",
"a",
"{",
"@link",
"JList",
"}",
"with",
"any",
"user",
"selection",
"being",
"placed",
"in",
"the",
"form",
"property",
"referred",
"to"... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java#L310-L322 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/QueryParserBase.java | QueryParserBase.createCalculatedFieldFragment | protected String createCalculatedFieldFragment(CalculatedField calculatedField, @Nullable Class<?> domainType) {
"""
Create {@link SolrClient} readable String representation for {@link CalculatedField}.
@param calculatedField
@return
@since 1.1
"""
return StringUtils.isNotBlank(calculatedField.getAlias(... | java | protected String createCalculatedFieldFragment(CalculatedField calculatedField, @Nullable Class<?> domainType) {
return StringUtils.isNotBlank(calculatedField.getAlias())
? (calculatedField.getAlias() + ":" + createFunctionFragment(calculatedField.getFunction(), 0, domainType))
: createFunctionFragment(calcul... | [
"protected",
"String",
"createCalculatedFieldFragment",
"(",
"CalculatedField",
"calculatedField",
",",
"@",
"Nullable",
"Class",
"<",
"?",
">",
"domainType",
")",
"{",
"return",
"StringUtils",
".",
"isNotBlank",
"(",
"calculatedField",
".",
"getAlias",
"(",
")",
... | Create {@link SolrClient} readable String representation for {@link CalculatedField}.
@param calculatedField
@return
@since 1.1 | [
"Create",
"{",
"@link",
"SolrClient",
"}",
"readable",
"String",
"representation",
"for",
"{",
"@link",
"CalculatedField",
"}",
"."
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/QueryParserBase.java#L349-L353 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/MetadataFinder.java | MetadataFinder.deliverMountUpdate | private void deliverMountUpdate(SlotReference slot, boolean mounted) {
"""
Send a mount update announcement to all registered listeners, and see if we can auto-attach a media cache file.
@param slot the slot in which media has been mounted or unmounted
@param mounted will be {@code true} if there is now media ... | java | private void deliverMountUpdate(SlotReference slot, boolean mounted) {
if (mounted) {
logger.info("Reporting media mounted in " + slot);
} else {
logger.info("Reporting media removed from " + slot);
}
for (final MountListener listener : getMountListeners()) {
... | [
"private",
"void",
"deliverMountUpdate",
"(",
"SlotReference",
"slot",
",",
"boolean",
"mounted",
")",
"{",
"if",
"(",
"mounted",
")",
"{",
"logger",
".",
"info",
"(",
"\"Reporting media mounted in \"",
"+",
"slot",
")",
";",
"}",
"else",
"{",
"logger",
".",... | Send a mount update announcement to all registered listeners, and see if we can auto-attach a media cache file.
@param slot the slot in which media has been mounted or unmounted
@param mounted will be {@code true} if there is now media mounted in the specified slot | [
"Send",
"a",
"mount",
"update",
"announcement",
"to",
"all",
"registered",
"listeners",
"and",
"see",
"if",
"we",
"can",
"auto",
"-",
"attach",
"a",
"media",
"cache",
"file",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/MetadataFinder.java#L870-L892 |
mongodb/stitch-android-sdk | server/services/fcm/src/main/java/com/mongodb/stitch/server/services/fcm/internal/FcmServiceClientImpl.java | FcmServiceClientImpl.sendMessageTo | @Override
public FcmSendMessageResult sendMessageTo(final String to, final FcmSendMessageRequest request) {
"""
Sends an FCM message to the given target with the given request payload.
@param to the target to send a message to.
@param request the details of the message.
@return the result of sending th... | java | @Override
public FcmSendMessageResult sendMessageTo(final String to, final FcmSendMessageRequest request) {
return proxy.sendMessageTo(to, request);
} | [
"@",
"Override",
"public",
"FcmSendMessageResult",
"sendMessageTo",
"(",
"final",
"String",
"to",
",",
"final",
"FcmSendMessageRequest",
"request",
")",
"{",
"return",
"proxy",
".",
"sendMessageTo",
"(",
"to",
",",
"request",
")",
";",
"}"
] | Sends an FCM message to the given target with the given request payload.
@param to the target to send a message to.
@param request the details of the message.
@return the result of sending the message. | [
"Sends",
"an",
"FCM",
"message",
"to",
"the",
"given",
"target",
"with",
"the",
"given",
"request",
"payload",
"."
] | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/server/services/fcm/src/main/java/com/mongodb/stitch/server/services/fcm/internal/FcmServiceClientImpl.java#L40-L43 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/JsonUtil.java | JsonUtil.parseJsonString | public static String parseJsonString(JsonReader reader, JsonProperty property) throws IOException {
"""
The parser for a JSON string value with an optional type hint ('{type}...') as the values prefix.
Sets the value and type of the property POJO and returns the string value without the type.
This is used for si... | java | public static String parseJsonString(JsonReader reader, JsonProperty property) throws IOException {
if (property.type == null) {
// set property type to the default value if not set otherwise
// (e.g. on by the value before in an array loop)
property.type = PropertyType.nameF... | [
"public",
"static",
"String",
"parseJsonString",
"(",
"JsonReader",
"reader",
",",
"JsonProperty",
"property",
")",
"throws",
"IOException",
"{",
"if",
"(",
"property",
".",
"type",
"==",
"null",
")",
"{",
"// set property type to the default value if not set otherwise"... | The parser for a JSON string value with an optional type hint ('{type}...') as the values prefix.
Sets the value and type of the property POJO and returns the string value without the type.
This is used for single property values and also for multiple values (in the array loop).
@param reader
@param property
@return
@... | [
"The",
"parser",
"for",
"a",
"JSON",
"string",
"value",
"with",
"an",
"optional",
"type",
"hint",
"(",
"{",
"type",
"}",
"...",
")",
"as",
"the",
"values",
"prefix",
".",
"Sets",
"the",
"value",
"and",
"type",
"of",
"the",
"property",
"POJO",
"and",
... | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/JsonUtil.java#L602-L623 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/UResourceBundle.java | UResourceBundle.getBundleInstance | protected static UResourceBundle getBundleInstance(String baseName, String localeName,
ClassLoader root, boolean disableFallback) {
"""
<strong>[icu]</strong> Creates a resource bundle using the specified base name, locale, and class
root.
@param baseName ... | java | protected static UResourceBundle getBundleInstance(String baseName, String localeName,
ClassLoader root, boolean disableFallback) {
return instantiateBundle(baseName, localeName, root, disableFallback);
} | [
"protected",
"static",
"UResourceBundle",
"getBundleInstance",
"(",
"String",
"baseName",
",",
"String",
"localeName",
",",
"ClassLoader",
"root",
",",
"boolean",
"disableFallback",
")",
"{",
"return",
"instantiateBundle",
"(",
"baseName",
",",
"localeName",
",",
"r... | <strong>[icu]</strong> Creates a resource bundle using the specified base name, locale, and class
root.
@param baseName string containing the name of the data package.
If null the default ICU package name is used.
@param localeName the locale for which a resource bundle is desired
@param root the class object from whi... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Creates",
"a",
"resource",
"bundle",
"using",
"the",
"specified",
"base",
"name",
"locale",
"and",
"class",
"root",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/UResourceBundle.java#L145-L148 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.centerAtoms | public static final Atom[] centerAtoms(Atom[] atomSet)
throws StructureException {
"""
Center the atoms at the Centroid.
@param atomSet
a set of Atoms
@return an Atom representing the Centroid of the set of atoms
@throws StructureException
"""
Atom centroid = getCentroid(atomSet);
return centerAt... | java | public static final Atom[] centerAtoms(Atom[] atomSet)
throws StructureException {
Atom centroid = getCentroid(atomSet);
return centerAtoms(atomSet, centroid);
} | [
"public",
"static",
"final",
"Atom",
"[",
"]",
"centerAtoms",
"(",
"Atom",
"[",
"]",
"atomSet",
")",
"throws",
"StructureException",
"{",
"Atom",
"centroid",
"=",
"getCentroid",
"(",
"atomSet",
")",
";",
"return",
"centerAtoms",
"(",
"atomSet",
",",
"centroi... | Center the atoms at the Centroid.
@param atomSet
a set of Atoms
@return an Atom representing the Centroid of the set of atoms
@throws StructureException | [
"Center",
"the",
"atoms",
"at",
"the",
"Centroid",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L938-L943 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/buffer/factory/CudaDataBufferFactory.java | CudaDataBufferFactory.createSame | @Override
public DataBuffer createSame(DataBuffer buffer, boolean init) {
"""
This method will create new DataBuffer of the same dataType & same length
@param buffer
@return
"""
switch (buffer.dataType()) {
case INT:
return createInt(buffer.length(), init);
... | java | @Override
public DataBuffer createSame(DataBuffer buffer, boolean init) {
switch (buffer.dataType()) {
case INT:
return createInt(buffer.length(), init);
case FLOAT:
return createFloat(buffer.length(), init);
case DOUBLE:
re... | [
"@",
"Override",
"public",
"DataBuffer",
"createSame",
"(",
"DataBuffer",
"buffer",
",",
"boolean",
"init",
")",
"{",
"switch",
"(",
"buffer",
".",
"dataType",
"(",
")",
")",
"{",
"case",
"INT",
":",
"return",
"createInt",
"(",
"buffer",
".",
"length",
"... | This method will create new DataBuffer of the same dataType & same length
@param buffer
@return | [
"This",
"method",
"will",
"create",
"new",
"DataBuffer",
"of",
"the",
"same",
"dataType",
"&",
"same",
"length"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/buffer/factory/CudaDataBufferFactory.java#L98-L112 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java | SiftDetector.isScaleSpaceExtremum | boolean isScaleSpaceExtremum(int c_x, int c_y, float value, float signAdj) {
"""
See if the point is a local extremum in scale-space above and below.
@param c_x x-coordinate of extremum
@param c_y y-coordinate of extremum
@param value The maximum value it is checking
@param signAdj Adjust the sign so that it... | java | boolean isScaleSpaceExtremum(int c_x, int c_y, float value, float signAdj) {
if( c_x <= 1 || c_y <= 1 || c_x >= dogLower.width-1 || c_y >= dogLower.height-1)
return false;
float v;
value *= signAdj;
for( int y = -1; y <= 1; y++ ) {
for( int x = -1; x <= 1; x++ ) {
v = dogLower.unsafe_get(c_x+x,c... | [
"boolean",
"isScaleSpaceExtremum",
"(",
"int",
"c_x",
",",
"int",
"c_y",
",",
"float",
"value",
",",
"float",
"signAdj",
")",
"{",
"if",
"(",
"c_x",
"<=",
"1",
"||",
"c_y",
"<=",
"1",
"||",
"c_x",
">=",
"dogLower",
".",
"width",
"-",
"1",
"||",
"c_... | See if the point is a local extremum in scale-space above and below.
@param c_x x-coordinate of extremum
@param c_y y-coordinate of extremum
@param value The maximum value it is checking
@param signAdj Adjust the sign so that it can check for maximums
@return true if its a local extremum | [
"See",
"if",
"the",
"point",
"is",
"a",
"local",
"extremum",
"in",
"scale",
"-",
"space",
"above",
"and",
"below",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java#L229-L249 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/api/Database.java | Database.removeAttachment | public com.cloudant.client.api.model.Response removeAttachment(String id, String rev, String attachmentName) {
"""
Removes the attachment from a document the specified {@code _id} and {@code _rev} and {@code attachmentName}
values.
<P>Example usage:</P>
<pre>
{@code
Response response = db.removeAttachment("ex... | java | public com.cloudant.client.api.model.Response removeAttachment(String id, String rev, String attachmentName) {
Response couchDbResponse = db.removeAttachment(id, rev, attachmentName);
com.cloudant.client.api.model.Response response = new com.cloudant.client.api.model
.Response(couchDbRes... | [
"public",
"com",
".",
"cloudant",
".",
"client",
".",
"api",
".",
"model",
".",
"Response",
"removeAttachment",
"(",
"String",
"id",
",",
"String",
"rev",
",",
"String",
"attachmentName",
")",
"{",
"Response",
"couchDbResponse",
"=",
"db",
".",
"removeAttach... | Removes the attachment from a document the specified {@code _id} and {@code _rev} and {@code attachmentName}
values.
<P>Example usage:</P>
<pre>
{@code
Response response = db.removeAttachment("exampleId", "1-12345exampleRev", "example.jpg");
}
</pre>
@param id the document _id field
@param rev the document _rev field... | [
"Removes",
"the",
"attachment",
"from",
"a",
"document",
"the",
"specified",
"{",
"@code",
"_id",
"}",
"and",
"{",
"@code",
"_rev",
"}",
"and",
"{",
"@code",
"attachmentName",
"}",
"values",
".",
"<P",
">",
"Example",
"usage",
":",
"<",
"/",
"P",
">",
... | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/api/Database.java#L1342-L1347 |
lucee/Lucee | core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java | AbstrCFMLScriptTransformer.returnStatement | private final Return returnStatement(Data data) throws TemplateException {
"""
Liest ein return Statement ein. <br />
EBNF:<br />
<code>spaces expressionStatement spaces;</code>
@return return Statement
@throws TemplateException
"""
if (!data.srcCode.forwardIfCurrentAndNoVarExt("return")) return null;
... | java | private final Return returnStatement(Data data) throws TemplateException {
if (!data.srcCode.forwardIfCurrentAndNoVarExt("return")) return null;
Position line = data.srcCode.getPosition();
Return rtn;
comments(data);
if (checkSemiColonLineFeed(data, false, false, false)) rtn = new Return(data.factory, line, data... | [
"private",
"final",
"Return",
"returnStatement",
"(",
"Data",
"data",
")",
"throws",
"TemplateException",
"{",
"if",
"(",
"!",
"data",
".",
"srcCode",
".",
"forwardIfCurrentAndNoVarExt",
"(",
"\"return\"",
")",
")",
"return",
"null",
";",
"Position",
"line",
"... | Liest ein return Statement ein. <br />
EBNF:<br />
<code>spaces expressionStatement spaces;</code>
@return return Statement
@throws TemplateException | [
"Liest",
"ein",
"return",
"Statement",
"ein",
".",
"<br",
"/",
">",
"EBNF",
":",
"<br",
"/",
">",
"<code",
">",
"spaces",
"expressionStatement",
"spaces",
";",
"<",
"/",
"code",
">"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java#L1760-L1776 |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/NamespaceSpecification.java | NamespaceSpecification.matchPrefix | static private boolean matchPrefix(String s1, String s2) {
"""
Checks with either of the strings starts with the other.
@param s1 a String
@param s2 a String
@return true if s1 starts with s2 or s2 starts with s1, false otherwise
"""
return s1.startsWith(s2) || s2.startsWith(s1);
} | java | static private boolean matchPrefix(String s1, String s2) {
return s1.startsWith(s2) || s2.startsWith(s1);
} | [
"static",
"private",
"boolean",
"matchPrefix",
"(",
"String",
"s1",
",",
"String",
"s2",
")",
"{",
"return",
"s1",
".",
"startsWith",
"(",
"s2",
")",
"||",
"s2",
".",
"startsWith",
"(",
"s1",
")",
";",
"}"
] | Checks with either of the strings starts with the other.
@param s1 a String
@param s2 a String
@return true if s1 starts with s2 or s2 starts with s1, false otherwise | [
"Checks",
"with",
"either",
"of",
"the",
"strings",
"starts",
"with",
"the",
"other",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/NamespaceSpecification.java#L102-L104 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/preprocessing/TextNormalizer.java | TextNormalizer.apply | public final String apply(String input, Language inputLanguage) {
"""
Performs a pre-processing operation on the input string in the given input language
@param input The input text
@param inputLanguage The language of the input
@return The post-processed text
"""
if (input != null && Config.g... | java | public final String apply(String input, Language inputLanguage) {
if (input != null && Config.get(this.getClass(), inputLanguage, "apply").asBoolean(true)) {
return performNormalization(input, inputLanguage);
}
return input;
} | [
"public",
"final",
"String",
"apply",
"(",
"String",
"input",
",",
"Language",
"inputLanguage",
")",
"{",
"if",
"(",
"input",
"!=",
"null",
"&&",
"Config",
".",
"get",
"(",
"this",
".",
"getClass",
"(",
")",
",",
"inputLanguage",
",",
"\"apply\"",
")",
... | Performs a pre-processing operation on the input string in the given input language
@param input The input text
@param inputLanguage The language of the input
@return The post-processed text | [
"Performs",
"a",
"pre",
"-",
"processing",
"operation",
"on",
"the",
"input",
"string",
"in",
"the",
"given",
"input",
"language"
] | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/preprocessing/TextNormalizer.java#L46-L51 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/storage/ConnectionPool.java | ConnectionPool.free | public void free(Connection connection) {
"""
<p>
Releases the specified connection and returns it to the pool.
</p>
@param connection
A JDBC connection.
"""
try {
if (!connection.isClosed()){
// ensure connections returned to pool as read-only
setConne... | java | public void free(Connection connection) {
try {
if (!connection.isClosed()){
// ensure connections returned to pool as read-only
setConnectionReadOnly(connection, true);
connection.close();
} else {
logger.debug("Ignoring at... | [
"public",
"void",
"free",
"(",
"Connection",
"connection",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"connection",
".",
"isClosed",
"(",
")",
")",
"{",
"// ensure connections returned to pool as read-only",
"setConnectionReadOnly",
"(",
"connection",
",",
"true",
")",... | <p>
Releases the specified connection and returns it to the pool.
</p>
@param connection
A JDBC connection. | [
"<p",
">",
"Releases",
"the",
"specified",
"connection",
"and",
"returns",
"it",
"to",
"the",
"pool",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/ConnectionPool.java#L332-L348 |
diffplug/JMatIO | src/main/java/ca/mjdsystems/jmatio/io/MatFileIncrementalWriter.java | MatFileIncrementalWriter.writeName | private void writeName(DataOutputStream os, MLArray array) throws IOException {
"""
Writes MATRIX name into <code>OutputStream</code>.
@param os - <code>OutputStream</code>
@param array - a <code>MLArray</code>
@throws IOException
"""
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
... | java | private void writeName(DataOutputStream os, MLArray array) throws IOException
{
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
DataOutputStream bufferDOS = new DataOutputStream(buffer);
byte[] nameByteArray = array.getNameToByteArray();
buffer = new ByteArrayOutputStrea... | [
"private",
"void",
"writeName",
"(",
"DataOutputStream",
"os",
",",
"MLArray",
"array",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"buffer",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"DataOutputStream",
"bufferDOS",
"=",
"new",
"DataOutput... | Writes MATRIX name into <code>OutputStream</code>.
@param os - <code>OutputStream</code>
@param array - a <code>MLArray</code>
@throws IOException | [
"Writes",
"MATRIX",
"name",
"into",
"<code",
">",
"OutputStream<",
"/",
"code",
">",
"."
] | train | https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/io/MatFileIncrementalWriter.java#L499-L510 |
apiman/apiman | manager/api/war/src/main/java/io/apiman/manager/api/war/WarCdiFactory.java | WarCdiFactory.createCustomComponent | private static <T> T createCustomComponent(Class<T> componentType, String componentSpec,
Map<String, String> configProperties, IPluginRegistry pluginRegistry) throws Exception {
"""
Creates a custom component from information found in the properties file.
@param componentType
@param componentSpec
@p... | java | private static <T> T createCustomComponent(Class<T> componentType, String componentSpec,
Map<String, String> configProperties, IPluginRegistry pluginRegistry) throws Exception {
return createCustomComponent(componentType, componentSpec, configProperties, pluginRegistry, null);
} | [
"private",
"static",
"<",
"T",
">",
"T",
"createCustomComponent",
"(",
"Class",
"<",
"T",
">",
"componentType",
",",
"String",
"componentSpec",
",",
"Map",
"<",
"String",
",",
"String",
">",
"configProperties",
",",
"IPluginRegistry",
"pluginRegistry",
")",
"t... | Creates a custom component from information found in the properties file.
@param componentType
@param componentSpec
@param configProperties
@param pluginRegistry
@throws Exception | [
"Creates",
"a",
"custom",
"component",
"from",
"information",
"found",
"in",
"the",
"properties",
"file",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/war/src/main/java/io/apiman/manager/api/war/WarCdiFactory.java#L320-L323 |
syphr42/libmythtv-java | protocol/src/main/java/org/syphr/mythtv/protocol/impl/ProtocolUtils.java | ProtocolUtils.combineInts | public static long combineInts(String high, String low) throws NumberFormatException {
"""
Combine two numbers that represent the high and low bits of a 64-bit
number.
@see #splitLong(long)
@param high
the high 32 bits
@param low
the low 32 bits
@return a 64 bit number comprised of the given high and lo... | java | public static long combineInts(String high, String low) throws NumberFormatException
{
int highInt = Integer.parseInt(high);
int lowInt = Integer.parseInt(low);
/*
* Shift the high integer into the upper 32 bits and add the low
* integer. However, since this is really a si... | [
"public",
"static",
"long",
"combineInts",
"(",
"String",
"high",
",",
"String",
"low",
")",
"throws",
"NumberFormatException",
"{",
"int",
"highInt",
"=",
"Integer",
".",
"parseInt",
"(",
"high",
")",
";",
"int",
"lowInt",
"=",
"Integer",
".",
"parseInt",
... | Combine two numbers that represent the high and low bits of a 64-bit
number.
@see #splitLong(long)
@param high
the high 32 bits
@param low
the low 32 bits
@return a 64 bit number comprised of the given high and low bits
concatenated together
@throws NumberFormatException
if the strings cannot be parsed as integers | [
"Combine",
"two",
"numbers",
"that",
"represent",
"the",
"high",
"and",
"low",
"bits",
"of",
"a",
"64",
"-",
"bit",
"number",
"."
] | train | https://github.com/syphr42/libmythtv-java/blob/cc7a2012fbd4a4ba2562dda6b2614fb0548526ea/protocol/src/main/java/org/syphr/mythtv/protocol/impl/ProtocolUtils.java#L43-L56 |
netty/netty | common/src/main/java/io/netty/util/internal/MacAddressUtil.java | MacAddressUtil.parseMAC | public static byte[] parseMAC(String value) {
"""
Parse a EUI-48, MAC-48, or EUI-64 MAC address from a {@link String} and return it as a {@code byte[]}.
@param value The string representation of the MAC address.
@return The byte representation of the MAC address.
"""
final byte[] machineId;
f... | java | public static byte[] parseMAC(String value) {
final byte[] machineId;
final char separator;
switch (value.length()) {
case 17:
separator = value.charAt(2);
validateMacSeparator(separator);
machineId = new byte[EUI48_MAC_ADDRESS_LENGTH];... | [
"public",
"static",
"byte",
"[",
"]",
"parseMAC",
"(",
"String",
"value",
")",
"{",
"final",
"byte",
"[",
"]",
"machineId",
";",
"final",
"char",
"separator",
";",
"switch",
"(",
"value",
".",
"length",
"(",
")",
")",
"{",
"case",
"17",
":",
"separat... | Parse a EUI-48, MAC-48, or EUI-64 MAC address from a {@link String} and return it as a {@code byte[]}.
@param value The string representation of the MAC address.
@return The byte representation of the MAC address. | [
"Parse",
"a",
"EUI",
"-",
"48",
"MAC",
"-",
"48",
"or",
"EUI",
"-",
"64",
"MAC",
"address",
"from",
"a",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/MacAddressUtil.java#L154-L186 |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/util/UndoUtils.java | UndoUtils.plainTextUndoManager | public static <PS, SEG, S> UndoManager<List<PlainTextChange>> plainTextUndoManager(
GenericStyledArea<PS, SEG, S> area, Duration preventMergeDelay) {
"""
Returns an UndoManager that can undo/redo {@link PlainTextChange}s. New changes
emitted from the stream will not be merged with the previous change
... | java | public static <PS, SEG, S> UndoManager<List<PlainTextChange>> plainTextUndoManager(
GenericStyledArea<PS, SEG, S> area, Duration preventMergeDelay) {
return plainTextUndoManager(area, UndoManagerFactory.unlimitedHistoryFactory(), preventMergeDelay);
} | [
"public",
"static",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"UndoManager",
"<",
"List",
"<",
"PlainTextChange",
">",
">",
"plainTextUndoManager",
"(",
"GenericStyledArea",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"area",
",",
"Duration",
"preventMergeDelay",
")... | Returns an UndoManager that can undo/redo {@link PlainTextChange}s. New changes
emitted from the stream will not be merged with the previous change
after {@code preventMergeDelay} | [
"Returns",
"an",
"UndoManager",
"that",
"can",
"undo",
"/",
"redo",
"{"
] | train | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/util/UndoUtils.java#L106-L109 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/function/Actions.java | Actions.toFunc | public static <T1, T2, T3, T4, T5, T6, T7, R> Func7<T1, T2, T3, T4, T5, T6, T7, R> toFunc(
final Action7<T1, T2, T3, T4, T5, T6, T7> action, final R result) {
"""
Converts an {@link Action7} to a function that calls the action and returns a specified value.
@param action the {@link Action7} to conve... | java | public static <T1, T2, T3, T4, T5, T6, T7, R> Func7<T1, T2, T3, T4, T5, T6, T7, R> toFunc(
final Action7<T1, T2, T3, T4, T5, T6, T7> action, final R result) {
return new Func7<T1, T2, T3, T4, T5, T6, T7, R>() {
@Override
public R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6,... | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
",",
"T6",
",",
"T7",
",",
"R",
">",
"Func7",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
",",
"T6",
",",
"T7",
",",
"R",
">",
"toFunc",
"(",
"final",
... | Converts an {@link Action7} to a function that calls the action and returns a specified value.
@param action the {@link Action7} to convert
@param result the value to return from the function call
@return a {@link Func7} that calls {@code action} and returns {@code result} | [
"Converts",
"an",
"{",
"@link",
"Action7",
"}",
"to",
"a",
"function",
"that",
"calls",
"the",
"action",
"and",
"returns",
"a",
"specified",
"value",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/function/Actions.java#L323-L332 |
ironjacamar/ironjacamar | tracer/src/main/java/org/ironjacamar/tracer/HTMLReport.java | HTMLReport.writeString | static void writeString(FileWriter fw, String s) throws Exception {
"""
Write string
@param fw The file writer
@param s The string
@exception Exception If an error occurs
"""
for (int i = 0; i < s.length(); i++)
{
fw.write((int)s.charAt(i));
}
} | java | static void writeString(FileWriter fw, String s) throws Exception
{
for (int i = 0; i < s.length(); i++)
{
fw.write((int)s.charAt(i));
}
} | [
"static",
"void",
"writeString",
"(",
"FileWriter",
"fw",
",",
"String",
"s",
")",
"throws",
"Exception",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"fw",
".",
"write",
"(",
"("... | Write string
@param fw The file writer
@param s The string
@exception Exception If an error occurs | [
"Write",
"string"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/tracer/src/main/java/org/ironjacamar/tracer/HTMLReport.java#L52-L58 |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/roles/PassiveRole.java | PassiveRole.checkTerm | protected boolean checkTerm(AppendRequest request, CompletableFuture<AppendResponse> future) {
"""
Checks the leader's term of the given AppendRequest, returning a boolean indicating whether to continue
handling the request.
"""
RaftLogWriter writer = raft.getLogWriter();
if (request.term() < raft.get... | java | protected boolean checkTerm(AppendRequest request, CompletableFuture<AppendResponse> future) {
RaftLogWriter writer = raft.getLogWriter();
if (request.term() < raft.getTerm()) {
log.debug("Rejected {}: request term is less than the current term ({})", request, raft.getTerm());
return failAppend(writ... | [
"protected",
"boolean",
"checkTerm",
"(",
"AppendRequest",
"request",
",",
"CompletableFuture",
"<",
"AppendResponse",
">",
"future",
")",
"{",
"RaftLogWriter",
"writer",
"=",
"raft",
".",
"getLogWriter",
"(",
")",
";",
"if",
"(",
"request",
".",
"term",
"(",
... | Checks the leader's term of the given AppendRequest, returning a boolean indicating whether to continue
handling the request. | [
"Checks",
"the",
"leader",
"s",
"term",
"of",
"the",
"given",
"AppendRequest",
"returning",
"a",
"boolean",
"indicating",
"whether",
"to",
"continue",
"handling",
"the",
"request",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/PassiveRole.java#L134-L141 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/NGAExtensions.java | NGAExtensions.getFeatureStyleExtension | private static FeatureCoreStyleExtension getFeatureStyleExtension(
GeoPackageCore geoPackage) {
"""
Get a Feature Style Extension used only for deletions
@param geoPackage
GeoPackage
@return Feature Style Extension
"""
RelatedTablesCoreExtension relatedTables = new RelatedTablesCoreExtension(
ge... | java | private static FeatureCoreStyleExtension getFeatureStyleExtension(
GeoPackageCore geoPackage) {
RelatedTablesCoreExtension relatedTables = new RelatedTablesCoreExtension(
geoPackage) {
@Override
public String getPrimaryKeyColumnName(String tableName) {
return null;
}
};
return new FeatureCor... | [
"private",
"static",
"FeatureCoreStyleExtension",
"getFeatureStyleExtension",
"(",
"GeoPackageCore",
"geoPackage",
")",
"{",
"RelatedTablesCoreExtension",
"relatedTables",
"=",
"new",
"RelatedTablesCoreExtension",
"(",
"geoPackage",
")",
"{",
"@",
"Override",
"public",
"Str... | Get a Feature Style Extension used only for deletions
@param geoPackage
GeoPackage
@return Feature Style Extension | [
"Get",
"a",
"Feature",
"Style",
"Extension",
"used",
"only",
"for",
"deletions"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/NGAExtensions.java#L334-L347 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java | HashtableOnDisk.writeHashIndex | private void writeHashIndex(int index, long value, int tableid)
throws IOException {
"""
************************************************************************
Given an index into the hash table and a value to store there, find it
on disk and write the value.
******************************... | java | private void writeHashIndex(int index, long value, int tableid)
throws IOException {
long diskloc = header.calcOffset(index, tableid);
filemgr.seek(diskloc);
filemgr.writeLong(value);
updateHtindex(index, value, tableid);
} | [
"private",
"void",
"writeHashIndex",
"(",
"int",
"index",
",",
"long",
"value",
",",
"int",
"tableid",
")",
"throws",
"IOException",
"{",
"long",
"diskloc",
"=",
"header",
".",
"calcOffset",
"(",
"index",
",",
"tableid",
")",
";",
"filemgr",
".",
"seek",
... | ************************************************************************
Given an index into the hash table and a value to store there, find it
on disk and write the value.
*********************************************************************** | [
"************************************************************************",
"Given",
"an",
"index",
"into",
"the",
"hash",
"table",
"and",
"a",
"value",
"to",
"store",
"there",
"find",
"it",
"on",
"disk",
"and",
"write",
"the",
"value",
".",
"***************************... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java#L1419-L1426 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/transform/TransformersLogger.java | TransformersLogger.logAttributeWarning | public void logAttributeWarning(PathAddress address, String message, String attribute) {
"""
Log warning for the resource at the provided address and single attribute, using the provided detail
message.
@param address where warning occurred
@param message custom error message to append
@param attribute a... | java | public void logAttributeWarning(PathAddress address, String message, String attribute) {
logAttributeWarning(address, null, message, attribute);
} | [
"public",
"void",
"logAttributeWarning",
"(",
"PathAddress",
"address",
",",
"String",
"message",
",",
"String",
"attribute",
")",
"{",
"logAttributeWarning",
"(",
"address",
",",
"null",
",",
"message",
",",
"attribute",
")",
";",
"}"
] | Log warning for the resource at the provided address and single attribute, using the provided detail
message.
@param address where warning occurred
@param message custom error message to append
@param attribute attribute we are warning about | [
"Log",
"warning",
"for",
"the",
"resource",
"at",
"the",
"provided",
"address",
"and",
"single",
"attribute",
"using",
"the",
"provided",
"detail",
"message",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/TransformersLogger.java#L121-L123 |
knowm/XChange | xchange-cryptonit/src/main/java/org/knowm/xchange/cryptonit2/CryptonitAdapters.java | CryptonitAdapters.adaptTrade | public static Trade adaptTrade(
CryptonitTransaction tx, CurrencyPair currencyPair, int timeScale) {
"""
Adapts a Transaction to a Trade Object
@param tx The Cryptonit transaction
@param currencyPair (e.g. BTC/USD)
@param timeScale polled order books provide a timestamp in seconds, stream in ms
@return... | java | public static Trade adaptTrade(
CryptonitTransaction tx, CurrencyPair currencyPair, int timeScale) {
OrderType orderType = tx.getType() == 0 ? OrderType.BID : OrderType.ASK;
final String tradeId = String.valueOf(tx.getTid());
Date date =
DateUtils.fromMillisUtc(
tx.getDate()
... | [
"public",
"static",
"Trade",
"adaptTrade",
"(",
"CryptonitTransaction",
"tx",
",",
"CurrencyPair",
"currencyPair",
",",
"int",
"timeScale",
")",
"{",
"OrderType",
"orderType",
"=",
"tx",
".",
"getType",
"(",
")",
"==",
"0",
"?",
"OrderType",
".",
"BID",
":",... | Adapts a Transaction to a Trade Object
@param tx The Cryptonit transaction
@param currencyPair (e.g. BTC/USD)
@param timeScale polled order books provide a timestamp in seconds, stream in ms
@return The XChange Trade | [
"Adapts",
"a",
"Transaction",
"to",
"a",
"Trade",
"Object"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-cryptonit/src/main/java/org/knowm/xchange/cryptonit2/CryptonitAdapters.java#L143-L153 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.mergeCertificateAsync | public Observable<CertificateBundle> mergeCertificateAsync(String vaultBaseUrl, String certificateName, List<byte[]> x509Certificates) {
"""
Merges a certificate or a certificate chain with a key pair existing on the server.
The MergeCertificate operation performs the merging of a certificate or certificate chain... | java | public Observable<CertificateBundle> mergeCertificateAsync(String vaultBaseUrl, String certificateName, List<byte[]> x509Certificates) {
return mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates).map(new Func1<ServiceResponse<CertificateBundle>, CertificateBundle>() {
... | [
"public",
"Observable",
"<",
"CertificateBundle",
">",
"mergeCertificateAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"List",
"<",
"byte",
"[",
"]",
">",
"x509Certificates",
")",
"{",
"return",
"mergeCertificateWithServiceResponseAsync",
... | Merges a certificate or a certificate chain with a key pair existing on the server.
The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission.
@param vaultBaseUrl The vault nam... | [
"Merges",
"a",
"certificate",
"or",
"a",
"certificate",
"chain",
"with",
"a",
"key",
"pair",
"existing",
"on",
"the",
"server",
".",
"The",
"MergeCertificate",
"operation",
"performs",
"the",
"merging",
"of",
"a",
"certificate",
"or",
"certificate",
"chain",
"... | 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#L7940-L7947 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/DescriptorFactory.java | DescriptorFactory.createClassDescriptorFromResourceName | public static ClassDescriptor createClassDescriptorFromResourceName(String resourceName) {
"""
Create a class descriptor from a resource name.
@param resourceName
the resource name
@return the class descriptor
"""
if (!isClassResource(resourceName)) {
throw new IllegalArgumentException... | java | public static ClassDescriptor createClassDescriptorFromResourceName(String resourceName) {
if (!isClassResource(resourceName)) {
throw new IllegalArgumentException("Resource " + resourceName + " is not a class");
}
return createClassDescriptor(resourceName.substring(0, resourceName.l... | [
"public",
"static",
"ClassDescriptor",
"createClassDescriptorFromResourceName",
"(",
"String",
"resourceName",
")",
"{",
"if",
"(",
"!",
"isClassResource",
"(",
"resourceName",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Resource \"",
"+",
"reso... | Create a class descriptor from a resource name.
@param resourceName
the resource name
@return the class descriptor | [
"Create",
"a",
"class",
"descriptor",
"from",
"a",
"resource",
"name",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/DescriptorFactory.java#L281-L286 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spy1st | public static <T1, T2, T3, R> TriFunction<T1, T2, T3, R> spy1st(TriFunction<T1, T2, T3, R> function, Box<T1> param1) {
"""
Proxies a ternary function spying for first parameter.
@param <R> the function result type
@param <T1> the function first parameter type
@param <T2> the function second parameter type
@p... | java | public static <T1, T2, T3, R> TriFunction<T1, T2, T3, R> spy1st(TriFunction<T1, T2, T3, R> function, Box<T1> param1) {
return spy(function, Box.<R>empty(), param1, Box.<T2>empty(), Box.<T3>empty());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"TriFunction",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"spy1st",
"(",
"TriFunction",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"function",
",",
"Box",
"<",
"T1"... | Proxies a ternary function spying for first parameter.
@param <R> the function result type
@param <T1> the function first parameter type
@param <T2> the function second parameter type
@param <T3> the function third parameter type
@param function the function that will be spied
@param param1 a box that will be containi... | [
"Proxies",
"a",
"ternary",
"function",
"spying",
"for",
"first",
"parameter",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L209-L211 |
liferay/com-liferay-commerce | commerce-tax-service/src/main/java/com/liferay/commerce/tax/service/persistence/impl/CommerceTaxMethodPersistenceImpl.java | CommerceTaxMethodPersistenceImpl.findByGroupId | @Override
public List<CommerceTaxMethod> findByGroupId(long groupId, int start,
int end) {
"""
Returns a range of all the commerce tax methods where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not p... | java | @Override
public List<CommerceTaxMethod> findByGroupId(long groupId, int start,
int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceTaxMethod",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce tax methods where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the se... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"tax",
"methods",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-service/src/main/java/com/liferay/commerce/tax/service/persistence/impl/CommerceTaxMethodPersistenceImpl.java#L142-L146 |
leancloud/java-sdk-all | android-sdk/storage-android/src/main/java/cn/leancloud/AVManifestUtils.java | AVManifestUtils.checkPermission | public static boolean checkPermission(Context context, String permission) {
"""
判断 Mainifest 中是否包含对应到 permission
如有,则返回 true,反之,则返回 false 并输出日志
@param context
@param permission
@return
"""
boolean hasPermission =
(PackageManager.PERMISSION_GRANTED == context.checkCallingOrSelfPermission(permi... | java | public static boolean checkPermission(Context context, String permission) {
boolean hasPermission =
(PackageManager.PERMISSION_GRANTED == context.checkCallingOrSelfPermission(permission));
if (!hasPermission) {
printErrorLog("permission " + permission + " is missing!");
}
return hasPermiss... | [
"public",
"static",
"boolean",
"checkPermission",
"(",
"Context",
"context",
",",
"String",
"permission",
")",
"{",
"boolean",
"hasPermission",
"=",
"(",
"PackageManager",
".",
"PERMISSION_GRANTED",
"==",
"context",
".",
"checkCallingOrSelfPermission",
"(",
"permissio... | 判断 Mainifest 中是否包含对应到 permission
如有,则返回 true,反之,则返回 false 并输出日志
@param context
@param permission
@return | [
"判断",
"Mainifest",
"中是否包含对应到",
"permission",
"如有,则返回",
"true,反之,则返回",
"false",
"并输出日志"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/storage-android/src/main/java/cn/leancloud/AVManifestUtils.java#L28-L35 |
mgormley/prim | src/main/java_generated/edu/jhu/prim/arrays/IntArrays.java | IntArrays.countUnique | public static int countUnique(int[] indices1, int[] indices2) {
"""
Counts the number of unique indices in two arrays.
@param indices1 Sorted array of indices.
@param indices2 Sorted array of indices.
"""
int numUniqueIndices = 0;
int i = 0;
int j = 0;
while (i < indices1.le... | java | public static int countUnique(int[] indices1, int[] indices2) {
int numUniqueIndices = 0;
int i = 0;
int j = 0;
while (i < indices1.length && j < indices2.length) {
if (indices1[i] < indices2[j]) {
numUniqueIndices++;
i++;
} else if... | [
"public",
"static",
"int",
"countUnique",
"(",
"int",
"[",
"]",
"indices1",
",",
"int",
"[",
"]",
"indices2",
")",
"{",
"int",
"numUniqueIndices",
"=",
"0",
";",
"int",
"i",
"=",
"0",
";",
"int",
"j",
"=",
"0",
";",
"while",
"(",
"i",
"<",
"indic... | Counts the number of unique indices in two arrays.
@param indices1 Sorted array of indices.
@param indices2 Sorted array of indices. | [
"Counts",
"the",
"number",
"of",
"unique",
"indices",
"in",
"two",
"arrays",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/arrays/IntArrays.java#L183-L207 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/McCodeGen.java | McCodeGen.writeMethod | private void writeMethod(Definition def, Writer out, int indent) throws IOException {
"""
Output methods
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException
"""
if (def.getMcfDefs().get(getNumOfMcf()).isDefineMethodInConnection())
{
... | java | private void writeMethod(Definition def, Writer out, int indent) throws IOException
{
if (def.getMcfDefs().get(getNumOfMcf()).isDefineMethodInConnection())
{
if (def.getMcfDefs().get(getNumOfMcf()).getMethods().size() > 0)
{
for (MethodForConnection method : def.getMcfDefs()... | [
"private",
"void",
"writeMethod",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"if",
"(",
"def",
".",
"getMcfDefs",
"(",
")",
".",
"get",
"(",
"getNumOfMcf",
"(",
")",
")",
".",
"isDefineMethodI... | Output methods
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"methods"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/McCodeGen.java#L473-L509 |
maguro/aunit | junit/src/main/java/com/toolazydogs/aunit/Assert.java | Assert.assertToken | public static void assertToken(String message, int expectedType, String expectedText, Token token) {
"""
Asserts properties of a token.
@param message the message to display on failure.
@param expectedType the expected type of the token.
@param expectedText the expected text of the token.
@param token ... | java | public static void assertToken(String message, int expectedType, String expectedText, Token token)
{
assertToken(message, BaseRecognizer.DEFAULT_TOKEN_CHANNEL, expectedType, expectedText, token);
} | [
"public",
"static",
"void",
"assertToken",
"(",
"String",
"message",
",",
"int",
"expectedType",
",",
"String",
"expectedText",
",",
"Token",
"token",
")",
"{",
"assertToken",
"(",
"message",
",",
"BaseRecognizer",
".",
"DEFAULT_TOKEN_CHANNEL",
",",
"expectedType"... | Asserts properties of a token.
@param message the message to display on failure.
@param expectedType the expected type of the token.
@param expectedText the expected text of the token.
@param token the token to assert. | [
"Asserts",
"properties",
"of",
"a",
"token",
"."
] | train | https://github.com/maguro/aunit/blob/1f972e35b28327e5e2e7881befc928df0546d74c/junit/src/main/java/com/toolazydogs/aunit/Assert.java#L101-L104 |
softindex/datakernel | core-promise/src/main/java/io/datakernel/file/AsyncFile.java | AsyncFile.createDirectory | public static Promise<Void> createDirectory(Executor executor, Path dir, @Nullable FileAttribute<?>[] attrs) {
"""
Creates a new directory.
@param executor executor for running tasks in other thread
@param dir the directory to create
@param attrs an optional list of file attributes to set atomically w... | java | public static Promise<Void> createDirectory(Executor executor, Path dir, @Nullable FileAttribute<?>[] attrs) {
return ofBlockingRunnable(executor, () -> {
try {
Files.createDirectory(dir, attrs == null ? new FileAttribute<?>[0] : attrs);
} catch (IOException e) {
throw new UncheckedException(e);
}
... | [
"public",
"static",
"Promise",
"<",
"Void",
">",
"createDirectory",
"(",
"Executor",
"executor",
",",
"Path",
"dir",
",",
"@",
"Nullable",
"FileAttribute",
"<",
"?",
">",
"[",
"]",
"attrs",
")",
"{",
"return",
"ofBlockingRunnable",
"(",
"executor",
",",
"(... | Creates a new directory.
@param executor executor for running tasks in other thread
@param dir the directory to create
@param attrs an optional list of file attributes to set atomically when creating the directory | [
"Creates",
"a",
"new",
"directory",
"."
] | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-promise/src/main/java/io/datakernel/file/AsyncFile.java#L169-L177 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/common/Similarity.java | Similarity.jaccardIndex | public static double jaccardIndex(DoubleVector a, DoubleVector b) {
"""
Computes the <a href="http://en.wikipedia.org/wiki/Jaccard_index">Jaccard
index</a> comparing the similarity both {@code DoubleVector}s when viewed
as sets of samples.
"""
Set<Double> intersection = new HashSet<Double>();
... | java | public static double jaccardIndex(DoubleVector a, DoubleVector b) {
Set<Double> intersection = new HashSet<Double>();
Set<Double> union = new HashSet<Double>();
for (int i = 0; i < a.length(); ++i) {
double d = a.get(i);
intersection.add(d);
union.add(d);
... | [
"public",
"static",
"double",
"jaccardIndex",
"(",
"DoubleVector",
"a",
",",
"DoubleVector",
"b",
")",
"{",
"Set",
"<",
"Double",
">",
"intersection",
"=",
"new",
"HashSet",
"<",
"Double",
">",
"(",
")",
";",
"Set",
"<",
"Double",
">",
"union",
"=",
"n... | Computes the <a href="http://en.wikipedia.org/wiki/Jaccard_index">Jaccard
index</a> comparing the similarity both {@code DoubleVector}s when viewed
as sets of samples. | [
"Computes",
"the",
"<a",
"href",
"=",
"http",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Jaccard_index",
">",
"Jaccard",
"index<",
"/",
"a",
">",
"comparing",
"the",
"similarity",
"both",
"{"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/common/Similarity.java#L957-L974 |
code4everything/util | src/main/java/com/zhazhapan/util/FileExecutor.java | FileExecutor.renameFiles | public static void renameFiles(String folder, String prefix, String suffix, int start) {
"""
批量重命名文件
@param folder 文件夹
@param prefix 文件前缀
@param suffix 文件后缀
@param start 开始位置
"""
renameFiles(scanFolderAsArray(folder), prefix, suffix, start);
} | java | public static void renameFiles(String folder, String prefix, String suffix, int start) {
renameFiles(scanFolderAsArray(folder), prefix, suffix, start);
} | [
"public",
"static",
"void",
"renameFiles",
"(",
"String",
"folder",
",",
"String",
"prefix",
",",
"String",
"suffix",
",",
"int",
"start",
")",
"{",
"renameFiles",
"(",
"scanFolderAsArray",
"(",
"folder",
")",
",",
"prefix",
",",
"suffix",
",",
"start",
")... | 批量重命名文件
@param folder 文件夹
@param prefix 文件前缀
@param suffix 文件后缀
@param start 开始位置 | [
"批量重命名文件"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/FileExecutor.java#L595-L597 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.writeAccessControlEntry | public void writeAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsAccessControlEntry ace)
throws CmsException {
"""
Writes an access control entries to a given resource.<p>
@param dbc the current database context
@param resource the resource
@param ace the entry to write
@throws CmsExcepti... | java | public void writeAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsAccessControlEntry ace)
throws CmsException {
// write the new ace
getUserDriver(dbc).writeAccessControlEntry(dbc, dbc.currentProject(), ace);
// log it
log(
dbc,
new CmsLogEntry(... | [
"public",
"void",
"writeAccessControlEntry",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
",",
"CmsAccessControlEntry",
"ace",
")",
"throws",
"CmsException",
"{",
"// write the new ace",
"getUserDriver",
"(",
"dbc",
")",
".",
"writeAccessControlEntry",
"(... | Writes an access control entries to a given resource.<p>
@param dbc the current database context
@param resource the resource
@param ace the entry to write
@throws CmsException if something goes wrong | [
"Writes",
"an",
"access",
"control",
"entries",
"to",
"a",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9609-L9636 |
inferred/FreeBuilder | src/main/java/org/inferred/freebuilder/processor/model/ModelUtils.java | ModelUtils.getReturnType | public static TypeMirror getReturnType(TypeElement type, ExecutableElement method, Types types) {
"""
Determines the return type of {@code method}, if called on an instance of type {@code type}.
<p>For instance, in this example, myY.getProperty() returns List<T>, not T:<pre><code>
interface X<T> {
... | java | public static TypeMirror getReturnType(TypeElement type, ExecutableElement method, Types types) {
try {
ExecutableType executableType = (ExecutableType)
types.asMemberOf((DeclaredType) type.asType(), method);
return executableType.getReturnType();
} catch (IllegalArgumentException e) {
... | [
"public",
"static",
"TypeMirror",
"getReturnType",
"(",
"TypeElement",
"type",
",",
"ExecutableElement",
"method",
",",
"Types",
"types",
")",
"{",
"try",
"{",
"ExecutableType",
"executableType",
"=",
"(",
"ExecutableType",
")",
"types",
".",
"asMemberOf",
"(",
... | Determines the return type of {@code method}, if called on an instance of type {@code type}.
<p>For instance, in this example, myY.getProperty() returns List<T>, not T:<pre><code>
interface X<T> {
T getProperty();
}
@FreeBuilder interface Y<T> extends X<List<T>> { }</code></pre>
<p>(... | [
"Determines",
"the",
"return",
"type",
"of",
"{",
"@code",
"method",
"}",
"if",
"called",
"on",
"an",
"instance",
"of",
"type",
"{",
"@code",
"type",
"}",
"."
] | train | https://github.com/inferred/FreeBuilder/blob/d5a222f90648aece135da4b971c55a60afe8649c/src/main/java/org/inferred/freebuilder/processor/model/ModelUtils.java#L300-L311 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/Threading.java | Threading.waitUnblockedWithError | public static <TError extends Exception> void waitUnblockedWithError(Collection<AsyncWork<?,TError>> tasks) throws TError, CancelException {
"""
Wait for the given tasks to finish, if one has an error this error is immediately thrown without waiting for other tasks.
"""
for (AsyncWork<?,TError> t : tasks)
... | java | public static <TError extends Exception> void waitUnblockedWithError(Collection<AsyncWork<?,TError>> tasks) throws TError, CancelException {
for (AsyncWork<?,TError> t : tasks)
t.blockResult(0);
} | [
"public",
"static",
"<",
"TError",
"extends",
"Exception",
">",
"void",
"waitUnblockedWithError",
"(",
"Collection",
"<",
"AsyncWork",
"<",
"?",
",",
"TError",
">",
">",
"tasks",
")",
"throws",
"TError",
",",
"CancelException",
"{",
"for",
"(",
"AsyncWork",
... | Wait for the given tasks to finish, if one has an error this error is immediately thrown without waiting for other tasks. | [
"Wait",
"for",
"the",
"given",
"tasks",
"to",
"finish",
"if",
"one",
"has",
"an",
"error",
"this",
"error",
"is",
"immediately",
"thrown",
"without",
"waiting",
"for",
"other",
"tasks",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/Threading.java#L215-L218 |
broadinstitute/barclay | src/main/java/org/broadinstitute/barclay/argparser/ClassFinder.java | ClassFinder.scanDir | protected void scanDir(final File file, final String path) {
"""
Scans a directory on the filesystem for classes.
@param file the directory or file to examine
@param path the package path acculmulated so far (e.g. edu/mit/broad)
"""
for ( final File child: file.listFiles() ) {
final Strin... | java | protected void scanDir(final File file, final String path) {
for ( final File child: file.listFiles() ) {
final String newPath = (path==null ? child.getName() : path + '/' + child.getName() );
if ( child.isDirectory() ) {
scanDir(child, newPath);
}
... | [
"protected",
"void",
"scanDir",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"path",
")",
"{",
"for",
"(",
"final",
"File",
"child",
":",
"file",
".",
"listFiles",
"(",
")",
")",
"{",
"final",
"String",
"newPath",
"=",
"(",
"path",
"==",
"nu... | Scans a directory on the filesystem for classes.
@param file the directory or file to examine
@param path the package path acculmulated so far (e.g. edu/mit/broad) | [
"Scans",
"a",
"directory",
"on",
"the",
"filesystem",
"for",
"classes",
"."
] | train | https://github.com/broadinstitute/barclay/blob/7e56d725766b0da3baff23e79a31c3d01c3589c2/src/main/java/org/broadinstitute/barclay/argparser/ClassFinder.java#L124-L134 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/references/CompoundTypeReference.java | CompoundTypeReference.toJavaCompliantTypeReference | @Override
public JvmTypeReference toJavaCompliantTypeReference(IVisibilityHelper visibilityHelper) {
"""
{@inheritDoc}
If this is a multi-type rather than a {@link #isSynonym() synonym}, the Java compliant
type reference is determined from the common super type of all participating, non-interface types.
If t... | java | @Override
public JvmTypeReference toJavaCompliantTypeReference(IVisibilityHelper visibilityHelper) {
if (!isSynonym()) {
List<LightweightTypeReference> nonInterfaceTypes = getNonInterfaceTypes(components);
if (nonInterfaceTypes != null) {
return toJavaCompliantTypeReference(nonInterfaceTypes, visibilityHel... | [
"@",
"Override",
"public",
"JvmTypeReference",
"toJavaCompliantTypeReference",
"(",
"IVisibilityHelper",
"visibilityHelper",
")",
"{",
"if",
"(",
"!",
"isSynonym",
"(",
")",
")",
"{",
"List",
"<",
"LightweightTypeReference",
">",
"nonInterfaceTypes",
"=",
"getNonInter... | {@inheritDoc}
If this is a multi-type rather than a {@link #isSynonym() synonym}, the Java compliant
type reference is determined from the common super type of all participating, non-interface types.
If there is no such type or this is a synonym, all the component types are used to compute
the common super type and us... | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/references/CompoundTypeReference.java#L78-L87 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/selenium/CertificateCreator.java | CertificateCreator.createTypicalMasterCert | @SuppressWarnings("deprecation")
public static X509Certificate createTypicalMasterCert(final KeyPair keyPair)
throws SignatureException, InvalidKeyException, SecurityException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException {
"""
Creates a typical Certification Authority (CA) certific... | java | @SuppressWarnings("deprecation")
public static X509Certificate createTypicalMasterCert(final KeyPair keyPair)
throws SignatureException, InvalidKeyException, SecurityException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException
{
X509V3CertificateGenerator v3CertGen = new X509V3Certificat... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"X509Certificate",
"createTypicalMasterCert",
"(",
"final",
"KeyPair",
"keyPair",
")",
"throws",
"SignatureException",
",",
"InvalidKeyException",
",",
"SecurityException",
",",
"CertificateException"... | Creates a typical Certification Authority (CA) certificate.
@param keyPair
@throws SecurityException
@throws InvalidKeyException
@throws NoSuchProviderException
@throws NoSuchAlgorithmException
@throws CertificateException | [
"Creates",
"a",
"typical",
"Certification",
"Authority",
"(",
"CA",
")",
"certificate",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/selenium/CertificateCreator.java#L351-L407 |
Netflix/Nicobar | nicobar-cassandra/src/main/java/com/netflix/nicobar/cassandra/internal/AbstractCassandraHystrixCommand.java | AbstractCassandraHystrixCommand.getColumnFamilyViaColumnName | @SuppressWarnings( {
"""
returns a ColumnFamily given a columnFamilyName
@param columnFamilyName
@param rowKeyClass
@return a constructed ColumnFamily
""""unchecked", "rawtypes"})
protected ColumnFamily getColumnFamilyViaColumnName(String columnFamilyName, Class rowKeyClass) {
if (rowKeyClass ==... | java | @SuppressWarnings({"unchecked", "rawtypes"})
protected ColumnFamily getColumnFamilyViaColumnName(String columnFamilyName, Class rowKeyClass) {
if (rowKeyClass == String.class) {
return new ColumnFamily(columnFamilyName, StringSerializer.get(), StringSerializer.get());
} else if (rowKeyCl... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"protected",
"ColumnFamily",
"getColumnFamilyViaColumnName",
"(",
"String",
"columnFamilyName",
",",
"Class",
"rowKeyClass",
")",
"{",
"if",
"(",
"rowKeyClass",
"==",
"String",
".",
... | returns a ColumnFamily given a columnFamilyName
@param columnFamilyName
@param rowKeyClass
@return a constructed ColumnFamily | [
"returns",
"a",
"ColumnFamily",
"given",
"a",
"columnFamilyName"
] | train | https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-cassandra/src/main/java/com/netflix/nicobar/cassandra/internal/AbstractCassandraHystrixCommand.java#L52-L63 |
VoltDB/voltdb | src/frontend/org/voltdb/ClientAppBase.java | ClientAppBase.printLog | protected void printLog(String msg, Object...args) {
"""
<p>The non-static method to print a log message to the console.</p>
<p>This method will automatically use the name of the current class as class name.</p>
@param msg The log message that needs to be printed.
@param args The arguments that may be needed fo... | java | protected void printLog(String msg, Object...args) {
printLogStatic(this.getClass().getSimpleName(), msg, args);
} | [
"protected",
"void",
"printLog",
"(",
"String",
"msg",
",",
"Object",
"...",
"args",
")",
"{",
"printLogStatic",
"(",
"this",
".",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
",",
"msg",
",",
"args",
")",
";",
"}"
] | <p>The non-static method to print a log message to the console.</p>
<p>This method will automatically use the name of the current class as class name.</p>
@param msg The log message that needs to be printed.
@param args The arguments that may be needed for formatting the message. | [
"<p",
">",
"The",
"non",
"-",
"static",
"method",
"to",
"print",
"a",
"log",
"message",
"to",
"the",
"console",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"method",
"will",
"automatically",
"use",
"the",
"name",
"of",
"the",
"current",
"class",
"as"... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ClientAppBase.java#L71-L73 |
borball/weixin-sdk | weixin-mp/src/main/java/com/riversoft/weixin/mp/media/Materials.java | Materials.addImage | public Material addImage(InputStream inputStream, String fileName) {
"""
上传图片
@param inputStream 图片流
@param fileName 文件名
@return 上传结果
"""
return upload(MediaType.image, inputStream, fileName);
} | java | public Material addImage(InputStream inputStream, String fileName) {
return upload(MediaType.image, inputStream, fileName);
} | [
"public",
"Material",
"addImage",
"(",
"InputStream",
"inputStream",
",",
"String",
"fileName",
")",
"{",
"return",
"upload",
"(",
"MediaType",
".",
"image",
",",
"inputStream",
",",
"fileName",
")",
";",
"}"
] | 上传图片
@param inputStream 图片流
@param fileName 文件名
@return 上传结果 | [
"上传图片"
] | train | https://github.com/borball/weixin-sdk/blob/32bf5e45cdd8d0d28074e83954e1ec62dcf25cb7/weixin-mp/src/main/java/com/riversoft/weixin/mp/media/Materials.java#L154-L156 |
lessthanoptimal/ejml | main/ejml-core/src/org/ejml/data/DMatrixRMaj.java | DMatrixRMaj.set | @Override
public void set( int row , int col , double value ) {
"""
<p>
Assigns the element in the Matrix to the specified value. Performs a bounds check to make sure
the requested element is part of the matrix. <br>
<br>
a<sub>ij</sub> = value<br>
</p>
@param row The row of the element.
@param col T... | java | @Override
public void set( int row , int col , double value ) {
if( col < 0 || col >= numCols || row < 0 || row >= numRows ) {
throw new IllegalArgumentException("Specified element is out of bounds: ("+row+" , "+col+")");
}
data[ row * numCols + col ] = value;
} | [
"@",
"Override",
"public",
"void",
"set",
"(",
"int",
"row",
",",
"int",
"col",
",",
"double",
"value",
")",
"{",
"if",
"(",
"col",
"<",
"0",
"||",
"col",
">=",
"numCols",
"||",
"row",
"<",
"0",
"||",
"row",
">=",
"numRows",
")",
"{",
"throw",
... | <p>
Assigns the element in the Matrix to the specified value. Performs a bounds check to make sure
the requested element is part of the matrix. <br>
<br>
a<sub>ij</sub> = value<br>
</p>
@param row The row of the element.
@param col The column of the element.
@param value The element's new value. | [
"<p",
">",
"Assigns",
"the",
"element",
"in",
"the",
"Matrix",
"to",
"the",
"specified",
"value",
".",
"Performs",
"a",
"bounds",
"check",
"to",
"make",
"sure",
"the",
"requested",
"element",
"is",
"part",
"of",
"the",
"matrix",
".",
"<br",
">",
"<br",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/data/DMatrixRMaj.java#L212-L219 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java | Stanza.appendErrorIfExists | protected void appendErrorIfExists(XmlStringBuilder xml, XmlEnvironment enclosingXmlEnvironment) {
"""
Append an XMPPError is this stanza has one set.
@param xml the XmlStringBuilder to append the error to.
"""
StanzaError error = getError();
if (error != null) {
xml.append(error... | java | protected void appendErrorIfExists(XmlStringBuilder xml, XmlEnvironment enclosingXmlEnvironment) {
StanzaError error = getError();
if (error != null) {
xml.append(error.toXML(enclosingXmlEnvironment));
}
} | [
"protected",
"void",
"appendErrorIfExists",
"(",
"XmlStringBuilder",
"xml",
",",
"XmlEnvironment",
"enclosingXmlEnvironment",
")",
"{",
"StanzaError",
"error",
"=",
"getError",
"(",
")",
";",
"if",
"(",
"error",
"!=",
"null",
")",
"{",
"xml",
".",
"append",
"(... | Append an XMPPError is this stanza has one set.
@param xml the XmlStringBuilder to append the error to. | [
"Append",
"an",
"XMPPError",
"is",
"this",
"stanza",
"has",
"one",
"set",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java#L549-L554 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/OmsGrassLegacyReader.java | OmsGrassLegacyReader.getValueAt | public static double getValueAt( Window window, Coordinate coordinate, String filePath, IHMProgressMonitor pm )
throws Exception {
"""
Get a single value in a position of the raster.
<p>This opens and closes the raster every time it is called. Bad performance on many calls.
@param window the grid... | java | public static double getValueAt( Window window, Coordinate coordinate, String filePath, IHMProgressMonitor pm )
throws Exception {
JGrassMapEnvironment mapEnvironment = new JGrassMapEnvironment(new File(filePath));
if (window == null) {
JGrassRegion jgr = mapEnvironment.getActive... | [
"public",
"static",
"double",
"getValueAt",
"(",
"Window",
"window",
",",
"Coordinate",
"coordinate",
",",
"String",
"filePath",
",",
"IHMProgressMonitor",
"pm",
")",
"throws",
"Exception",
"{",
"JGrassMapEnvironment",
"mapEnvironment",
"=",
"new",
"JGrassMapEnvironme... | Get a single value in a position of the raster.
<p>This opens and closes the raster every time it is called. Bad performance on many calls.
@param window the grid on which to base on (if <code>null</code>, the active region is picked).
@param coordinate the coordinate in which the value is read.
@param filePath the p... | [
"Get",
"a",
"single",
"value",
"in",
"a",
"position",
"of",
"the",
"raster",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/OmsGrassLegacyReader.java#L164-L187 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/PippoSettings.java | PippoSettings.overrideSetting | public void overrideSetting(String name, double value) {
"""
Override the setting at runtime with the specified value.
This change does not persist.
@param name
@param value
"""
overrides.put(name, Double.toString(value));
} | java | public void overrideSetting(String name, double value) {
overrides.put(name, Double.toString(value));
} | [
"public",
"void",
"overrideSetting",
"(",
"String",
"name",
",",
"double",
"value",
")",
"{",
"overrides",
".",
"put",
"(",
"name",
",",
"Double",
".",
"toString",
"(",
"value",
")",
")",
";",
"}"
] | Override the setting at runtime with the specified value.
This change does not persist.
@param name
@param value | [
"Override",
"the",
"setting",
"at",
"runtime",
"with",
"the",
"specified",
"value",
".",
"This",
"change",
"does",
"not",
"persist",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L1078-L1080 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseInputConfig | private void parseInputConfig(final Node node, final ConfigSettings config) {
"""
Parses the input parameter section.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings
"""
String name, value;
Node nnode;
NodeList list = node.getChildNodes();
int le... | java | private void parseInputConfig(final Node node, final ConfigSettings config)
{
String name, value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.equals(KEY... | [
"private",
"void",
"parseInputConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
",",
"value",
";",
"Node",
"nnode",
";",
"NodeList",
"list",
"=",
"node",
".",
"getChildNodes",
"(",
")",
";",
"int",... | Parses the input parameter section.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"input",
"parameter",
"section",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L405-L438 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java | SeaGlassLookAndFeel.updateSeaglassStyle | public static SynthStyle updateSeaglassStyle(SynthContext context, SeaglassUI ui) {
"""
A convience method that will reset the Style of StyleContext if
necessary.
@return newStyle
"""
SynthStyle newStyle = getStyle(context.getComponent(), context.getRegion());
// TODO rossi 04.07.2011 this ... | java | public static SynthStyle updateSeaglassStyle(SynthContext context, SeaglassUI ui) {
SynthStyle newStyle = getStyle(context.getComponent(), context.getRegion());
// TODO rossi 04.07.2011 this code is now private in the Synth L&F
// SynthStyle oldStyle = context.getStyle();
//
// if (newStyl... | [
"public",
"static",
"SynthStyle",
"updateSeaglassStyle",
"(",
"SynthContext",
"context",
",",
"SeaglassUI",
"ui",
")",
"{",
"SynthStyle",
"newStyle",
"=",
"getStyle",
"(",
"context",
".",
"getComponent",
"(",
")",
",",
"context",
".",
"getRegion",
"(",
")",
")... | A convience method that will reset the Style of StyleContext if
necessary.
@return newStyle | [
"A",
"convience",
"method",
"that",
"will",
"reset",
"the",
"Style",
"of",
"StyleContext",
"if",
"necessary",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java#L603-L616 |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/swift/SwiftAPIDirect.java | SwiftAPIDirect.getObject | public static SwiftInputStreamWrapper getObject(Path path, JossAccount account,
SwiftConnectionManager scm)
throws IOException {
"""
Get object
@param path path to object
@param account Joss account wrapper object
@param scm Swift connection manager
@return SwiftGETResponse input stream and conte... | java | public static SwiftInputStreamWrapper getObject(Path path, JossAccount account,
SwiftConnectionManager scm)
throws IOException {
return getObject(path, account, 0, 0, scm);
} | [
"public",
"static",
"SwiftInputStreamWrapper",
"getObject",
"(",
"Path",
"path",
",",
"JossAccount",
"account",
",",
"SwiftConnectionManager",
"scm",
")",
"throws",
"IOException",
"{",
"return",
"getObject",
"(",
"path",
",",
"account",
",",
"0",
",",
"0",
",",
... | Get object
@param path path to object
@param account Joss account wrapper object
@param scm Swift connection manager
@return SwiftGETResponse input stream and content length
@throws IOException if network issues | [
"Get",
"object"
] | train | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/swift/SwiftAPIDirect.java#L62-L66 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java | FileOperations.deleteFileFromComputeNode | public void deleteFileFromComputeNode(String poolId, String nodeId, String fileName, Boolean recursive, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Deletes the specified file from the specified compute node.
@param poolId The ID of the pool that contains the ... | java | public void deleteFileFromComputeNode(String poolId, String nodeId, String fileName, Boolean recursive, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
FileDeleteFromComputeNodeOptions options = new FileDeleteFromComputeNodeOptions();
BehaviorManager bhMgr = ... | [
"public",
"void",
"deleteFileFromComputeNode",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"String",
"fileName",
",",
"Boolean",
"recursive",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",... | Deletes the specified file from the specified compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node.
@param fileName The name of the file to delete.
@param recursive If the file-path parameter represents a directory instead of a file, you can set the re... | [
"Deletes",
"the",
"specified",
"file",
"from",
"the",
"specified",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java#L246-L252 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierApplications.java | TypeQualifierApplications.getEffectiveTypeQualifierAnnotation | public static TypeQualifierAnnotation getEffectiveTypeQualifierAnnotation(AnnotatedObject o,
TypeQualifierValue<?> typeQualifierValue) {
"""
Get the effective TypeQualifierAnnotation on given AnnotatedObject. Takes
into account inherited and default (outer scope) annotations. Also takes
exclusive qua... | java | public static TypeQualifierAnnotation getEffectiveTypeQualifierAnnotation(AnnotatedObject o,
TypeQualifierValue<?> typeQualifierValue) {
if (o instanceof XMethod) {
XMethod m = (XMethod) o;
if (m.getName().startsWith("access$")) {
InnerClassAccessMap icam = An... | [
"public",
"static",
"TypeQualifierAnnotation",
"getEffectiveTypeQualifierAnnotation",
"(",
"AnnotatedObject",
"o",
",",
"TypeQualifierValue",
"<",
"?",
">",
"typeQualifierValue",
")",
"{",
"if",
"(",
"o",
"instanceof",
"XMethod",
")",
"{",
"XMethod",
"m",
"=",
"(",
... | Get the effective TypeQualifierAnnotation on given AnnotatedObject. Takes
into account inherited and default (outer scope) annotations. Also takes
exclusive qualifiers into account.
@param o
an AnnotatedObject
@param typeQualifierValue
a TypeQualifierValue specifying kind of annotation we want to
look up
@return the e... | [
"Get",
"the",
"effective",
"TypeQualifierAnnotation",
"on",
"given",
"AnnotatedObject",
".",
"Takes",
"into",
"account",
"inherited",
"and",
"default",
"(",
"outer",
"scope",
")",
"annotations",
".",
"Also",
"takes",
"exclusive",
"qualifiers",
"into",
"account",
"... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierApplications.java#L559-L594 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/matrix/AbstractMatrix.java | AbstractMatrix.swapRows | public void swapRows(int r1, int r2, Object tmp) {
"""
Swaps row r1 and r2 possibly using tmp
@param r1
@param r2
@param tmp double [columns]
"""
int col = columns();
System.arraycopy(array, col * r1, tmp, 0, col);
System.arraycopy(array, col * r2, array, col * r1, col);
Syst... | java | public void swapRows(int r1, int r2, Object tmp)
{
int col = columns();
System.arraycopy(array, col * r1, tmp, 0, col);
System.arraycopy(array, col * r2, array, col * r1, col);
System.arraycopy(tmp, 0, array, col * r2, col);
} | [
"public",
"void",
"swapRows",
"(",
"int",
"r1",
",",
"int",
"r2",
",",
"Object",
"tmp",
")",
"{",
"int",
"col",
"=",
"columns",
"(",
")",
";",
"System",
".",
"arraycopy",
"(",
"array",
",",
"col",
"*",
"r1",
",",
"tmp",
",",
"0",
",",
"col",
")... | Swaps row r1 and r2 possibly using tmp
@param r1
@param r2
@param tmp double [columns] | [
"Swaps",
"row",
"r1",
"and",
"r2",
"possibly",
"using",
"tmp"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/matrix/AbstractMatrix.java#L164-L170 |
rythmengine/rythmengine | src/main/java/org/rythmengine/toString/ToStringStyle.java | ToStringStyle.appendCyclicObject | protected void appendCyclicObject(StringBuilder buffer, String fieldName, Object value) {
"""
<p>Append to the <code>toString</code> an <code>Object</code>
value that has been detected to participate in a cycle. This
implementation will print the standard string value of the value.</p>
@param buffer the <c... | java | protected void appendCyclicObject(StringBuilder buffer, String fieldName, Object value) {
if (value == null) {
throw new NullPointerException("Cannot get the toString of a null identity");
}
buffer.append(value.getClass().getName())
.append('@')
.appen... | [
"protected",
"void",
"appendCyclicObject",
"(",
"StringBuilder",
"buffer",
",",
"String",
"fieldName",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Cannot get the toString of a null ide... | <p>Append to the <code>toString</code> an <code>Object</code>
value that has been detected to participate in a cycle. This
implementation will print the standard string value of the value.</p>
@param buffer the <code>StringBuilder</code> to populate
@param fieldName the field name, typically not used as already app... | [
"<p",
">",
"Append",
"to",
"the",
"<code",
">",
"toString<",
"/",
"code",
">",
"an",
"<code",
">",
"Object<",
"/",
"code",
">",
"value",
"that",
"has",
"been",
"detected",
"to",
"participate",
"in",
"a",
"cycle",
".",
"This",
"implementation",
"will",
... | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/toString/ToStringStyle.java#L573-L580 |
wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java | AbstractRouter.getRouteFor | @Override
@Deprecated
public Route getRouteFor(HttpMethod method, String uri) {
"""
Gets the route for the given method and uri. This implementation delegates to
{@link #getRouteFor(org.wisdom.api.http.HttpMethod, String)}.
@param method the method (must be a valid HTTP method)
@param uri the uri... | java | @Override
@Deprecated
public Route getRouteFor(HttpMethod method, String uri) {
return getRouteFor(method, uri, null);
} | [
"@",
"Override",
"@",
"Deprecated",
"public",
"Route",
"getRouteFor",
"(",
"HttpMethod",
"method",
",",
"String",
"uri",
")",
"{",
"return",
"getRouteFor",
"(",
"method",
",",
"uri",
",",
"null",
")",
";",
"}"
] | Gets the route for the given method and uri. This implementation delegates to
{@link #getRouteFor(org.wisdom.api.http.HttpMethod, String)}.
@param method the method (must be a valid HTTP method)
@param uri the uri
@return the route, {@literal unbound} if no controller handles the request
@deprecated use {@link #g... | [
"Gets",
"the",
"route",
"for",
"the",
"given",
"method",
"and",
"uri",
".",
"This",
"implementation",
"delegates",
"to",
"{",
"@link",
"#getRouteFor",
"(",
"org",
".",
"wisdom",
".",
"api",
".",
"http",
".",
"HttpMethod",
"String",
")",
"}",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java#L72-L76 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/UserApi.java | UserApi.createImpersonationToken | public ImpersonationToken createImpersonationToken(Object userIdOrUsername, String name, Date expiresAt, Scope[] scopes) throws GitLabApiException {
"""
Create an impersonation token. Available only for admin users.
<pre><code>GitLab Endpoint: POST /users/:user_id/impersonation_tokens</code></pre>
@param us... | java | public ImpersonationToken createImpersonationToken(Object userIdOrUsername, String name, Date expiresAt, Scope[] scopes) throws GitLabApiException {
if (scopes == null || scopes.length == 0) {
throw new RuntimeException("scopes cannot be null or empty");
}
GitLabApiForm formData = ... | [
"public",
"ImpersonationToken",
"createImpersonationToken",
"(",
"Object",
"userIdOrUsername",
",",
"String",
"name",
",",
"Date",
"expiresAt",
",",
"Scope",
"[",
"]",
"scopes",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"scopes",
"==",
"null",
"||",
"... | Create an impersonation token. Available only for admin users.
<pre><code>GitLab Endpoint: POST /users/:user_id/impersonation_tokens</code></pre>
@param userIdOrUsername the user in the form of an Integer(ID), String(username), or User instance
@param name the name of the impersonation token, required
@param expires... | [
"Create",
"an",
"impersonation",
"token",
".",
"Available",
"only",
"for",
"admin",
"users",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/UserApi.java#L807-L823 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsEditor.java | CmsEditor.deleteLocaleButton | public String deleteLocaleButton(String href, String target, String image, String label, int type) {
"""
Generates a button for delete locale.<p>
@param href the href link for the button, if none is given the button will be disabled
@param target the href link target for the button, if none is given the target... | java | public String deleteLocaleButton(String href, String target, String image, String label, int type) {
String filename = getParamResource();
try {
CmsResource res = getCms().readResource(filename, CmsResourceFilter.IGNORE_EXPIRATION);
String temporaryFilename = CmsWorkplace.getT... | [
"public",
"String",
"deleteLocaleButton",
"(",
"String",
"href",
",",
"String",
"target",
",",
"String",
"image",
",",
"String",
"label",
",",
"int",
"type",
")",
"{",
"String",
"filename",
"=",
"getParamResource",
"(",
")",
";",
"try",
"{",
"CmsResource",
... | Generates a button for delete locale.<p>
@param href the href link for the button, if none is given the button will be disabled
@param target the href link target for the button, if none is given the target will be same window
@param image the image name for the button, skin path will be automatically added as prefix
... | [
"Generates",
"a",
"button",
"for",
"delete",
"locale",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsEditor.java#L435-L463 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/spout/AmBaseSpout.java | AmBaseSpout.emitWithNoKeyIdAndGroupingStream | protected void emitWithNoKeyIdAndGroupingStream(StreamMessage message, String groupingKey,
String streamId) {
"""
Not use this class's key history function, and not use MessageId(Id identify by storm).<br>
Send message to downstream component with grouping key and streamId.<br>
Use following situatio... | java | protected void emitWithNoKeyIdAndGroupingStream(StreamMessage message, String groupingKey,
String streamId)
{
this.getCollector().emit(streamId, new Values(groupingKey, message));
} | [
"protected",
"void",
"emitWithNoKeyIdAndGroupingStream",
"(",
"StreamMessage",
"message",
",",
"String",
"groupingKey",
",",
"String",
"streamId",
")",
"{",
"this",
".",
"getCollector",
"(",
")",
".",
"emit",
"(",
"streamId",
",",
"new",
"Values",
"(",
"grouping... | Not use this class's key history function, and not use MessageId(Id identify by storm).<br>
Send message to downstream component with grouping key and streamId.<br>
Use following situation.
<ol>
<li>Not use this class's key history function.</li>
<li>Not use storm's fault detect function.</li>
</ol>
@param message sen... | [
"Not",
"use",
"this",
"class",
"s",
"key",
"history",
"function",
"and",
"not",
"use",
"MessageId",
"(",
"Id",
"identify",
"by",
"storm",
")",
".",
"<br",
">",
"Send",
"message",
"to",
"downstream",
"component",
"with",
"grouping",
"key",
"and",
"streamId"... | train | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/spout/AmBaseSpout.java#L407-L411 |
apache/incubator-gobblin | gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/KafkaJobStatusMonitor.java | KafkaJobStatusMonitor.addJobStatusToStateStore | @VisibleForTesting
static void addJobStatusToStateStore(org.apache.gobblin.configuration.State jobStatus, StateStore stateStore)
throws IOException {
"""
Persist job status to the underlying {@link StateStore}.
It fills missing fields in job status and also merge the fields with the
existing job status i... | java | @VisibleForTesting
static void addJobStatusToStateStore(org.apache.gobblin.configuration.State jobStatus, StateStore stateStore)
throws IOException {
if (!jobStatus.contains(TimingEvent.FlowEventConstants.JOB_NAME_FIELD)) {
jobStatus.setProp(TimingEvent.FlowEventConstants.JOB_NAME_FIELD, JobStatusRetr... | [
"@",
"VisibleForTesting",
"static",
"void",
"addJobStatusToStateStore",
"(",
"org",
".",
"apache",
".",
"gobblin",
".",
"configuration",
".",
"State",
"jobStatus",
",",
"StateStore",
"stateStore",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"jobStatus",
"... | Persist job status to the underlying {@link StateStore}.
It fills missing fields in job status and also merge the fields with the
existing job status in the state store. Merging is required because we
do not want to lose the information sent by other GobblinTrackingEvents.
@param jobStatus
@throws IOException | [
"Persist",
"job",
"status",
"to",
"the",
"underlying",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/KafkaJobStatusMonitor.java#L131-L152 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsResourceIcon.java | CmsResourceIcon.getDefaultFileOrDetailType | public static String getDefaultFileOrDetailType(CmsObject cms, CmsResource resource) {
"""
Returns the default file type or detail type for the given resource.<p>
@param cms the cms context
@param resource the container page resource
@return the detail content type
"""
String type = null;
... | java | public static String getDefaultFileOrDetailType(CmsObject cms, CmsResource resource) {
String type = null;
if (resource.isFolder()
&& !(OpenCms.getResourceManager().getResourceType(resource) instanceof CmsResourceTypeFolderExtended)
&& !CmsJspNavBuilder.isNavLevelFolder(cms, re... | [
"public",
"static",
"String",
"getDefaultFileOrDetailType",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"{",
"String",
"type",
"=",
"null",
";",
"if",
"(",
"resource",
".",
"isFolder",
"(",
")",
"&&",
"!",
"(",
"OpenCms",
".",
"getResourceM... | Returns the default file type or detail type for the given resource.<p>
@param cms the cms context
@param resource the container page resource
@return the detail content type | [
"Returns",
"the",
"default",
"file",
"type",
"or",
"detail",
"type",
"for",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsResourceIcon.java#L132-L157 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/FeatureTokens.java | FeatureTokens.setEndings | public void setEndings(int i, int v) {
"""
indexed setter for endings - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (FeatureTokens_Type.featOkTst && ((FeatureTokens_Type)jcasType).casFeat_endings == null)
jcasType.jcas.throwFea... | java | public void setEndings(int i, int v) {
if (FeatureTokens_Type.featOkTst && ((FeatureTokens_Type)jcasType).casFeat_endings == null)
jcasType.jcas.throwFeatMissing("endings", "ch.epfl.bbp.uima.types.FeatureTokens");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((FeatureTokens_Type)jc... | [
"public",
"void",
"setEndings",
"(",
"int",
"i",
",",
"int",
"v",
")",
"{",
"if",
"(",
"FeatureTokens_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"FeatureTokens_Type",
")",
"jcasType",
")",
".",
"casFeat_endings",
"==",
"null",
")",
"jcasType",
".",
"jcas",
... | indexed setter for endings - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"endings",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/FeatureTokens.java#L206-L210 |
JodaOrg/joda-time | src/main/java/org/joda/time/MonthDay.java | MonthDay.withMonthOfYear | public MonthDay withMonthOfYear(int monthOfYear) {
"""
Returns a copy of this month-day with the month of year field updated.
<p>
MonthDay is immutable, so there are no set methods.
Instead, this method returns a new instance with the value of
month of year changed.
@param monthOfYear the month of year to ... | java | public MonthDay withMonthOfYear(int monthOfYear) {
int[] newValues = getValues();
newValues = getChronology().monthOfYear().set(this, MONTH_OF_YEAR, newValues, monthOfYear);
return new MonthDay(this, newValues);
} | [
"public",
"MonthDay",
"withMonthOfYear",
"(",
"int",
"monthOfYear",
")",
"{",
"int",
"[",
"]",
"newValues",
"=",
"getValues",
"(",
")",
";",
"newValues",
"=",
"getChronology",
"(",
")",
".",
"monthOfYear",
"(",
")",
".",
"set",
"(",
"this",
",",
"MONTH_O... | Returns a copy of this month-day with the month of year field updated.
<p>
MonthDay is immutable, so there are no set methods.
Instead, this method returns a new instance with the value of
month of year changed.
@param monthOfYear the month of year to set
@return a copy of this object with the field set, never null
@... | [
"Returns",
"a",
"copy",
"of",
"this",
"month",
"-",
"day",
"with",
"the",
"month",
"of",
"year",
"field",
"updated",
".",
"<p",
">",
"MonthDay",
"is",
"immutable",
"so",
"there",
"are",
"no",
"set",
"methods",
".",
"Instead",
"this",
"method",
"returns",... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MonthDay.java#L720-L724 |
aws/aws-sdk-java | aws-java-sdk-cloudtrail/src/main/java/com/amazonaws/services/cloudtrail/model/EventSelector.java | EventSelector.getDataResources | public java.util.List<DataResource> getDataResources() {
"""
<p>
CloudTrail supports data event logging for Amazon S3 objects and AWS Lambda functions. You can specify up to 250
resources for an individual event selector, but the total number of data resources cannot exceed 250 across all
event selectors in a t... | java | public java.util.List<DataResource> getDataResources() {
if (dataResources == null) {
dataResources = new com.amazonaws.internal.SdkInternalList<DataResource>();
}
return dataResources;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"DataResource",
">",
"getDataResources",
"(",
")",
"{",
"if",
"(",
"dataResources",
"==",
"null",
")",
"{",
"dataResources",
"=",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInternalList",
"<",... | <p>
CloudTrail supports data event logging for Amazon S3 objects and AWS Lambda functions. You can specify up to 250
resources for an individual event selector, but the total number of data resources cannot exceed 250 across all
event selectors in a trail. This limit does not apply if you configure resource logging for... | [
"<p",
">",
"CloudTrail",
"supports",
"data",
"event",
"logging",
"for",
"Amazon",
"S3",
"objects",
"and",
"AWS",
"Lambda",
"functions",
".",
"You",
"can",
"specify",
"up",
"to",
"250",
"resources",
"for",
"an",
"individual",
"event",
"selector",
"but",
"the"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudtrail/src/main/java/com/amazonaws/services/cloudtrail/model/EventSelector.java#L335-L340 |
Syncleus/aparapi | src/main/java/com/aparapi/internal/kernel/KernelDeviceProfile.java | KernelDeviceProfile.getElapsedTimeLastThread | public double getElapsedTimeLastThread(int from, int to) {
"""
Elapsed time for all events {@code from} through {@code to} for the last thread that executed this KernelDeviceProfile
instance respective kernel and device.
@param from the first event to consider that defines the elapsed period start
@param to t... | java | public double getElapsedTimeLastThread(int from, int to) {
Accumulator acc = lastAccumulator.get();
return acc == null ? Double.NaN : (acc.currentTimes[to] - acc.currentTimes[from]) / MILLION;
} | [
"public",
"double",
"getElapsedTimeLastThread",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"Accumulator",
"acc",
"=",
"lastAccumulator",
".",
"get",
"(",
")",
";",
"return",
"acc",
"==",
"null",
"?",
"Double",
".",
"NaN",
":",
"(",
"acc",
".",
"cu... | Elapsed time for all events {@code from} through {@code to} for the last thread that executed this KernelDeviceProfile
instance respective kernel and device.
@param from the first event to consider that defines the elapsed period start
@param to the last event to consider for elapsed period | [
"Elapsed",
"time",
"for",
"all",
"events",
"{",
"@code",
"from",
"}",
"through",
"{",
"@code",
"to",
"}",
"for",
"the",
"last",
"thread",
"that",
"executed",
"this",
"KernelDeviceProfile",
"instance",
"respective",
"kernel",
"and",
"device",
"."
] | train | https://github.com/Syncleus/aparapi/blob/6d5892c8e69854b3968c541023de37cf4762bd24/src/main/java/com/aparapi/internal/kernel/KernelDeviceProfile.java#L304-L308 |
alkacon/opencms-core | src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBProjectId.java | CmsUpdateDBProjectId.renameColumn | private void renameColumn(CmsSetupDb dbCon, String tablename, String oldname, String newname) throws SQLException {
"""
Renames the column of the given table the new name.<p>
@param dbCon the db connection interface
@param tablename the table in which the column shall be renamed
@param oldname the old name of... | java | private void renameColumn(CmsSetupDb dbCon, String tablename, String oldname, String newname) throws SQLException {
System.out.println(new Exception().getStackTrace()[0].toString());
if (dbCon.hasTableOrColumn(tablename, oldname)) {
String query = readQuery(QUERY_RENAME_COLUMN);
... | [
"private",
"void",
"renameColumn",
"(",
"CmsSetupDb",
"dbCon",
",",
"String",
"tablename",
",",
"String",
"oldname",
",",
"String",
"newname",
")",
"throws",
"SQLException",
"{",
"System",
".",
"out",
".",
"println",
"(",
"new",
"Exception",
"(",
")",
".",
... | Renames the column of the given table the new name.<p>
@param dbCon the db connection interface
@param tablename the table in which the column shall be renamed
@param oldname the old name of the column
@param newname the new name of the column
@throws SQLException if something goes wrong | [
"Renames",
"the",
"column",
"of",
"the",
"given",
"table",
"the",
"new",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBProjectId.java#L717-L731 |
sannies/mp4parser | isoparser/src/main/java/org/mp4parser/boxes/microsoft/XtraBox.java | XtraBox.setTagValues | public void setTagValues(String name, String values[]) {
"""
Removes and recreates tag using specified String values
@param name Tag name to replace
@param values New String values
"""
removeTag(name);
XtraTag tag = new XtraTag(name);
for (int i = 0; i < values.length; i++) {
... | java | public void setTagValues(String name, String values[]) {
removeTag(name);
XtraTag tag = new XtraTag(name);
for (int i = 0; i < values.length; i++) {
tag.values.addElement(new XtraValue(values[i]));
}
tags.addElement(tag);
} | [
"public",
"void",
"setTagValues",
"(",
"String",
"name",
",",
"String",
"values",
"[",
"]",
")",
"{",
"removeTag",
"(",
"name",
")",
";",
"XtraTag",
"tag",
"=",
"new",
"XtraTag",
"(",
"name",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | Removes and recreates tag using specified String values
@param name Tag name to replace
@param values New String values | [
"Removes",
"and",
"recreates",
"tag",
"using",
"specified",
"String",
"values"
] | train | https://github.com/sannies/mp4parser/blob/3382ff5d489363900f352a8da0f794a20ad3b063/isoparser/src/main/java/org/mp4parser/boxes/microsoft/XtraBox.java#L291-L298 |
k3po/k3po | driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/udp/UdpBootstrapFactorySpi.java | UdpBootstrapFactorySpi.newClientBootstrap | @Override
public synchronized ClientBootstrap newClientBootstrap() throws Exception {
"""
Returns a {@link ClientBootstrap} instance for the named transport.
"""
if (clientChannelFactory == null) {
Executor workerExecutor = executorServiceFactory.newExecutorService("worker.client");
... | java | @Override
public synchronized ClientBootstrap newClientBootstrap() throws Exception {
if (clientChannelFactory == null) {
Executor workerExecutor = executorServiceFactory.newExecutorService("worker.client");
NioDatagramWorkerPool workerPool = new NioDatagramWorkerPool(workerExecutor... | [
"@",
"Override",
"public",
"synchronized",
"ClientBootstrap",
"newClientBootstrap",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"clientChannelFactory",
"==",
"null",
")",
"{",
"Executor",
"workerExecutor",
"=",
"executorServiceFactory",
".",
"newExecutorService",
... | Returns a {@link ClientBootstrap} instance for the named transport. | [
"Returns",
"a",
"{"
] | train | https://github.com/k3po/k3po/blob/3ca4fd31ab4a397893aa640c62ada0e485c8bbd4/driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/udp/UdpBootstrapFactorySpi.java#L89-L102 |
knowm/Sundial | src/main/java/org/quartz/QuartzScheduler.java | QuartzScheduler.triggerJob | @Override
public void triggerJob(String jobKey, JobDataMap data) throws SchedulerException {
"""
Trigger the identified <code>{@link org.quartz.jobs.Job}</code> (execute it now) - with a
non-volatile trigger.
"""
validateState();
OperableTrigger operableTrigger =
simpleTriggerBuilder()
... | java | @Override
public void triggerJob(String jobKey, JobDataMap data) throws SchedulerException {
validateState();
OperableTrigger operableTrigger =
simpleTriggerBuilder()
.withIdentity(jobKey + "-trigger")
.forJob(jobKey)
.startAt(new Date())
.build();
... | [
"@",
"Override",
"public",
"void",
"triggerJob",
"(",
"String",
"jobKey",
",",
"JobDataMap",
"data",
")",
"throws",
"SchedulerException",
"{",
"validateState",
"(",
")",
";",
"OperableTrigger",
"operableTrigger",
"=",
"simpleTriggerBuilder",
"(",
")",
".",
"withId... | Trigger the identified <code>{@link org.quartz.jobs.Job}</code> (execute it now) - with a
non-volatile trigger. | [
"Trigger",
"the",
"identified",
"<code",
">",
"{"
] | train | https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/quartz/QuartzScheduler.java#L581-L617 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/transform/serde/BaseSerializer.java | BaseSerializer.deserializeConditionList | public List<Condition> deserializeConditionList(String str) {
"""
Deserialize a Condition List serialized using {@link #serializeConditionList(List)}, or
an array serialized using {@link #serialize(Condition[])}
@param str String representation (YAML/JSON) of the Condition list
@return {@code List<Condition>}... | java | public List<Condition> deserializeConditionList(String str) {
return load(str, ListWrappers.ConditionList.class).getList();
} | [
"public",
"List",
"<",
"Condition",
">",
"deserializeConditionList",
"(",
"String",
"str",
")",
"{",
"return",
"load",
"(",
"str",
",",
"ListWrappers",
".",
"ConditionList",
".",
"class",
")",
".",
"getList",
"(",
")",
";",
"}"
] | Deserialize a Condition List serialized using {@link #serializeConditionList(List)}, or
an array serialized using {@link #serialize(Condition[])}
@param str String representation (YAML/JSON) of the Condition list
@return {@code List<Condition>} | [
"Deserialize",
"a",
"Condition",
"List",
"serialized",
"using",
"{",
"@link",
"#serializeConditionList",
"(",
"List",
")",
"}",
"or",
"an",
"array",
"serialized",
"using",
"{",
"@link",
"#serialize",
"(",
"Condition",
"[]",
")",
"}"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/serde/BaseSerializer.java#L300-L302 |
Bernardo-MG/maven-site-fixer | src/main/java/com/bernardomg/velocity/tool/SiteTool.java | SiteTool.fixHeadingIds | public final void fixHeadingIds(final Element root) {
"""
Adds or fixes heading ids.
<p>
If a heading has an id it will be corrected if needed, otherwise it will
be created from the heading text.
<p>
The following operations are applied during this process:
<ul>
<li>Text will be set to lower case</li>
<li>... | java | public final void fixHeadingIds(final Element root) {
final Collection<Element> headings; // Headings to fix
String idText; // Text to generate the id
checkNotNull(root, "Received a null pointer as root element");
// Table rows with <th> tags in a <tbody>
headings = root.s... | [
"public",
"final",
"void",
"fixHeadingIds",
"(",
"final",
"Element",
"root",
")",
"{",
"final",
"Collection",
"<",
"Element",
">",
"headings",
";",
"// Headings to fix",
"String",
"idText",
";",
"// Text to generate the id",
"checkNotNull",
"(",
"root",
",",
"\"Re... | Adds or fixes heading ids.
<p>
If a heading has an id it will be corrected if needed, otherwise it will
be created from the heading text.
<p>
The following operations are applied during this process:
<ul>
<li>Text will be set to lower case</li>
<li>Underscores will be removed</li>
<li>Points will be removed</li>
<li>Em... | [
"Adds",
"or",
"fixes",
"heading",
"ids",
".",
"<p",
">",
"If",
"a",
"heading",
"has",
"an",
"id",
"it",
"will",
"be",
"corrected",
"if",
"needed",
"otherwise",
"it",
"will",
"be",
"created",
"from",
"the",
"heading",
"text",
".",
"<p",
">",
"The",
"f... | train | https://github.com/Bernardo-MG/maven-site-fixer/blob/e064472faa7edb0fca11647a22d90ad72089baa3/src/main/java/com/bernardomg/velocity/tool/SiteTool.java#L130-L151 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.updateIterationAsync | public Observable<Iteration> updateIterationAsync(UUID projectId, UUID iterationId, Iteration updatedIteration) {
"""
Update a specific iteration.
@param projectId Project id
@param iterationId Iteration id
@param updatedIteration The updated iteration model
@throws IllegalArgumentException thrown if paramet... | java | public Observable<Iteration> updateIterationAsync(UUID projectId, UUID iterationId, Iteration updatedIteration) {
return updateIterationWithServiceResponseAsync(projectId, iterationId, updatedIteration).map(new Func1<ServiceResponse<Iteration>, Iteration>() {
@Override
public Iteration c... | [
"public",
"Observable",
"<",
"Iteration",
">",
"updateIterationAsync",
"(",
"UUID",
"projectId",
",",
"UUID",
"iterationId",
",",
"Iteration",
"updatedIteration",
")",
"{",
"return",
"updateIterationWithServiceResponseAsync",
"(",
"projectId",
",",
"iterationId",
",",
... | Update a specific iteration.
@param projectId Project id
@param iterationId Iteration id
@param updatedIteration The updated iteration model
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Iteration object | [
"Update",
"a",
"specific",
"iteration",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L1819-L1826 |
jbake-org/jbake | jbake-core/src/main/java/org/jbake/app/configuration/JBakeConfigurationFactory.java | JBakeConfigurationFactory.createJettyJbakeConfiguration | public DefaultJBakeConfiguration createJettyJbakeConfiguration(File sourceFolder, File destinationFolder, boolean isClearCache) throws ConfigurationException {
"""
Creates a {@link DefaultJBakeConfiguration} with value site.host replaced
by http://localhost:[server.port].
The server.port is read from the project... | java | public DefaultJBakeConfiguration createJettyJbakeConfiguration(File sourceFolder, File destinationFolder, boolean isClearCache) throws ConfigurationException {
DefaultJBakeConfiguration configuration = (DefaultJBakeConfiguration) getConfigUtil().loadConfig(sourceFolder);
configuration.setDestinationFold... | [
"public",
"DefaultJBakeConfiguration",
"createJettyJbakeConfiguration",
"(",
"File",
"sourceFolder",
",",
"File",
"destinationFolder",
",",
"boolean",
"isClearCache",
")",
"throws",
"ConfigurationException",
"{",
"DefaultJBakeConfiguration",
"configuration",
"=",
"(",
"Defaul... | Creates a {@link DefaultJBakeConfiguration} with value site.host replaced
by http://localhost:[server.port].
The server.port is read from the project properties file.
@param sourceFolder The source folder of the project
@param destinationFolder The destination folder to render and copy files to
@param isClearCache Whe... | [
"Creates",
"a",
"{",
"@link",
"DefaultJBakeConfiguration",
"}",
"with",
"value",
"site",
".",
"host",
"replaced",
"by",
"http",
":",
"//",
"localhost",
":",
"[",
"server",
".",
"port",
"]",
".",
"The",
"server",
".",
"port",
"is",
"read",
"from",
"the",
... | train | https://github.com/jbake-org/jbake/blob/beb9042a54bf0eb168821d524c88b9ea0bee88dc/jbake-core/src/main/java/org/jbake/app/configuration/JBakeConfigurationFactory.java#L93-L99 |
fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.buildLink | private static String buildLink(final URI linkUri, final String relation) {
"""
Utility function for building a Link.
@param linkUri The URI for the link.
@param relation the relation string.
@return the string version of the link.
"""
return Link.fromUri(linkUri).rel(relation).build().toString();... | java | private static String buildLink(final URI linkUri, final String relation) {
return Link.fromUri(linkUri).rel(relation).build().toString();
} | [
"private",
"static",
"String",
"buildLink",
"(",
"final",
"URI",
"linkUri",
",",
"final",
"String",
"relation",
")",
"{",
"return",
"Link",
".",
"fromUri",
"(",
"linkUri",
")",
".",
"rel",
"(",
"relation",
")",
".",
"build",
"(",
")",
".",
"toString",
... | Utility function for building a Link.
@param linkUri The URI for the link.
@param relation the relation string.
@return the string version of the link. | [
"Utility",
"function",
"for",
"building",
"a",
"Link",
"."
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L636-L638 |
BoltsFramework/Bolts-Android | bolts-tasks/src/main/java/bolts/Task.java | Task.continueWhile | public Task<Void> continueWhile(final Callable<Boolean> predicate,
final Continuation<Void, Task<Void>> continuation, final Executor executor) {
"""
Continues a task with the equivalent of a Task-based while loop, where the body of the loop is
a task continuation.
"""
return continueWhile(predicate,... | java | public Task<Void> continueWhile(final Callable<Boolean> predicate,
final Continuation<Void, Task<Void>> continuation, final Executor executor) {
return continueWhile(predicate, continuation, executor, null);
} | [
"public",
"Task",
"<",
"Void",
">",
"continueWhile",
"(",
"final",
"Callable",
"<",
"Boolean",
">",
"predicate",
",",
"final",
"Continuation",
"<",
"Void",
",",
"Task",
"<",
"Void",
">",
">",
"continuation",
",",
"final",
"Executor",
"executor",
")",
"{",
... | Continues a task with the equivalent of a Task-based while loop, where the body of the loop is
a task continuation. | [
"Continues",
"a",
"task",
"with",
"the",
"equivalent",
"of",
"a",
"Task",
"-",
"based",
"while",
"loop",
"where",
"the",
"body",
"of",
"the",
"loop",
"is",
"a",
"task",
"continuation",
"."
] | train | https://github.com/BoltsFramework/Bolts-Android/blob/54e9cb8bdd4950aa4d418dcbc0ea65414762aef5/bolts-tasks/src/main/java/bolts/Task.java#L594-L597 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.listHybridConnectionKeys | public HybridConnectionKeyInner listHybridConnectionKeys(String resourceGroupName, String name, String namespaceName, String relayName) {
"""
Get the send key name and value of a Hybrid Connection.
Get the send key name and value of a Hybrid Connection.
@param resourceGroupName Name of the resource group to wh... | java | public HybridConnectionKeyInner listHybridConnectionKeys(String resourceGroupName, String name, String namespaceName, String relayName) {
return listHybridConnectionKeysWithServiceResponseAsync(resourceGroupName, name, namespaceName, relayName).toBlocking().single().body();
} | [
"public",
"HybridConnectionKeyInner",
"listHybridConnectionKeys",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"namespaceName",
",",
"String",
"relayName",
")",
"{",
"return",
"listHybridConnectionKeysWithServiceResponseAsync",
"(",
"resourceGroup... | Get the send key name and value of a Hybrid Connection.
Get the send key name and value of a Hybrid Connection.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@param namespaceName The name of the Service Bus namespace.
@param relayName The n... | [
"Get",
"the",
"send",
"key",
"name",
"and",
"value",
"of",
"a",
"Hybrid",
"Connection",
".",
"Get",
"the",
"send",
"key",
"name",
"and",
"value",
"of",
"a",
"Hybrid",
"Connection",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L1343-L1345 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.