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 |
|---|---|---|---|---|---|---|---|---|---|---|
Cornutum/tcases | tcases-openapi/src/main/java/org/cornutum/tcases/openapi/TcasesOpenApi.java | TcasesOpenApi.getResponseInputModel | public static SystemInputDef getResponseInputModel( OpenAPI api, ModelOptions options) {
"""
Returns a {@link SystemInputDef system input definition} for the API responses defined by the given
OpenAPI specification. Returns null if the given spec defines no API responses to model.
"""
ResponseInputModelle... | java | public static SystemInputDef getResponseInputModel( OpenAPI api, ModelOptions options)
{
ResponseInputModeller inputModeller = new ResponseInputModeller( options);
return inputModeller.getResponseInputModel( api);
} | [
"public",
"static",
"SystemInputDef",
"getResponseInputModel",
"(",
"OpenAPI",
"api",
",",
"ModelOptions",
"options",
")",
"{",
"ResponseInputModeller",
"inputModeller",
"=",
"new",
"ResponseInputModeller",
"(",
"options",
")",
";",
"return",
"inputModeller",
".",
"ge... | Returns a {@link SystemInputDef system input definition} for the API responses defined by the given
OpenAPI specification. Returns null if the given spec defines no API responses to model. | [
"Returns",
"a",
"{"
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-openapi/src/main/java/org/cornutum/tcases/openapi/TcasesOpenApi.java#L60-L64 |
alkacon/opencms-core | src/org/opencms/file/wrapper/CmsResourceWrapperXmlPage.java | CmsResourceWrapperXmlPage.getUriTemplate | protected String getUriTemplate(CmsObject cms, CmsResource res) {
"""
Returns the OpenCms VFS uri of the template of the resource.<p>
@param cms the initialized CmsObject
@param res the resource where to read the template for
@return the OpenCms VFS uri of the template of the resource
"""
Strin... | java | protected String getUriTemplate(CmsObject cms, CmsResource res) {
String result = "";
try {
result = cms.readPropertyObject(
cms.getRequestContext().removeSiteRoot(res.getRootPath()),
CmsPropertyDefinition.PROPERTY_TEMPLATE,
true).getValue("")... | [
"protected",
"String",
"getUriTemplate",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"res",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"try",
"{",
"result",
"=",
"cms",
".",
"readPropertyObject",
"(",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"... | Returns the OpenCms VFS uri of the template of the resource.<p>
@param cms the initialized CmsObject
@param res the resource where to read the template for
@return the OpenCms VFS uri of the template of the resource | [
"Returns",
"the",
"OpenCms",
"VFS",
"uri",
"of",
"the",
"template",
"of",
"the",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/wrapper/CmsResourceWrapperXmlPage.java#L865-L877 |
Wikidata/Wikidata-Toolkit | wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/WikibaseDataFetcher.java | WikibaseDataFetcher.getEntityDocumentByTitle | public EntityDocument getEntityDocumentByTitle(String siteKey, String title)
throws MediaWikiApiErrorException, IOException {
"""
Fetches the document for the entity that has a page of the given title on
the given site. Site keys should be some site identifier known to the
Wikibase site that is queried, such ... | java | public EntityDocument getEntityDocumentByTitle(String siteKey, String title)
throws MediaWikiApiErrorException, IOException {
return getEntityDocumentsByTitle(siteKey, title).get(title);
} | [
"public",
"EntityDocument",
"getEntityDocumentByTitle",
"(",
"String",
"siteKey",
",",
"String",
"title",
")",
"throws",
"MediaWikiApiErrorException",
",",
"IOException",
"{",
"return",
"getEntityDocumentsByTitle",
"(",
"siteKey",
",",
"title",
")",
".",
"get",
"(",
... | Fetches the document for the entity that has a page of the given title on
the given site. Site keys should be some site identifier known to the
Wikibase site that is queried, such as "enwiki" for Wikidata.org.
<p>
Note: This method will not work properly if a filter is set for sites
that excludes the requested site.
@... | [
"Fetches",
"the",
"document",
"for",
"the",
"entity",
"that",
"has",
"a",
"page",
"of",
"the",
"given",
"title",
"on",
"the",
"given",
"site",
".",
"Site",
"keys",
"should",
"be",
"some",
"site",
"identifier",
"known",
"to",
"the",
"Wikibase",
"site",
"t... | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/WikibaseDataFetcher.java#L211-L214 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java | TopicsInner.beginCreateOrUpdate | public TopicInner beginCreateOrUpdate(String resourceGroupName, String topicName, TopicInner topicInfo) {
"""
Create a topic.
Asynchronously creates a new topic with the specified parameters.
@param resourceGroupName The name of the resource group within the user's subscription.
@param topicName Name of the t... | java | public TopicInner beginCreateOrUpdate(String resourceGroupName, String topicName, TopicInner topicInfo) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo).toBlocking().single().body();
} | [
"public",
"TopicInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"topicName",
",",
"TopicInner",
"topicInfo",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"topicName",
",",
"topicInfo",
... | Create a topic.
Asynchronously creates a new topic with the specified parameters.
@param resourceGroupName The name of the resource group within the user's subscription.
@param topicName Name of the topic
@param topicInfo Topic information
@throws IllegalArgumentException thrown if parameters fail the validation
@thro... | [
"Create",
"a",
"topic",
".",
"Asynchronously",
"creates",
"a",
"new",
"topic",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java#L302-L304 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalCreator.java | JournalCreator.modifyDatastreamByValue | public Date modifyDatastreamByValue(Context context,
String pid,
String datastreamID,
String[] altIDs,
String dsLabel,
S... | java | public Date modifyDatastreamByValue(Context context,
String pid,
String datastreamID,
String[] altIDs,
String dsLabel,
S... | [
"public",
"Date",
"modifyDatastreamByValue",
"(",
"Context",
"context",
",",
"String",
"pid",
",",
"String",
"datastreamID",
",",
"String",
"[",
"]",
"altIDs",
",",
"String",
"dsLabel",
",",
"String",
"mimeType",
",",
"String",
"formatURI",
",",
"InputStream",
... | Create a journal entry, add the arguments, and invoke the method. | [
"Create",
"a",
"journal",
"entry",
"add",
"the",
"arguments",
"and",
"invoke",
"the",
"method",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalCreator.java#L204-L235 |
Frostman/dropbox4j | src/main/java/ru/frostman/dropbox/api/util/Multipart.java | Multipart.attachFile | public static OAuthRequest attachFile(File file, OAuthRequest request) throws IOException {
"""
Correct attaching specified file to existing request.
@param file to attach
@param request to attach at
@return request with attached file
@throws IOException iff problems with accessing file
"""
... | java | public static OAuthRequest attachFile(File file, OAuthRequest request) throws IOException {
String boundary = generateBoundaryString();
request.addHeader("Content-Type", "multipart/form-data; boundary=" + boundary);
request.addBodyParameter("file", file.getName());
StringBuilder boundar... | [
"public",
"static",
"OAuthRequest",
"attachFile",
"(",
"File",
"file",
",",
"OAuthRequest",
"request",
")",
"throws",
"IOException",
"{",
"String",
"boundary",
"=",
"generateBoundaryString",
"(",
")",
";",
"request",
".",
"addHeader",
"(",
"\"Content-Type\"",
",",... | Correct attaching specified file to existing request.
@param file to attach
@param request to attach at
@return request with attached file
@throws IOException iff problems with accessing file | [
"Correct",
"attaching",
"specified",
"file",
"to",
"existing",
"request",
"."
] | train | https://github.com/Frostman/dropbox4j/blob/774c817e5bf294d0139ecb5ac81399be50ada5e0/src/main/java/ru/frostman/dropbox/api/util/Multipart.java#L46-L69 |
jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java | MapEntryLite.parseEntry | static <K, V> Map.Entry<K, V> parseEntry(CodedInputStream input, Metadata<K, V> metadata,
ExtensionRegistryLite extensionRegistry) throws IOException {
"""
Parses the entry.
@param <K> the key type
@param <V> the value type
@param input the input
@param metadata the metadata
@param extensionRegi... | java | static <K, V> Map.Entry<K, V> parseEntry(CodedInputStream input, Metadata<K, V> metadata,
ExtensionRegistryLite extensionRegistry) throws IOException {
K key = metadata.defaultKey;
V value = metadata.defaultValue;
while (true) {
int tag = input.readTag();
if (... | [
"static",
"<",
"K",
",",
"V",
">",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
"parseEntry",
"(",
"CodedInputStream",
"input",
",",
"Metadata",
"<",
"K",
",",
"V",
">",
"metadata",
",",
"ExtensionRegistryLite",
"extensionRegistry",
")",
"throws",
"IOEx... | Parses the entry.
@param <K> the key type
@param <V> the value type
@param input the input
@param metadata the metadata
@param extensionRegistry the extension registry
@return the map. entry
@throws IOException Signals that an I/O exception has occurred. | [
"Parses",
"the",
"entry",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java#L277-L297 |
kiegroup/jbpm | jbpm-runtime-manager/src/main/java/org/jbpm/runtime/manager/impl/SimpleRuntimeEnvironment.java | SimpleRuntimeEnvironment.addToConfiguration | public void addToConfiguration(String name, String value) {
"""
Adds configuration property that will be part of <code>KieSessionConfiguration</code>
@param name name of the property
@param value value of the property
"""
if (this.sessionConfigProperties == null) {
this.sessionConfigPrope... | java | public void addToConfiguration(String name, String value) {
if (this.sessionConfigProperties == null) {
this.sessionConfigProperties = new Properties();
}
this.sessionConfigProperties.setProperty(name, value);
} | [
"public",
"void",
"addToConfiguration",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"this",
".",
"sessionConfigProperties",
"==",
"null",
")",
"{",
"this",
".",
"sessionConfigProperties",
"=",
"new",
"Properties",
"(",
")",
";",
"}",
... | Adds configuration property that will be part of <code>KieSessionConfiguration</code>
@param name name of the property
@param value value of the property | [
"Adds",
"configuration",
"property",
"that",
"will",
"be",
"part",
"of",
"<code",
">",
"KieSessionConfiguration<",
"/",
"code",
">"
] | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-runtime-manager/src/main/java/org/jbpm/runtime/manager/impl/SimpleRuntimeEnvironment.java#L193-L198 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.listPreparationAndReleaseTaskStatusNextAsync | public ServiceFuture<List<JobPreparationAndReleaseTaskExecutionInformation>> listPreparationAndReleaseTaskStatusNextAsync(final String nextPageLink, final JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions, final ServiceFuture<List<JobPreparationAndReleaseTaskExecutionIn... | java | public ServiceFuture<List<JobPreparationAndReleaseTaskExecutionInformation>> listPreparationAndReleaseTaskStatusNextAsync(final String nextPageLink, final JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions, final ServiceFuture<List<JobPreparationAndReleaseTaskExecutionIn... | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"JobPreparationAndReleaseTaskExecutionInformation",
">",
">",
"listPreparationAndReleaseTaskStatusNextAsync",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"JobListPreparationAndReleaseTaskStatusNextOptions",
"jobListPreparationAnd... | Lists the execution status of the Job Preparation and Job Release task for the specified job across the compute nodes where the job has run.
This API returns the Job Preparation and Job Release task status on all compute nodes that have run the Job Preparation or Job Release task. This includes nodes which have since b... | [
"Lists",
"the",
"execution",
"status",
"of",
"the",
"Job",
"Preparation",
"and",
"Job",
"Release",
"task",
"for",
"the",
"specified",
"job",
"across",
"the",
"compute",
"nodes",
"where",
"the",
"job",
"has",
"run",
".",
"This",
"API",
"returns",
"the",
"Jo... | 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#L3944-L3954 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.modifyAckDeadline | public PubsubFuture<Void> modifyAckDeadline(final String project, final String subscription,
final int ackDeadlineSeconds, final String... ackIds) {
"""
Modify the ack deadline for a list of received messages.
@param project The Google Cloud project.
@pa... | java | public PubsubFuture<Void> modifyAckDeadline(final String project, final String subscription,
final int ackDeadlineSeconds, final String... ackIds) {
return modifyAckDeadline(project, subscription, ackDeadlineSeconds, asList(ackIds));
} | [
"public",
"PubsubFuture",
"<",
"Void",
">",
"modifyAckDeadline",
"(",
"final",
"String",
"project",
",",
"final",
"String",
"subscription",
",",
"final",
"int",
"ackDeadlineSeconds",
",",
"final",
"String",
"...",
"ackIds",
")",
"{",
"return",
"modifyAckDeadline",... | Modify the ack deadline for a list of received messages.
@param project The Google Cloud project.
@param subscription The subscription of the received message to modify the ack deadline on.
@param ackDeadlineSeconds The new ack deadline.
@param ackIds List of message ID's to modify the ack... | [
"Modify",
"the",
"ack",
"deadline",
"for",
"a",
"list",
"of",
"received",
"messages",
"."
] | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L673-L676 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/FacetUrl.java | FacetUrl.getFacetCategoryListUrl | public static MozuUrl getFacetCategoryListUrl(Integer categoryId, Boolean includeAvailable, String responseFields, Boolean validate) {
"""
Get Resource Url for GetFacetCategoryList
@param categoryId Unique identifier of the category to modify.
@param includeAvailable If true, returns a list of the attributes and... | java | public static MozuUrl getFacetCategoryListUrl(Integer categoryId, Boolean includeAvailable, String responseFields, Boolean validate)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/facets/category/{categoryId}?includeAvailable={includeAvailable}&validate={validate}&responseFields={response... | [
"public",
"static",
"MozuUrl",
"getFacetCategoryListUrl",
"(",
"Integer",
"categoryId",
",",
"Boolean",
"includeAvailable",
",",
"String",
"responseFields",
",",
"Boolean",
"validate",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/com... | Get Resource Url for GetFacetCategoryList
@param categoryId Unique identifier of the category to modify.
@param includeAvailable If true, returns a list of the attributes and categories associated with a product type that have not been defined as a facet for the category.
@param responseFields Filtering syntax appended... | [
"Get",
"Resource",
"Url",
"for",
"GetFacetCategoryList"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/FacetUrl.java#L40-L48 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.getGetterMethod | public static Method getGetterMethod(Class<?> c, String field) {
"""
Gets getter method.
@param c the c
@param field the field
@return the getter method
"""
try {
return c.getMethod(getMethodName(field, GET_METHOD_PREFIX), EMPTY_CLASS);
} catch (NoSuchMethodException e) {
... | java | public static Method getGetterMethod(Class<?> c, String field) {
try {
return c.getMethod(getMethodName(field, GET_METHOD_PREFIX), EMPTY_CLASS);
} catch (NoSuchMethodException e) {
try {
return c.getMethod(getMethodName(field, IS_METHOD_PREFIX), EMPTY_CLASS);
... | [
"public",
"static",
"Method",
"getGetterMethod",
"(",
"Class",
"<",
"?",
">",
"c",
",",
"String",
"field",
")",
"{",
"try",
"{",
"return",
"c",
".",
"getMethod",
"(",
"getMethodName",
"(",
"field",
",",
"GET_METHOD_PREFIX",
")",
",",
"EMPTY_CLASS",
")",
... | Gets getter method.
@param c the c
@param field the field
@return the getter method | [
"Gets",
"getter",
"method",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L216-L228 |
aws/aws-sdk-java | aws-java-sdk-costexplorer/src/main/java/com/amazonaws/services/costexplorer/model/ReservationCoverageGroup.java | ReservationCoverageGroup.withAttributes | public ReservationCoverageGroup withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
The attributes for this group of reservations.
</p>
@param attributes
The attributes for this group of reservations.
@return Returns a reference to this object so that method calls can be chained together.
... | java | public ReservationCoverageGroup withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"ReservationCoverageGroup",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The attributes for this group of reservations.
</p>
@param attributes
The attributes for this group of reservations.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"attributes",
"for",
"this",
"group",
"of",
"reservations",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-costexplorer/src/main/java/com/amazonaws/services/costexplorer/model/ReservationCoverageGroup.java#L79-L82 |
stevespringett/Alpine | alpine/src/main/java/alpine/filters/FqdnForwardFilter.java | FqdnForwardFilter.doFilter | public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
throws IOException, ServletException {
"""
Forward requests.....
@param request The request object.
@param response The response object.
@param chain Refers to the {@code FilterChain} object... | java | public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
throws IOException, ServletException {
final HttpServletRequest req = (HttpServletRequest) request;
final HttpServletResponse res = (HttpServletResponse) response;
if (req.ge... | [
"public",
"void",
"doFilter",
"(",
"final",
"ServletRequest",
"request",
",",
"final",
"ServletResponse",
"response",
",",
"final",
"FilterChain",
"chain",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"final",
"HttpServletRequest",
"req",
"=",
"(",
... | Forward requests.....
@param request The request object.
@param response The response object.
@param chain Refers to the {@code FilterChain} object to pass control to the next {@code Filter}.
@throws IOException a IOException
@throws ServletException a ServletException | [
"Forward",
"requests",
"....."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/filters/FqdnForwardFilter.java#L83-L109 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/autodiff/VTensor.java | VTensor.getFast | public double getFast(int i0, int i1, int i2) {
"""
Gets the value of the entry corresponding to the given indices.
@param indices The indices of the multi-dimensional array.
@return The current value.
"""
int c = offset;
c += strides[0] * i0;
c += strides[1] * i1;
c += stride... | java | public double getFast(int i0, int i1, int i2) {
int c = offset;
c += strides[0] * i0;
c += strides[1] * i1;
c += strides[2] * i2;
return values.get(c);
} | [
"public",
"double",
"getFast",
"(",
"int",
"i0",
",",
"int",
"i1",
",",
"int",
"i2",
")",
"{",
"int",
"c",
"=",
"offset",
";",
"c",
"+=",
"strides",
"[",
"0",
"]",
"*",
"i0",
";",
"c",
"+=",
"strides",
"[",
"1",
"]",
"*",
"i1",
";",
"c",
"+... | Gets the value of the entry corresponding to the given indices.
@param indices The indices of the multi-dimensional array.
@return The current value. | [
"Gets",
"the",
"value",
"of",
"the",
"entry",
"corresponding",
"to",
"the",
"given",
"indices",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/autodiff/VTensor.java#L91-L97 |
agmip/agmip-common-functions | src/main/java/org/agmip/common/Event.java | Event.updateEvent | public void updateEvent(String key, String value) {
"""
Update the current event with given key and value, if current event not
available, add a new one into array
@param key The variable's key for a event
@param value The input value for the key
"""
updateEvent(key, value, true, true);
} | java | public void updateEvent(String key, String value) {
updateEvent(key, value, true, true);
} | [
"public",
"void",
"updateEvent",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"updateEvent",
"(",
"key",
",",
"value",
",",
"true",
",",
"true",
")",
";",
"}"
] | Update the current event with given key and value, if current event not
available, add a new one into array
@param key The variable's key for a event
@param value The input value for the key | [
"Update",
"the",
"current",
"event",
"with",
"given",
"key",
"and",
"value",
"if",
"current",
"event",
"not",
"available",
"add",
"a",
"new",
"one",
"into",
"array"
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/common/Event.java#L73-L75 |
lamydev/Android-Notification | core/src/zemin/notification/NotificationViewCallback.java | NotificationViewCallback.onShowNotification | public void onShowNotification(NotificationView view, View contentView, NotificationEntry entry, int layoutId) {
"""
Called when a notification is being displayed. This is the place to update
the user interface of child-views for the new notification.
@param view
@param contentView
@param entry
@param layou... | java | public void onShowNotification(NotificationView view, View contentView, NotificationEntry entry, int layoutId) {
if (DBG) Log.v(TAG, "onShowNotification - " + entry.ID);
final Drawable icon = entry.iconDrawable;
final CharSequence title = entry.title;
final CharSequence text = entry.tex... | [
"public",
"void",
"onShowNotification",
"(",
"NotificationView",
"view",
",",
"View",
"contentView",
",",
"NotificationEntry",
"entry",
",",
"int",
"layoutId",
")",
"{",
"if",
"(",
"DBG",
")",
"Log",
".",
"v",
"(",
"TAG",
",",
"\"onShowNotification - \"",
"+",... | Called when a notification is being displayed. This is the place to update
the user interface of child-views for the new notification.
@param view
@param contentView
@param entry
@param layoutId | [
"Called",
"when",
"a",
"notification",
"is",
"being",
"displayed",
".",
"This",
"is",
"the",
"place",
"to",
"update",
"the",
"user",
"interface",
"of",
"child",
"-",
"views",
"for",
"the",
"new",
"notification",
"."
] | train | https://github.com/lamydev/Android-Notification/blob/6d6571d2862cb6edbacf9a78125418f7d621c3f8/core/src/zemin/notification/NotificationViewCallback.java#L108-L143 |
simonpercic/CollectionHelper | collectionhelper/src/main/java/com/github/simonpercic/collectionhelper/CollectionHelper.java | CollectionHelper.firstIndexOf | public static <T> int firstIndexOf(Collection<T> items, Predicate<T> predicate) {
"""
Returns the index of the first element in a collection that matches the given predicate.
Returns {#NOT_FOUND_INDEX} if no element matches the given predicate.
@param items source items
@param predicate predicate function
@p... | java | public static <T> int firstIndexOf(Collection<T> items, Predicate<T> predicate) {
if (!isEmpty(items)) {
int index = 0;
for (T item : items) {
if (predicate.apply(item)) {
return index;
}
index++;
}
... | [
"public",
"static",
"<",
"T",
">",
"int",
"firstIndexOf",
"(",
"Collection",
"<",
"T",
">",
"items",
",",
"Predicate",
"<",
"T",
">",
"predicate",
")",
"{",
"if",
"(",
"!",
"isEmpty",
"(",
"items",
")",
")",
"{",
"int",
"index",
"=",
"0",
";",
"f... | Returns the index of the first element in a collection that matches the given predicate.
Returns {#NOT_FOUND_INDEX} if no element matches the given predicate.
@param items source items
@param predicate predicate function
@param <T> type of elements in the source collection
@return index of the first element that match... | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"element",
"in",
"a",
"collection",
"that",
"matches",
"the",
"given",
"predicate",
".",
"Returns",
"{",
"#NOT_FOUND_INDEX",
"}",
"if",
"no",
"element",
"matches",
"the",
"given",
"predicate",
"."
] | train | https://github.com/simonpercic/CollectionHelper/blob/2425390ac14f3b6c0a7b04464cf5670060f2dc54/collectionhelper/src/main/java/com/github/simonpercic/collectionhelper/CollectionHelper.java#L111-L124 |
igniterealtime/jbosh | src/main/java/org/igniterealtime/jbosh/BodyQName.java | BodyQName.createWithPrefix | public static BodyQName createWithPrefix(
final String uri,
final String local,
final String prefix) {
"""
Creates a new qualified name using a namespace URI and local name
along with an optional prefix.
@param uri namespace URI
@param local local name
@param prefix option... | java | public static BodyQName createWithPrefix(
final String uri,
final String local,
final String prefix) {
if (uri == null || uri.length() == 0) {
throw(new IllegalArgumentException(
"URI is required and may not be null/empty"));
}
... | [
"public",
"static",
"BodyQName",
"createWithPrefix",
"(",
"final",
"String",
"uri",
",",
"final",
"String",
"local",
",",
"final",
"String",
"prefix",
")",
"{",
"if",
"(",
"uri",
"==",
"null",
"||",
"uri",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
... | Creates a new qualified name using a namespace URI and local name
along with an optional prefix.
@param uri namespace URI
@param local local name
@param prefix optional prefix or @{code null} for no prefix
@return BodyQName instance | [
"Creates",
"a",
"new",
"qualified",
"name",
"using",
"a",
"namespace",
"URI",
"and",
"local",
"name",
"along",
"with",
"an",
"optional",
"prefix",
"."
] | train | https://github.com/igniterealtime/jbosh/blob/b43378f27e19b753b552b1e9666abc0476cdceff/src/main/java/org/igniterealtime/jbosh/BodyQName.java#L74-L91 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/datebox/CmsDateBox.java | CmsDateBox.fireChange | protected void fireChange(Date newValue, boolean isTyping) {
"""
Fires the value change event if needed.<p>
@param newValue the new value
@param isTyping true if the user is currently typing
"""
ValueChangeEvent.<Date> fireIfNotEqual(this, m_oldValue, CalendarUtil.copyDate(newValue));
CmsD... | java | protected void fireChange(Date newValue, boolean isTyping) {
ValueChangeEvent.<Date> fireIfNotEqual(this, m_oldValue, CalendarUtil.copyDate(newValue));
CmsDateBoxEvent.fire(this, newValue, isTyping);
m_oldValue = newValue;
} | [
"protected",
"void",
"fireChange",
"(",
"Date",
"newValue",
",",
"boolean",
"isTyping",
")",
"{",
"ValueChangeEvent",
".",
"<",
"Date",
">",
"fireIfNotEqual",
"(",
"this",
",",
"m_oldValue",
",",
"CalendarUtil",
".",
"copyDate",
"(",
"newValue",
")",
")",
";... | Fires the value change event if needed.<p>
@param newValue the new value
@param isTyping true if the user is currently typing | [
"Fires",
"the",
"value",
"change",
"event",
"if",
"needed",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/datebox/CmsDateBox.java#L681-L686 |
jinahya/bit-io | src/main/java/com/github/jinahya/bit/io/AbstractBitOutput.java | AbstractBitOutput.unsigned8 | protected void unsigned8(final int size, int value) throws IOException {
"""
Writes an unsigned value whose size is, in maximum, {@value Byte#SIZE}.
@param size the number of lower bits to write; between {@code 1} and {@value Byte#SIZE}, both inclusive.
@param value the value to write
@throws IOException if ... | java | protected void unsigned8(final int size, int value) throws IOException {
requireValidSizeUnsigned8(size);
final int required = size - available;
if (required > 0) {
unsigned8(available, value >> required);
unsigned8(required, value);
return;
}
... | [
"protected",
"void",
"unsigned8",
"(",
"final",
"int",
"size",
",",
"int",
"value",
")",
"throws",
"IOException",
"{",
"requireValidSizeUnsigned8",
"(",
"size",
")",
";",
"final",
"int",
"required",
"=",
"size",
"-",
"available",
";",
"if",
"(",
"required",
... | Writes an unsigned value whose size is, in maximum, {@value Byte#SIZE}.
@param size the number of lower bits to write; between {@code 1} and {@value Byte#SIZE}, both inclusive.
@param value the value to write
@throws IOException if an I/O error occurs. | [
"Writes",
"an",
"unsigned",
"value",
"whose",
"size",
"is",
"in",
"maximum",
"{",
"@value",
"Byte#SIZE",
"}",
"."
] | train | https://github.com/jinahya/bit-io/blob/f3b49bbec80047c0cc3ea2424def98eb2d08352a/src/main/java/com/github/jinahya/bit/io/AbstractBitOutput.java#L60-L77 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/base64/Base64.java | Base64.encodeBytesToBytes | @Nonnull
@ReturnsMutableCopy
public static byte [] encodeBytesToBytes (@Nonnull final byte [] source) {
"""
Similar to {@link #encodeBytes(byte[])} but returns a byte array instead of
instantiating a String. This is more efficient if you're working with I/O
streams and have large data sets to encode.
@par... | java | @Nonnull
@ReturnsMutableCopy
public static byte [] encodeBytesToBytes (@Nonnull final byte [] source)
{
byte [] encoded;
try
{
encoded = encodeBytesToBytes (source, 0, source.length, NO_OPTIONS);
}
catch (final IOException ex)
{
throw new IllegalStateException ("IOExceptions on... | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"byte",
"[",
"]",
"encodeBytesToBytes",
"(",
"@",
"Nonnull",
"final",
"byte",
"[",
"]",
"source",
")",
"{",
"byte",
"[",
"]",
"encoded",
";",
"try",
"{",
"encoded",
"=",
"encodeBytesToBytes",
"... | Similar to {@link #encodeBytes(byte[])} but returns a byte array instead of
instantiating a String. This is more efficient if you're working with I/O
streams and have large data sets to encode.
@param source
The data to convert
@return The Base64-encoded data as a byte[] (of ASCII characters)
@throws NullPointerExcept... | [
"Similar",
"to",
"{",
"@link",
"#encodeBytes",
"(",
"byte",
"[]",
")",
"}",
"but",
"returns",
"a",
"byte",
"array",
"instead",
"of",
"instantiating",
"a",
"String",
".",
"This",
"is",
"more",
"efficient",
"if",
"you",
"re",
"working",
"with",
"I",
"/",
... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/base64/Base64.java#L1810-L1824 |
samskivert/pythagoras | src/main/java/pythagoras/i/MathUtil.java | MathUtil.floorDiv | public static int floorDiv (int dividend, int divisor) {
"""
Computes the floored division {@code dividend/divisor} which is useful when dividing
potentially negative numbers into bins.
<p> For example, the following numbers {@code floorDiv} 10 are:
<pre>
-15 -10 -8 -2 0 2 8 10 15
-2 -1 -1 -1 0 0 0 1 1
... | java | public static int floorDiv (int dividend, int divisor) {
boolean numpos = dividend >= 0, denpos = divisor >= 0;
if (numpos == denpos) return dividend / divisor;
return denpos ? (dividend - divisor + 1) / divisor : (dividend - divisor - 1) / divisor;
} | [
"public",
"static",
"int",
"floorDiv",
"(",
"int",
"dividend",
",",
"int",
"divisor",
")",
"{",
"boolean",
"numpos",
"=",
"dividend",
">=",
"0",
",",
"denpos",
"=",
"divisor",
">=",
"0",
";",
"if",
"(",
"numpos",
"==",
"denpos",
")",
"return",
"dividen... | Computes the floored division {@code dividend/divisor} which is useful when dividing
potentially negative numbers into bins.
<p> For example, the following numbers {@code floorDiv} 10 are:
<pre>
-15 -10 -8 -2 0 2 8 10 15
-2 -1 -1 -1 0 0 0 1 1
</pre> | [
"Computes",
"the",
"floored",
"division",
"{",
"@code",
"dividend",
"/",
"divisor",
"}",
"which",
"is",
"useful",
"when",
"dividing",
"potentially",
"negative",
"numbers",
"into",
"bins",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/i/MathUtil.java#L31-L35 |
nemerosa/ontrack | ontrack-common/src/main/java/net/nemerosa/ontrack/common/Utils.java | Utils.safeRegexMatch | public static boolean safeRegexMatch(String pattern, String value) {
"""
Exception safe regex match (to protect against malformed expressions)
"""
if (StringUtils.isNotBlank(pattern)) {
if (value == null) {
return false;
} else {
try {
... | java | public static boolean safeRegexMatch(String pattern, String value) {
if (StringUtils.isNotBlank(pattern)) {
if (value == null) {
return false;
} else {
try {
return Pattern.matches(pattern, value);
} catch (PatternSyntax... | [
"public",
"static",
"boolean",
"safeRegexMatch",
"(",
"String",
"pattern",
",",
"String",
"value",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"pattern",
")",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"false",
";",
... | Exception safe regex match (to protect against malformed expressions) | [
"Exception",
"safe",
"regex",
"match",
"(",
"to",
"protect",
"against",
"malformed",
"expressions",
")"
] | train | https://github.com/nemerosa/ontrack/blob/37b0874cbf387b58aba95cd3c1bc3b15e11bc913/ontrack-common/src/main/java/net/nemerosa/ontrack/common/Utils.java#L30-L44 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Block.java | Block.createNextBlock | Block createNextBlock(@Nullable final Address to, final long version,
@Nullable TransactionOutPoint prevOut, final long time,
final byte[] pubKey, final Coin coinbaseValue,
final int height) {
"""
Returns a solved block that builds on to... | java | Block createNextBlock(@Nullable final Address to, final long version,
@Nullable TransactionOutPoint prevOut, final long time,
final byte[] pubKey, final Coin coinbaseValue,
final int height) {
Block b = new Block(params, version);
... | [
"Block",
"createNextBlock",
"(",
"@",
"Nullable",
"final",
"Address",
"to",
",",
"final",
"long",
"version",
",",
"@",
"Nullable",
"TransactionOutPoint",
"prevOut",
",",
"final",
"long",
"time",
",",
"final",
"byte",
"[",
"]",
"pubKey",
",",
"final",
"Coin",... | Returns a solved block that builds on top of this one. This exists for unit tests.
In this variant you can specify a public key (pubkey) for use in generating coinbase blocks.
@param height block height, if known, or -1 otherwise. | [
"Returns",
"a",
"solved",
"block",
"that",
"builds",
"on",
"top",
"of",
"this",
"one",
".",
"This",
"exists",
"for",
"unit",
"tests",
".",
"In",
"this",
"variant",
"you",
"can",
"specify",
"a",
"public",
"key",
"(",
"pubkey",
")",
"for",
"use",
"in",
... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Block.java#L956-L1001 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.iiop/src/com/ibm/ws/transport/iiop/internal/WSUtilImpl.java | WSUtilImpl.writeRemoteObject | @Override
public void writeRemoteObject(OutputStream out, @Sensitive Object obj) throws org.omg.CORBA.SystemException {
"""
Overridden to allow objects to be replaced prior to being written.
"""
WSUtilService service = WSUtilService.getInstance();
if (service != null) {
obj = se... | java | @Override
public void writeRemoteObject(OutputStream out, @Sensitive Object obj) throws org.omg.CORBA.SystemException {
WSUtilService service = WSUtilService.getInstance();
if (service != null) {
obj = service.replaceObject(obj);
}
super.writeRemoteObject(out, obj);
} | [
"@",
"Override",
"public",
"void",
"writeRemoteObject",
"(",
"OutputStream",
"out",
",",
"@",
"Sensitive",
"Object",
"obj",
")",
"throws",
"org",
".",
"omg",
".",
"CORBA",
".",
"SystemException",
"{",
"WSUtilService",
"service",
"=",
"WSUtilService",
".",
"get... | Overridden to allow objects to be replaced prior to being written. | [
"Overridden",
"to",
"allow",
"objects",
"to",
"be",
"replaced",
"prior",
"to",
"being",
"written",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.iiop/src/com/ibm/ws/transport/iiop/internal/WSUtilImpl.java#L55-L62 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/PathService.java | PathService.createPathInternal | protected final JimfsPath createPathInternal(@Nullable Name root, Iterable<Name> names) {
"""
Returns a path with the given root (or no root, if null) and the given names.
"""
return new JimfsPath(this, root, names);
} | java | protected final JimfsPath createPathInternal(@Nullable Name root, Iterable<Name> names) {
return new JimfsPath(this, root, names);
} | [
"protected",
"final",
"JimfsPath",
"createPathInternal",
"(",
"@",
"Nullable",
"Name",
"root",
",",
"Iterable",
"<",
"Name",
">",
"names",
")",
"{",
"return",
"new",
"JimfsPath",
"(",
"this",
",",
"root",
",",
"names",
")",
";",
"}"
] | Returns a path with the given root (or no root, if null) and the given names. | [
"Returns",
"a",
"path",
"with",
"the",
"given",
"root",
"(",
"or",
"no",
"root",
"if",
"null",
")",
"and",
"the",
"given",
"names",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/PathService.java#L176-L178 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.expectPrivate | public static synchronized <T> IExpectationSetters<T> expectPrivate(Object instance, Object... arguments)
throws Exception {
"""
Used to specify expectations on methods without specifying a method name.
Works on for example private or package private methods. PowerMock tries
to find a unique method t... | java | public static synchronized <T> IExpectationSetters<T> expectPrivate(Object instance, Object... arguments)
throws Exception {
return expectPrivate(instance, null, Whitebox.getType(instance), arguments);
} | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"IExpectationSetters",
"<",
"T",
">",
"expectPrivate",
"(",
"Object",
"instance",
",",
"Object",
"...",
"arguments",
")",
"throws",
"Exception",
"{",
"return",
"expectPrivate",
"(",
"instance",
",",
"null",
",... | Used to specify expectations on methods without specifying a method name.
Works on for example private or package private methods. PowerMock tries
to find a unique method to expect based on the argument parameters. If
PowerMock is unable to locate a unique method you need to revert to using
{@link #expectPrivate(Object... | [
"Used",
"to",
"specify",
"expectations",
"on",
"methods",
"without",
"specifying",
"a",
"method",
"name",
".",
"Works",
"on",
"for",
"example",
"private",
"or",
"package",
"private",
"methods",
".",
"PowerMock",
"tries",
"to",
"find",
"a",
"unique",
"method",
... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L1200-L1203 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/internal/provisioning/api/ExportApi.java | ExportApi.exportFileAsync | public com.squareup.okhttp.Call exportFileAsync(ExportFileData exportFileData, final ApiCallback<ExportFileResponse> callback) throws ApiException {
"""
Export users. (asynchronously)
Export the specified users with the properties you list in the **fields** parameter.
@param exportFileData Export File Data (requ... | java | public com.squareup.okhttp.Call exportFileAsync(ExportFileData exportFileData, final ApiCallback<ExportFileResponse> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (ca... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"exportFileAsync",
"(",
"ExportFileData",
"exportFileData",
",",
"final",
"ApiCallback",
"<",
"ExportFileResponse",
">",
"callback",
")",
"throws",
"ApiException",
"{",
"ProgressResponseBody",
".",
"Progr... | Export users. (asynchronously)
Export the specified users with the properties you list in the **fields** parameter.
@param exportFileData Export File Data (required)
@param callback The callback to be executed when the API call finishes
@return The request call
@throws ApiException If fail to process the API call, e.g.... | [
"Export",
"users",
".",
"(",
"asynchronously",
")",
"Export",
"the",
"specified",
"users",
"with",
"the",
"properties",
"you",
"list",
"in",
"the",
"**",
"fields",
"**",
"parameter",
"."
] | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/ExportApi.java#L156-L181 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/info/XGlobalAttributeNameMap.java | XGlobalAttributeNameMap.mapSafely | public String mapSafely(String attributeKey, XAttributeNameMap mapping) {
"""
Maps an attribute safely, using the given attribute mapping.
Safe mapping attempts to map the attribute using the given
mapping first. If this does not succeed, the standard mapping
(EN) will be used for mapping. If no mapping is avai... | java | public String mapSafely(String attributeKey, XAttributeNameMap mapping) {
String alias = null;
if(mapping != null) {
// check valid requested mapping
alias = mapping.map(attributeKey);
}
if(alias == null) {
// no match in requested mapping, try standard mapping
alias = standardMapping.map(attributeK... | [
"public",
"String",
"mapSafely",
"(",
"String",
"attributeKey",
",",
"XAttributeNameMap",
"mapping",
")",
"{",
"String",
"alias",
"=",
"null",
";",
"if",
"(",
"mapping",
"!=",
"null",
")",
"{",
"// check valid requested mapping",
"alias",
"=",
"mapping",
".",
... | Maps an attribute safely, using the given attribute mapping.
Safe mapping attempts to map the attribute using the given
mapping first. If this does not succeed, the standard mapping
(EN) will be used for mapping. If no mapping is available in
the standard mapping, the original attribute key is returned
unchanged. This ... | [
"Maps",
"an",
"attribute",
"safely",
"using",
"the",
"given",
"attribute",
"mapping",
".",
"Safe",
"mapping",
"attempts",
"to",
"map",
"the",
"attribute",
"using",
"the",
"given",
"mapping",
"first",
".",
"If",
"this",
"does",
"not",
"succeed",
"the",
"stand... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/info/XGlobalAttributeNameMap.java#L212-L227 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/SnsAPI.java | SnsAPI.jscode2session | public static Jscode2sessionResult jscode2session(String appid,String secret,String js_code) {
"""
code 换取 session_key(微信小程序)
@since 2.8.3
@param appid appid
@param secret secret
@param js_code js_code
@return result
"""
HttpUriRequest httpUriRequest = RequestBuilder.get()
.setUri(BASE_URI + "/sns/js... | java | public static Jscode2sessionResult jscode2session(String appid,String secret,String js_code){
HttpUriRequest httpUriRequest = RequestBuilder.get()
.setUri(BASE_URI + "/sns/jscode2session")
.addParameter("appid",appid)
.addParameter("secret",secret)
.addParameter("js_code",js_code)
.addParameter("grant_... | [
"public",
"static",
"Jscode2sessionResult",
"jscode2session",
"(",
"String",
"appid",
",",
"String",
"secret",
",",
"String",
"js_code",
")",
"{",
"HttpUriRequest",
"httpUriRequest",
"=",
"RequestBuilder",
".",
"get",
"(",
")",
".",
"setUri",
"(",
"BASE_URI",
"+... | code 换取 session_key(微信小程序)
@since 2.8.3
@param appid appid
@param secret secret
@param js_code js_code
@return result | [
"code",
"换取",
"session_key(微信小程序)"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/SnsAPI.java#L235-L244 |
axibase/atsd-api-java | src/main/java/com/axibase/tsd/model/data/series/Sample.java | Sample.ofTimeDouble | public static Sample ofTimeDouble(long time, double numericValue) {
"""
Creates a new {@link Sample} with time and double value specified
@param time time in milliseconds from 1970-01-01 00:00:00
@param numericValue the numeric value of the sample
@return the Sample with specified fields
"""
... | java | public static Sample ofTimeDouble(long time, double numericValue) {
return new Sample(time, null, null, null)
.setNumericValueFromDouble(numericValue);
} | [
"public",
"static",
"Sample",
"ofTimeDouble",
"(",
"long",
"time",
",",
"double",
"numericValue",
")",
"{",
"return",
"new",
"Sample",
"(",
"time",
",",
"null",
",",
"null",
",",
"null",
")",
".",
"setNumericValueFromDouble",
"(",
"numericValue",
")",
";",
... | Creates a new {@link Sample} with time and double value specified
@param time time in milliseconds from 1970-01-01 00:00:00
@param numericValue the numeric value of the sample
@return the Sample with specified fields | [
"Creates",
"a",
"new",
"{",
"@link",
"Sample",
"}",
"with",
"time",
"and",
"double",
"value",
"specified"
] | train | https://github.com/axibase/atsd-api-java/blob/63a0767d08b202dad2ebef4372ff947d6fba0246/src/main/java/com/axibase/tsd/model/data/series/Sample.java#L66-L69 |
Kurento/kurento-module-creator | src/main/java/com/github/zafarkhaja/semver/expr/ExpressionParser.java | ExpressionParser.parseVersionExpression | private Expression parseVersionExpression() {
"""
Parses the {@literal <version-expr>} non-terminal.
<pre>
{@literal
<version-expr> ::= <major> "." "*"
| <major> "." <minor> "." "*"
}
</pre>
@return the expression AST
"""
int major = intOf(consumeNextToken(NUMERIC).lexeme);
consumeNextToken(... | java | private Expression parseVersionExpression() {
int major = intOf(consumeNextToken(NUMERIC).lexeme);
consumeNextToken(DOT);
if (tokens.positiveLookahead(STAR)) {
tokens.consume();
return new And(new GreaterOrEqual(versionOf(major, 0, 0)),
new Less(versionOf(major + 1, 0, 0)));
}
... | [
"private",
"Expression",
"parseVersionExpression",
"(",
")",
"{",
"int",
"major",
"=",
"intOf",
"(",
"consumeNextToken",
"(",
"NUMERIC",
")",
".",
"lexeme",
")",
";",
"consumeNextToken",
"(",
"DOT",
")",
";",
"if",
"(",
"tokens",
".",
"positiveLookahead",
"(... | Parses the {@literal <version-expr>} non-terminal.
<pre>
{@literal
<version-expr> ::= <major> "." "*"
| <major> "." <minor> "." "*"
}
</pre>
@return the expression AST | [
"Parses",
"the",
"{",
"@literal",
"<version",
"-",
"expr",
">",
"}",
"non",
"-",
"terminal",
"."
] | train | https://github.com/Kurento/kurento-module-creator/blob/c371516c665b902b5476433496a5aefcbca86d64/src/main/java/com/github/zafarkhaja/semver/expr/ExpressionParser.java#L288-L301 |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/gateway/client/impl/ws/WebSocketCompositeHandler.java | WebSocketCompositeHandler.processTextMessage | @Override
public void processTextMessage(WebSocketChannel channel, String message) {
"""
Writes the message to the WebSocket.
@param message
String to be written
@throws Exception
if contents cannot be written successfully
"""
LOG.entering(CLASS_NAME, "send", message);
WebSocketCompo... | java | @Override
public void processTextMessage(WebSocketChannel channel, String message) {
LOG.entering(CLASS_NAME, "send", message);
WebSocketCompositeChannel parent = (WebSocketCompositeChannel)channel;
if (parent.readyState != ReadyState.OPEN) {
LOG.warning("Attempt to post message... | [
"@",
"Override",
"public",
"void",
"processTextMessage",
"(",
"WebSocketChannel",
"channel",
",",
"String",
"message",
")",
"{",
"LOG",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"send\"",
",",
"message",
")",
";",
"WebSocketCompositeChannel",
"parent",
"=",
"("... | Writes the message to the WebSocket.
@param message
String to be written
@throws Exception
if contents cannot be written successfully | [
"Writes",
"the",
"message",
"to",
"the",
"WebSocket",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/impl/ws/WebSocketCompositeHandler.java#L228-L240 |
Waikato/moa | moa/src/main/java/moa/classifiers/lazy/SAMkNN.java | SAMkNN.getCMVotes | private double [] getCMVotes(double distancesSTM[], Instances stm, double distancesLTM[], Instances ltm) {
"""
Returns the distance weighted votes for the combined memory (CM).
"""
double[] distancesCM = new double[distancesSTM.length + distancesLTM.length];
System.arraycopy(distancesSTM, 0, distancesCM, 0... | java | private double [] getCMVotes(double distancesSTM[], Instances stm, double distancesLTM[], Instances ltm){
double[] distancesCM = new double[distancesSTM.length + distancesLTM.length];
System.arraycopy(distancesSTM, 0, distancesCM, 0, distancesSTM.length);
System.arraycopy(distancesLTM, 0, distancesCM, distancesST... | [
"private",
"double",
"[",
"]",
"getCMVotes",
"(",
"double",
"distancesSTM",
"[",
"]",
",",
"Instances",
"stm",
",",
"double",
"distancesLTM",
"[",
"]",
",",
"Instances",
"ltm",
")",
"{",
"double",
"[",
"]",
"distancesCM",
"=",
"new",
"double",
"[",
"dist... | Returns the distance weighted votes for the combined memory (CM). | [
"Returns",
"the",
"distance",
"weighted",
"votes",
"for",
"the",
"combined",
"memory",
"(",
"CM",
")",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/SAMkNN.java#L397-L403 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/categories/voice.java | voice.speechRecognition | public static void speechRecognition(final Activity activity, int maxResults, String text) {
"""
Start google activity of speechRecognition (needed on
onActivityResult(int requestCode, int resultCode, Intent data) to call
getSpeechRecognitionResults() to get the results)
@param activity
- activity
@param ma... | java | public static void speechRecognition(final Activity activity, int maxResults, String text) {
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RE... | [
"public",
"static",
"void",
"speechRecognition",
"(",
"final",
"Activity",
"activity",
",",
"int",
"maxResults",
",",
"String",
"text",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"RecognizerIntent",
".",
"ACTION_RECOGNIZE_SPEECH",
")",
";",
"intent... | Start google activity of speechRecognition (needed on
onActivityResult(int requestCode, int resultCode, Intent data) to call
getSpeechRecognitionResults() to get the results)
@param activity
- activity
@param maxResults
- Max number of results that you want to get
@param text
- what will ask to user when activity star... | [
"Start",
"google",
"activity",
"of",
"speechRecognition",
"(",
"needed",
"on",
"onActivityResult",
"(",
"int",
"requestCode",
"int",
"resultCode",
"Intent",
"data",
")",
"to",
"call",
"getSpeechRecognitionResults",
"()",
"to",
"get",
"the",
"results",
")"
] | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/voice.java#L26-L33 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/RedisClient.java | RedisClient.connectSentinel | public <K, V> StatefulRedisSentinelConnection<K, V> connectSentinel(RedisCodec<K, V> codec) {
"""
Open a connection to a Redis Sentinel that treats keys and use the supplied {@link RedisCodec codec} to encode/decode
keys and values. The client {@link RedisURI} must contain one or more sentinels.
@param codec U... | java | public <K, V> StatefulRedisSentinelConnection<K, V> connectSentinel(RedisCodec<K, V> codec) {
checkForRedisURI();
return getConnection(connectSentinelAsync(codec, redisURI, timeout));
} | [
"public",
"<",
"K",
",",
"V",
">",
"StatefulRedisSentinelConnection",
"<",
"K",
",",
"V",
">",
"connectSentinel",
"(",
"RedisCodec",
"<",
"K",
",",
"V",
">",
"codec",
")",
"{",
"checkForRedisURI",
"(",
")",
";",
"return",
"getConnection",
"(",
"connectSent... | Open a connection to a Redis Sentinel that treats keys and use the supplied {@link RedisCodec codec} to encode/decode
keys and values. The client {@link RedisURI} must contain one or more sentinels.
@param codec Use this codec to encode/decode keys and values, must not be {@literal null}
@param <K> Key type
@param <V>... | [
"Open",
"a",
"connection",
"to",
"a",
"Redis",
"Sentinel",
"that",
"treats",
"keys",
"and",
"use",
"the",
"supplied",
"{",
"@link",
"RedisCodec",
"codec",
"}",
"to",
"encode",
"/",
"decode",
"keys",
"and",
"values",
".",
"The",
"client",
"{",
"@link",
"R... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/RedisClient.java#L464-L467 |
bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java | LocationUtil.getClusterForLocation | public static String getClusterForLocation(URI location) {
"""
Returns the EmoDB cluster name associated with the given location.
"""
Matcher matcher = getLocatorMatcher(location);
checkArgument(matcher.matches(), "Invalid location: %s", location);
final String clusterPrefix;
... | java | public static String getClusterForLocation(URI location) {
Matcher matcher = getLocatorMatcher(location);
checkArgument(matcher.matches(), "Invalid location: %s", location);
final String clusterPrefix;
if (matcher.group("universe") != null) {
clusterPrefix = matcher.group("... | [
"public",
"static",
"String",
"getClusterForLocation",
"(",
"URI",
"location",
")",
"{",
"Matcher",
"matcher",
"=",
"getLocatorMatcher",
"(",
"location",
")",
";",
"checkArgument",
"(",
"matcher",
".",
"matches",
"(",
")",
",",
"\"Invalid location: %s\"",
",",
"... | Returns the EmoDB cluster name associated with the given location. | [
"Returns",
"the",
"EmoDB",
"cluster",
"name",
"associated",
"with",
"the",
"given",
"location",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java#L244-L258 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/MultiMap.java | MultiMap.putValues | public Object putValues(Object name, String[] values) {
"""
Put multi valued entry.
@param name The entry key.
@param values The String array of multiple values.
@return The previous value or null.
"""
Object list=null;
for (int i=0;i<values.length;i++)
list=LazyList.add(list,val... | java | public Object putValues(Object name, String[] values)
{
Object list=null;
for (int i=0;i<values.length;i++)
list=LazyList.add(list,values[i]);
return put(name,list);
} | [
"public",
"Object",
"putValues",
"(",
"Object",
"name",
",",
"String",
"[",
"]",
"values",
")",
"{",
"Object",
"list",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"values",
".",
"length",
";",
"i",
"++",
")",
"list",
"=",
... | Put multi valued entry.
@param name The entry key.
@param values The String array of multiple values.
@return The previous value or null. | [
"Put",
"multi",
"valued",
"entry",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/MultiMap.java#L167-L173 |
alipay/sofa-rpc | extension-impl/extension-common/src/main/java/com/alipay/sofa/rpc/bootstrap/DefaultProviderBootstrap.java | DefaultProviderBootstrap.inList | protected boolean inList(String includeMethods, String excludeMethods, String methodName) {
"""
接口可以按方法发布,不在黑名单里且在白名单里,*算在白名单
@param includeMethods 包含的方法列表
@param excludeMethods 不包含的方法列表
@param methodName 方法名
@return 方法
"""
//判断是否在白名单中
if (!StringUtils.ALL.equals(includeMethods)) {
... | java | protected boolean inList(String includeMethods, String excludeMethods, String methodName) {
//判断是否在白名单中
if (!StringUtils.ALL.equals(includeMethods)) {
if (!inMethodConfigs(includeMethods, methodName)) {
return false;
}
}
//判断是否在黑白单中
if (inM... | [
"protected",
"boolean",
"inList",
"(",
"String",
"includeMethods",
",",
"String",
"excludeMethods",
",",
"String",
"methodName",
")",
"{",
"//判断是否在白名单中",
"if",
"(",
"!",
"StringUtils",
".",
"ALL",
".",
"equals",
"(",
"includeMethods",
")",
")",
"{",
"if",
"(... | 接口可以按方法发布,不在黑名单里且在白名单里,*算在白名单
@param includeMethods 包含的方法列表
@param excludeMethods 不包含的方法列表
@param methodName 方法名
@return 方法 | [
"接口可以按方法发布",
"不在黑名单里且在白名单里",
"*",
"算在白名单"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/extension-common/src/main/java/com/alipay/sofa/rpc/bootstrap/DefaultProviderBootstrap.java#L452-L466 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ObjectUtil.java | ObjectUtil.defaultIfNull | public static <T> T defaultIfNull(final T object, final T defaultValue) {
"""
如果给定对象为{@code null}返回默认值
<pre>
ObjectUtil.defaultIfNull(null, null) = null
ObjectUtil.defaultIfNull(null, "") = ""
ObjectUtil.defaultIfNull(null, "zz") = "zz"
ObjectUtil.defaultIfNull("abc", *) = "abc"
Obj... | java | public static <T> T defaultIfNull(final T object, final T defaultValue) {
return (null != object) ? object : defaultValue;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"defaultIfNull",
"(",
"final",
"T",
"object",
",",
"final",
"T",
"defaultValue",
")",
"{",
"return",
"(",
"null",
"!=",
"object",
")",
"?",
"object",
":",
"defaultValue",
";",
"}"
] | 如果给定对象为{@code null}返回默认值
<pre>
ObjectUtil.defaultIfNull(null, null) = null
ObjectUtil.defaultIfNull(null, "") = ""
ObjectUtil.defaultIfNull(null, "zz") = "zz"
ObjectUtil.defaultIfNull("abc", *) = "abc"
ObjectUtil.defaultIfNull(Boolean.TRUE, *) = Boolean.TRUE
</pre>
@param <T> 对象类型
@param objec... | [
"如果给定对象为",
"{",
"@code",
"null",
"}",
"返回默认值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ObjectUtil.java#L274-L276 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java | GVRSceneObject.expandBoundingVolume | public final BoundingVolume expandBoundingVolume(final Vector3f center, final float radius) {
"""
Expand the volume by the incoming center and radius
@param center new center
@param radius new radius
@return the updated BoundingVolume.
"""
return expandBoundingVolume(center.x, center.y, center.z, ra... | java | public final BoundingVolume expandBoundingVolume(final Vector3f center, final float radius) {
return expandBoundingVolume(center.x, center.y, center.z, radius);
} | [
"public",
"final",
"BoundingVolume",
"expandBoundingVolume",
"(",
"final",
"Vector3f",
"center",
",",
"final",
"float",
"radius",
")",
"{",
"return",
"expandBoundingVolume",
"(",
"center",
".",
"x",
",",
"center",
".",
"y",
",",
"center",
".",
"z",
",",
"rad... | Expand the volume by the incoming center and radius
@param center new center
@param radius new radius
@return the updated BoundingVolume. | [
"Expand",
"the",
"volume",
"by",
"the",
"incoming",
"center",
"and",
"radius"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L1297-L1299 |
ikew0ng/SwipeBackLayout | library/src/main/java/me/imid/swipebacklayout/lib/SwipeBackLayout.java | SwipeBackLayout.setShadow | public void setShadow(Drawable shadow, int edgeFlag) {
"""
Set a drawable used for edge shadow.
@param shadow Drawable to use
@param edgeFlags Combination of edge flags describing the edge to set
@see #EDGE_LEFT
@see #EDGE_RIGHT
@see #EDGE_BOTTOM
"""
if ((edgeFlag & EDGE_LEFT) != 0) {
... | java | public void setShadow(Drawable shadow, int edgeFlag) {
if ((edgeFlag & EDGE_LEFT) != 0) {
mShadowLeft = shadow;
} else if ((edgeFlag & EDGE_RIGHT) != 0) {
mShadowRight = shadow;
} else if ((edgeFlag & EDGE_BOTTOM) != 0) {
mShadowBottom = shadow;
... | [
"public",
"void",
"setShadow",
"(",
"Drawable",
"shadow",
",",
"int",
"edgeFlag",
")",
"{",
"if",
"(",
"(",
"edgeFlag",
"&",
"EDGE_LEFT",
")",
"!=",
"0",
")",
"{",
"mShadowLeft",
"=",
"shadow",
";",
"}",
"else",
"if",
"(",
"(",
"edgeFlag",
"&",
"EDGE... | Set a drawable used for edge shadow.
@param shadow Drawable to use
@param edgeFlags Combination of edge flags describing the edge to set
@see #EDGE_LEFT
@see #EDGE_RIGHT
@see #EDGE_BOTTOM | [
"Set",
"a",
"drawable",
"used",
"for",
"edge",
"shadow",
"."
] | train | https://github.com/ikew0ng/SwipeBackLayout/blob/7c6b0ac424813266cec57db86d65a7c9d9ff5fa6/library/src/main/java/me/imid/swipebacklayout/lib/SwipeBackLayout.java#L318-L327 |
ltearno/hexa.tools | hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/Properties.java | Properties.setValue | public static boolean setValue( Object object, String propertyName, Object value ) {
"""
Sets a value on an object's property
@param object the object on which the property is set
@param propertyName the name of the property value to be set
@param value the new value of the property
"""
return propertyV... | java | public static boolean setValue( Object object, String propertyName, Object value )
{
return propertyValues.setValue(object, propertyName, value);
} | [
"public",
"static",
"boolean",
"setValue",
"(",
"Object",
"object",
",",
"String",
"propertyName",
",",
"Object",
"value",
")",
"{",
"return",
"propertyValues",
".",
"setValue",
"(",
"object",
",",
"propertyName",
",",
"value",
")",
";",
"}"
] | Sets a value on an object's property
@param object the object on which the property is set
@param propertyName the name of the property value to be set
@param value the new value of the property | [
"Sets",
"a",
"value",
"on",
"an",
"object",
"s",
"property"
] | train | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/Properties.java#L52-L55 |
Commonjava/webdav-handler | common/src/main/java/net/sf/webdav/util/XMLWriter.java | XMLWriter.writeProperty | public void writeProperty(String name, String value) {
"""
Write property to the XML.
@param name
Property name
@param value
Property value
"""
writeElement(name, OPENING);
_buffer.append(value);
writeElement(name, CLOSING);
} | java | public void writeProperty(String name, String value) {
writeElement(name, OPENING);
_buffer.append(value);
writeElement(name, CLOSING);
} | [
"public",
"void",
"writeProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"writeElement",
"(",
"name",
",",
"OPENING",
")",
";",
"_buffer",
".",
"append",
"(",
"value",
")",
";",
"writeElement",
"(",
"name",
",",
"CLOSING",
")",
";",
... | Write property to the XML.
@param name
Property name
@param value
Property value | [
"Write",
"property",
"to",
"the",
"XML",
"."
] | train | https://github.com/Commonjava/webdav-handler/blob/39bb7032fc75c1b67d3f2440dd1c234ead96cb9d/common/src/main/java/net/sf/webdav/util/XMLWriter.java#L106-L110 |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialToast.java | MaterialToast.fireToast | public static void fireToast(String msg, int lifeMillis, String className) {
"""
Quick fire your toast.
@param msg Message text for your toast.
@param lifeMillis how long it should present itself before being removed.
If value is less than 0 - then it will be treated as unlimited duration
@param class... | java | public static void fireToast(String msg, int lifeMillis, String className) {
new MaterialToast().toast(msg, lifeMillis, className);
} | [
"public",
"static",
"void",
"fireToast",
"(",
"String",
"msg",
",",
"int",
"lifeMillis",
",",
"String",
"className",
")",
"{",
"new",
"MaterialToast",
"(",
")",
".",
"toast",
"(",
"msg",
",",
"lifeMillis",
",",
"className",
")",
";",
"}"
] | Quick fire your toast.
@param msg Message text for your toast.
@param lifeMillis how long it should present itself before being removed.
If value is less than 0 - then it will be treated as unlimited duration
@param className class name to custom style your toast. | [
"Quick",
"fire",
"your",
"toast",
"."
] | train | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialToast.java#L102-L104 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/implementation/MethodDelegation.java | MethodDelegation.toField | public static MethodDelegation toField(String name, MethodGraph.Compiler methodGraphCompiler) {
"""
Delegates any intercepted method to invoke a non-{@code static} method on the instance of the supplied field. To be
considered a valid delegation target, a method must be visible and accessible to the instrumented ... | java | public static MethodDelegation toField(String name, MethodGraph.Compiler methodGraphCompiler) {
return withDefaultConfiguration().toField(name, methodGraphCompiler);
} | [
"public",
"static",
"MethodDelegation",
"toField",
"(",
"String",
"name",
",",
"MethodGraph",
".",
"Compiler",
"methodGraphCompiler",
")",
"{",
"return",
"withDefaultConfiguration",
"(",
")",
".",
"toField",
"(",
"name",
",",
"methodGraphCompiler",
")",
";",
"}"
] | Delegates any intercepted method to invoke a non-{@code static} method on the instance of the supplied field. To be
considered a valid delegation target, a method must be visible and accessible to the instrumented type. This is the
case if the method's declaring type is either public or in the same package as the instr... | [
"Delegates",
"any",
"intercepted",
"method",
"to",
"invoke",
"a",
"non",
"-",
"{",
"@code",
"static",
"}",
"method",
"on",
"the",
"instance",
"of",
"the",
"supplied",
"field",
".",
"To",
"be",
"considered",
"a",
"valid",
"delegation",
"target",
"a",
"metho... | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/MethodDelegation.java#L480-L482 |
alkacon/opencms-core | src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java | CmsXMLSearchConfigurationParser.parseFacetQueryItem | private I_CmsFacetQueryItem parseFacetQueryItem(final String prefix) {
"""
Parses a single query facet item with query and label.
@param prefix path to the query facet item (with trailing '/').
@return the query facet item.
"""
I_CmsXmlContentValue query = m_xml.getValue(prefix + XML_ELEMENT_QUERY_F... | java | private I_CmsFacetQueryItem parseFacetQueryItem(final String prefix) {
I_CmsXmlContentValue query = m_xml.getValue(prefix + XML_ELEMENT_QUERY_FACET_QUERY_QUERY, m_locale);
if (null != query) {
String queryString = query.getStringValue(null);
I_CmsXmlContentValue label = m_xml.ge... | [
"private",
"I_CmsFacetQueryItem",
"parseFacetQueryItem",
"(",
"final",
"String",
"prefix",
")",
"{",
"I_CmsXmlContentValue",
"query",
"=",
"m_xml",
".",
"getValue",
"(",
"prefix",
"+",
"XML_ELEMENT_QUERY_FACET_QUERY_QUERY",
",",
"m_locale",
")",
";",
"if",
"(",
"nul... | Parses a single query facet item with query and label.
@param prefix path to the query facet item (with trailing '/').
@return the query facet item. | [
"Parses",
"a",
"single",
"query",
"facet",
"item",
"with",
"query",
"and",
"label",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java#L824-L835 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java | JedisUtils.newJedisCluster | public static JedisCluster newJedisCluster(JedisPoolConfig poolConfig, String hostsAndPorts) {
"""
Create a new {@link JedisCluster} with specified pool configs.
@param poolConfig
@param hostsAndPorts
format {@code host1:port1,host2:port2,...}, default Redis port is used if not
specified
@return
"""
... | java | public static JedisCluster newJedisCluster(JedisPoolConfig poolConfig, String hostsAndPorts) {
return newJedisCluster(poolConfig, hostsAndPorts, null, Protocol.DEFAULT_TIMEOUT, 3);
} | [
"public",
"static",
"JedisCluster",
"newJedisCluster",
"(",
"JedisPoolConfig",
"poolConfig",
",",
"String",
"hostsAndPorts",
")",
"{",
"return",
"newJedisCluster",
"(",
"poolConfig",
",",
"hostsAndPorts",
",",
"null",
",",
"Protocol",
".",
"DEFAULT_TIMEOUT",
",",
"3... | Create a new {@link JedisCluster} with specified pool configs.
@param poolConfig
@param hostsAndPorts
format {@code host1:port1,host2:port2,...}, default Redis port is used if not
specified
@return | [
"Create",
"a",
"new",
"{",
"@link",
"JedisCluster",
"}",
"with",
"specified",
"pool",
"configs",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java#L212-L214 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/util/StringUtil.java | StringUtil.secureStringEquals | public static boolean secureStringEquals(String a, String b) {
"""
When you're comparing two strings for equality and one of them is a value that could be
provided by an attacker and the other is a value that the attacker shouldn't know, use
this function to check for equality. Using regular {@code String.equal... | java | public static boolean secureStringEquals(String a, String b)
{
if (a.length() != b.length()) return false;
// Prevent timing attacks by making sure the running time of this loop doesn't
// depend on the contents of the two strings.
int result = 0;
for (int i = 0; i < a.lengt... | [
"public",
"static",
"boolean",
"secureStringEquals",
"(",
"String",
"a",
",",
"String",
"b",
")",
"{",
"if",
"(",
"a",
".",
"length",
"(",
")",
"!=",
"b",
".",
"length",
"(",
")",
")",
"return",
"false",
";",
"// Prevent timing attacks by making sure the run... | When you're comparing two strings for equality and one of them is a value that could be
provided by an attacker and the other is a value that the attacker shouldn't know, use
this function to check for equality. Using regular {@code String.equals} is not
secure. | [
"When",
"you",
"re",
"comparing",
"two",
"strings",
"for",
"equality",
"and",
"one",
"of",
"them",
"is",
"a",
"value",
"that",
"could",
"be",
"provided",
"by",
"an",
"attacker",
"and",
"the",
"other",
"is",
"a",
"value",
"that",
"the",
"attacker",
"shoul... | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/util/StringUtil.java#L122-L135 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/script/Script.java | Script.createEmptyInputScript | public Script createEmptyInputScript(@Nullable ECKey key, @Nullable Script redeemScript) {
"""
Creates an incomplete scriptSig that, once filled with signatures, can redeem output containing this scriptPubKey.
Instead of the signatures resulting script has OP_0.
Having incomplete input script allows to pass arou... | java | public Script createEmptyInputScript(@Nullable ECKey key, @Nullable Script redeemScript) {
if (ScriptPattern.isP2PKH(this)) {
checkArgument(key != null, "Key required to create P2PKH input script");
return ScriptBuilder.createInputScript(null, key);
} else if (ScriptPattern.isP2W... | [
"public",
"Script",
"createEmptyInputScript",
"(",
"@",
"Nullable",
"ECKey",
"key",
",",
"@",
"Nullable",
"Script",
"redeemScript",
")",
"{",
"if",
"(",
"ScriptPattern",
".",
"isP2PKH",
"(",
"this",
")",
")",
"{",
"checkArgument",
"(",
"key",
"!=",
"null",
... | Creates an incomplete scriptSig that, once filled with signatures, can redeem output containing this scriptPubKey.
Instead of the signatures resulting script has OP_0.
Having incomplete input script allows to pass around partially signed tx.
It is expected that this program later on will be updated with proper signatur... | [
"Creates",
"an",
"incomplete",
"scriptSig",
"that",
"once",
"filled",
"with",
"signatures",
"can",
"redeem",
"output",
"containing",
"this",
"scriptPubKey",
".",
"Instead",
"of",
"the",
"signatures",
"resulting",
"script",
"has",
"OP_0",
".",
"Having",
"incomplete... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/script/Script.java#L388-L402 |
redkale/redkale | src/org/redkale/util/ResourceFactory.java | ResourceFactory.register | public <A> A register(final String name, final Class<? extends A> clazz, final A rs) {
"""
将对象以指定资源名和类型注入到资源池中,并同步已被注入的资源
@param <A> 泛型
@param name 资源名
@param clazz 资源类型
@param rs 资源对象
@return 旧资源对象
"""
return register(true, name, clazz, rs);
} | java | public <A> A register(final String name, final Class<? extends A> clazz, final A rs) {
return register(true, name, clazz, rs);
} | [
"public",
"<",
"A",
">",
"A",
"register",
"(",
"final",
"String",
"name",
",",
"final",
"Class",
"<",
"?",
"extends",
"A",
">",
"clazz",
",",
"final",
"A",
"rs",
")",
"{",
"return",
"register",
"(",
"true",
",",
"name",
",",
"clazz",
",",
"rs",
"... | 将对象以指定资源名和类型注入到资源池中,并同步已被注入的资源
@param <A> 泛型
@param name 资源名
@param clazz 资源类型
@param rs 资源对象
@return 旧资源对象 | [
"将对象以指定资源名和类型注入到资源池中,并同步已被注入的资源"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/ResourceFactory.java#L372-L374 |
timewalker74/ffmq | core/src/main/java/net/timewalker/ffmq4/local/session/LocalMessageProducer.java | LocalMessageProducer.sendToDestination | @Override
protected final void sendToDestination(Destination destination, boolean destinationOverride, Message srcMessage, int deliveryMode, int priority, long timeToLive) throws JMSException {
"""
/* (non-Javadoc)
@see net.timewalker.ffmq4.common.session.AbstractMessageProducer#sendToDestination(javax.jms.Desti... | java | @Override
protected final void sendToDestination(Destination destination, boolean destinationOverride, Message srcMessage, int deliveryMode, int priority, long timeToLive) throws JMSException
{
// Check that the destination was specified
if (destination == null)
throw new InvalidDestina... | [
"@",
"Override",
"protected",
"final",
"void",
"sendToDestination",
"(",
"Destination",
"destination",
",",
"boolean",
"destinationOverride",
",",
"Message",
"srcMessage",
",",
"int",
"deliveryMode",
",",
"int",
"priority",
",",
"long",
"timeToLive",
")",
"throws",
... | /* (non-Javadoc)
@see net.timewalker.ffmq4.common.session.AbstractMessageProducer#sendToDestination(javax.jms.Destination, boolean, javax.jms.Message, int, int, long) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/timewalker74/ffmq/blob/638773ee29a4a5f9c6119ed74ad14ac9c46382b3/core/src/main/java/net/timewalker/ffmq4/local/session/LocalMessageProducer.java#L90-L112 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/seg/NShort/NShortSegment.java | NShortSegment.biSegment | public List<List<Vertex>> biSegment(char[] sSentence, int nKind, WordNet wordNetOptimum, WordNet wordNetAll) {
"""
二元语言模型分词
@param sSentence 待分词的句子
@param nKind 需要几个结果
@param wordNetOptimum
@param wordNetAll
@return 一系列粗分结果
"""
List<List<Vertex>> coarseResult = new LinkedList<List<Vertex>>();
... | java | public List<List<Vertex>> biSegment(char[] sSentence, int nKind, WordNet wordNetOptimum, WordNet wordNetAll)
{
List<List<Vertex>> coarseResult = new LinkedList<List<Vertex>>();
////////////////生成词网////////////////////
generateWordNet(wordNetAll);
// logger.trace("词网大小:" + wordNetAll.s... | [
"public",
"List",
"<",
"List",
"<",
"Vertex",
">",
">",
"biSegment",
"(",
"char",
"[",
"]",
"sSentence",
",",
"int",
"nKind",
",",
"WordNet",
"wordNetOptimum",
",",
"WordNet",
"wordNetAll",
")",
"{",
"List",
"<",
"List",
"<",
"Vertex",
">>",
"coarseResul... | 二元语言模型分词
@param sSentence 待分词的句子
@param nKind 需要几个结果
@param wordNetOptimum
@param wordNetAll
@return 一系列粗分结果 | [
"二元语言模型分词"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/NShort/NShortSegment.java#L136-L170 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java | VersionsImpl.importMethodAsync | public Observable<String> importMethodAsync(UUID appId, LuisApp luisApp, ImportMethodVersionsOptionalParameter importMethodOptionalParameter) {
"""
Imports a new version into a LUIS application.
@param appId The application ID.
@param luisApp A LUIS application structure.
@param importMethodOptionalParameter ... | java | public Observable<String> importMethodAsync(UUID appId, LuisApp luisApp, ImportMethodVersionsOptionalParameter importMethodOptionalParameter) {
return importMethodWithServiceResponseAsync(appId, luisApp, importMethodOptionalParameter).map(new Func1<ServiceResponse<String>, String>() {
@Override
... | [
"public",
"Observable",
"<",
"String",
">",
"importMethodAsync",
"(",
"UUID",
"appId",
",",
"LuisApp",
"luisApp",
",",
"ImportMethodVersionsOptionalParameter",
"importMethodOptionalParameter",
")",
"{",
"return",
"importMethodWithServiceResponseAsync",
"(",
"appId",
",",
... | Imports a new version into a LUIS application.
@param appId The application ID.
@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 parameters fail the validation
@... | [
"Imports",
"a",
"new",
"version",
"into",
"a",
"LUIS",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java#L901-L908 |
hudson3-plugins/warnings-plugin | src/main/java/hudson/plugins/warnings/WarningsDescriptor.java | WarningsDescriptor.getDynamic | public Object getDynamic(final String link, final StaplerRequest request, final StaplerResponse response) {
"""
Returns the graph configuration screen.
@param link
the link to check
@param request
stapler request
@param response
stapler response
@return the graph configuration or <code>null</code>
"""... | java | public Object getDynamic(final String link, final StaplerRequest request, final StaplerResponse response) {
if ("configureDefaults".equals(link)) {
Ancestor ancestor = request.findAncestor(AbstractProject.class);
if (ancestor.getObject() instanceof AbstractProject) {
Abst... | [
"public",
"Object",
"getDynamic",
"(",
"final",
"String",
"link",
",",
"final",
"StaplerRequest",
"request",
",",
"final",
"StaplerResponse",
"response",
")",
"{",
"if",
"(",
"\"configureDefaults\"",
".",
"equals",
"(",
"link",
")",
")",
"{",
"Ancestor",
"ance... | Returns the graph configuration screen.
@param link
the link to check
@param request
stapler request
@param response
stapler response
@return the graph configuration or <code>null</code> | [
"Returns",
"the",
"graph",
"configuration",
"screen",
"."
] | train | https://github.com/hudson3-plugins/warnings-plugin/blob/462c9f3dffede9120173935567392b22520b0966/src/main/java/hudson/plugins/warnings/WarningsDescriptor.java#L89-L101 |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/HTTPUtilities.java | HTTPUtilities.writeOutContent | public static void writeOutContent(final byte[] data, final String filename, final String mime) {
"""
Used to send arbitrary data to the user (i.e. to download files)
@param data The contents of the file
@param filename The name of the file to send to the browser
@param mime The MIME type of the file
... | java | public static void writeOutContent(final byte[] data, final String filename, final String mime) {
writeOutContent(data, filename, mime, true);
} | [
"public",
"static",
"void",
"writeOutContent",
"(",
"final",
"byte",
"[",
"]",
"data",
",",
"final",
"String",
"filename",
",",
"final",
"String",
"mime",
")",
"{",
"writeOutContent",
"(",
"data",
",",
"filename",
",",
"mime",
",",
"true",
")",
";",
"}"
... | Used to send arbitrary data to the user (i.e. to download files)
@param data The contents of the file
@param filename The name of the file to send to the browser
@param mime The MIME type of the file | [
"Used",
"to",
"send",
"arbitrary",
"data",
"to",
"the",
"user",
"(",
"i",
".",
"e",
".",
"to",
"download",
"files",
")"
] | train | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/HTTPUtilities.java#L50-L52 |
TheHortonMachine/hortonmachine | modules/src/main/java/org/hortonmachine/modules/Raster.java | Raster.valueAt | public double valueAt( int col, int row ) {
"""
Get the raster value at a given col/row.
@param col
@param row
@return the value.
"""
if (isInRaster(col, row)) {
double value = iter.getSampleDouble(col, row, 0);
return value;
}
return HMConstants.doubleNoval... | java | public double valueAt( int col, int row ) {
if (isInRaster(col, row)) {
double value = iter.getSampleDouble(col, row, 0);
return value;
}
return HMConstants.doubleNovalue;
} | [
"public",
"double",
"valueAt",
"(",
"int",
"col",
",",
"int",
"row",
")",
"{",
"if",
"(",
"isInRaster",
"(",
"col",
",",
"row",
")",
")",
"{",
"double",
"value",
"=",
"iter",
".",
"getSampleDouble",
"(",
"col",
",",
"row",
",",
"0",
")",
";",
"re... | Get the raster value at a given col/row.
@param col
@param row
@return the value. | [
"Get",
"the",
"raster",
"value",
"at",
"a",
"given",
"col",
"/",
"row",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/modules/src/main/java/org/hortonmachine/modules/Raster.java#L235-L241 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/TimeField.java | TimeField.setDateTime | public int setDateTime(java.util.Date date, boolean bDisplayOption, int moveMode) {
"""
Change the date and time of day.
@param date The date to set (only time portion is used).
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (or NORMAL_RETURN).
... | java | public int setDateTime(java.util.Date date, boolean bDisplayOption, int moveMode)
{
if (date != null)
{
m_calendar.setTime(date);
m_calendar.set(Calendar.YEAR, DBConstants.FIRST_YEAR);
m_calendar.set(Calendar.MONTH, Calendar.JANUARY);
m_calendar.set(Ca... | [
"public",
"int",
"setDateTime",
"(",
"java",
".",
"util",
".",
"Date",
"date",
",",
"boolean",
"bDisplayOption",
",",
"int",
"moveMode",
")",
"{",
"if",
"(",
"date",
"!=",
"null",
")",
"{",
"m_calendar",
".",
"setTime",
"(",
"date",
")",
";",
"m_calend... | Change the date and time of day.
@param date The date to set (only time portion is used).
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (or NORMAL_RETURN). | [
"Change",
"the",
"date",
"and",
"time",
"of",
"day",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/TimeField.java#L132-L145 |
glyptodon/guacamole-client | guacamole/src/main/java/org/apache/guacamole/tunnel/TunnelRequestService.java | TunnelRequestService.createTunnel | public GuacamoleTunnel createTunnel(TunnelRequest request)
throws GuacamoleException {
"""
Creates a new tunnel using the parameters and credentials present in
the given request.
@param request
The request describing the tunnel to create.
@return
The created tunnel, or null if the tunnel could... | java | public GuacamoleTunnel createTunnel(TunnelRequest request)
throws GuacamoleException {
// Parse request parameters
String authToken = request.getAuthenticationToken();
String id = request.getIdentifier();
TunnelRequest.Type type =... | [
"public",
"GuacamoleTunnel",
"createTunnel",
"(",
"TunnelRequest",
"request",
")",
"throws",
"GuacamoleException",
"{",
"// Parse request parameters",
"String",
"authToken",
"=",
"request",
".",
"getAuthenticationToken",
"(",
")",
";",
"String",
"id",
"=",
"request",
... | Creates a new tunnel using the parameters and credentials present in
the given request.
@param request
The request describing the tunnel to create.
@return
The created tunnel, or null if the tunnel could not be created.
@throws GuacamoleException
If an error occurs while creating the tunnel. | [
"Creates",
"a",
"new",
"tunnel",
"using",
"the",
"parameters",
"and",
"credentials",
"present",
"in",
"the",
"given",
"request",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/tunnel/TunnelRequestService.java#L382-L422 |
b3log/latke | latke-core/src/main/java/org/json/JSONObject.java | JSONObject.optDouble | public double optDouble(String key, double defaultValue) {
"""
Get an optional double associated with a key, or the defaultValue if
there is no such key or if its value is not a number. If the value is a
string, an attempt will be made to evaluate it as a number.
@param key
A key string.
@param defaultValue... | java | public double optDouble(String key, double defaultValue) {
Number val = this.optNumber(key);
if (val == null) {
return defaultValue;
}
final double doubleValue = val.doubleValue();
// if (Double.isNaN(doubleValue) || Double.isInfinite(doubleValue)) {
// return... | [
"public",
"double",
"optDouble",
"(",
"String",
"key",
",",
"double",
"defaultValue",
")",
"{",
"Number",
"val",
"=",
"this",
".",
"optNumber",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"final",... | Get an optional double associated with a key, or the defaultValue if
there is no such key or if its value is not a number. If the value is a
string, an attempt will be made to evaluate it as a number.
@param key
A key string.
@param defaultValue
The default.
@return An object which is the value. | [
"Get",
"an",
"optional",
"double",
"associated",
"with",
"a",
"key",
"or",
"the",
"defaultValue",
"if",
"there",
"is",
"no",
"such",
"key",
"or",
"if",
"its",
"value",
"is",
"not",
"a",
"number",
".",
"If",
"the",
"value",
"is",
"a",
"string",
"an",
... | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/JSONObject.java#L1233-L1243 |
jtrfp/javamod | src/main/java/de/quippy/jflac/io/BitInputStream.java | BitInputStream.readByteBlockAlignedNoCRC | public void readByteBlockAlignedNoCRC(byte[] val, int nvals) throws IOException {
"""
Read a block of bytes (aligned) without updating the CRC value.
@param val The array to receive the bytes. If null, no bytes are returned
@param nvals The number of bytes to read
@throws IOException Thrown if error reading ... | java | public void readByteBlockAlignedNoCRC(byte[] val, int nvals) throws IOException {
int destlength = nvals;
while (nvals > 0) {
int chunk = Math.min(nvals, putByte - getByte);
if (chunk == 0) {
readFromStream();
} else {
if (val != null) ... | [
"public",
"void",
"readByteBlockAlignedNoCRC",
"(",
"byte",
"[",
"]",
"val",
",",
"int",
"nvals",
")",
"throws",
"IOException",
"{",
"int",
"destlength",
"=",
"nvals",
";",
"while",
"(",
"nvals",
">",
"0",
")",
"{",
"int",
"chunk",
"=",
"Math",
".",
"m... | Read a block of bytes (aligned) without updating the CRC value.
@param val The array to receive the bytes. If null, no bytes are returned
@param nvals The number of bytes to read
@throws IOException Thrown if error reading input stream | [
"Read",
"a",
"block",
"of",
"bytes",
"(",
"aligned",
")",
"without",
"updating",
"the",
"CRC",
"value",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jflac/io/BitInputStream.java#L390-L405 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java | MappingUtils.invokeFunction | public static Object invokeFunction(Object object, String functionName, Class[] parameters, Object[] values) throws MjdbcException {
"""
Invokes class function using Reflection
@param object Instance which function would be invoked
@param functionName function name
@param parameters function parameter... | java | public static Object invokeFunction(Object object, String functionName, Class[] parameters, Object[] values) throws MjdbcException {
Object result = null;
try {
Method method = object.getClass().getMethod(functionName, parameters);
method.setAccessible(true);
r... | [
"public",
"static",
"Object",
"invokeFunction",
"(",
"Object",
"object",
",",
"String",
"functionName",
",",
"Class",
"[",
"]",
"parameters",
",",
"Object",
"[",
"]",
"values",
")",
"throws",
"MjdbcException",
"{",
"Object",
"result",
"=",
"null",
";",
"try"... | Invokes class function using Reflection
@param object Instance which function would be invoked
@param functionName function name
@param parameters function parameters (array of Class)
@param values function values (array of Object)
@return function return
@throws org.midao.jdbc.core.exception.MjdbcExcept... | [
"Invokes",
"class",
"function",
"using",
"Reflection"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java#L261-L273 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/PropertyUtility.java | PropertyUtility.getter | public static String getter(String beanName, TypeName beanClass, ModelProperty property) {
"""
Gets the ter.
@param beanName
the bean name
@param beanClass
the bean class
@param property
the property
@return the ter
"""
return beanName + (beanClass != null ? "." + getter(property) : "");
} | java | public static String getter(String beanName, TypeName beanClass, ModelProperty property) {
return beanName + (beanClass != null ? "." + getter(property) : "");
} | [
"public",
"static",
"String",
"getter",
"(",
"String",
"beanName",
",",
"TypeName",
"beanClass",
",",
"ModelProperty",
"property",
")",
"{",
"return",
"beanName",
"+",
"(",
"beanClass",
"!=",
"null",
"?",
"\".\"",
"+",
"getter",
"(",
"property",
")",
":",
... | Gets the ter.
@param beanName
the bean name
@param beanClass
the bean class
@param property
the property
@return the ter | [
"Gets",
"the",
"ter",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/PropertyUtility.java#L305-L307 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java | BoxApiMetadata.getDeleteMetadataTemplateRequest | @Deprecated
public BoxRequestsMetadata.DeleteFileMetadata getDeleteMetadataTemplateRequest(String id, String template) {
"""
Gets a request that deletes the metadata for a specific template on a file
Deprecated: use getDeleteFileMetadataTemplateRequest or getDeleteFolderMetadataTemplateRequest instead.
@para... | java | @Deprecated
public BoxRequestsMetadata.DeleteFileMetadata getDeleteMetadataTemplateRequest(String id, String template) {
return getDeleteFileMetadataTemplateRequest(id, template);
} | [
"@",
"Deprecated",
"public",
"BoxRequestsMetadata",
".",
"DeleteFileMetadata",
"getDeleteMetadataTemplateRequest",
"(",
"String",
"id",
",",
"String",
"template",
")",
"{",
"return",
"getDeleteFileMetadataTemplateRequest",
"(",
"id",
",",
"template",
")",
";",
"}"
] | Gets a request that deletes the metadata for a specific template on a file
Deprecated: use getDeleteFileMetadataTemplateRequest or getDeleteFolderMetadataTemplateRequest instead.
@param id id of the file to retrieve metadata for
@param template metadata template to use
@return request to delete metadata on a fil... | [
"Gets",
"a",
"request",
"that",
"deletes",
"the",
"metadata",
"for",
"a",
"specific",
"template",
"on",
"a",
"file",
"Deprecated",
":",
"use",
"getDeleteFileMetadataTemplateRequest",
"or",
"getDeleteFolderMetadataTemplateRequest",
"instead",
"."
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java#L253-L256 |
jayantk/jklol | src/com/jayantkrish/jklol/models/FactorGraph.java | FactorGraph.getMinimalFactors | public List<Factor> getMinimalFactors() {
"""
Gets a list of factors in this. This method is similar to
{@link #getFactors()}, except that it merges together factors
defined over the same variables. Hence, no factor in the returned
list will be defined over a subset of the variables in another
factor. The retu... | java | public List<Factor> getMinimalFactors() {
// Sort factors in descending order of size.
List<Factor> sortedFactors = Lists.newArrayList(factors);
Collections.sort(sortedFactors, new Comparator<Factor>() {
public int compare(Factor f1, Factor f2) {
return f2.getVars().size() - f1.getVars().size(... | [
"public",
"List",
"<",
"Factor",
">",
"getMinimalFactors",
"(",
")",
"{",
"// Sort factors in descending order of size.",
"List",
"<",
"Factor",
">",
"sortedFactors",
"=",
"Lists",
".",
"newArrayList",
"(",
"factors",
")",
";",
"Collections",
".",
"sort",
"(",
"... | Gets a list of factors in this. This method is similar to
{@link #getFactors()}, except that it merges together factors
defined over the same variables. Hence, no factor in the returned
list will be defined over a subset of the variables in another
factor. The returned factors define the same probability
distribution a... | [
"Gets",
"a",
"list",
"of",
"factors",
"in",
"this",
".",
"This",
"method",
"is",
"similar",
"to",
"{",
"@link",
"#getFactors",
"()",
"}",
"except",
"that",
"it",
"merges",
"together",
"factors",
"defined",
"over",
"the",
"same",
"variables",
".",
"Hence",
... | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/FactorGraph.java#L229-L272 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/web/SeleniumDriverSetup.java | SeleniumDriverSetup.connectToDriverForVersionOnAt | public boolean connectToDriverForVersionOnAt(String browser, String version, String platformName, String url)
throws MalformedURLException {
"""
Connects SeleniumHelper to a remote web driver.
@param browser name of browser to connect to.
@param version version of browser.
@param platformName platfo... | java | public boolean connectToDriverForVersionOnAt(String browser, String version, String platformName, String url)
throws MalformedURLException {
Platform platform = Platform.valueOf(platformName);
DesiredCapabilities desiredCapabilities = new DesiredCapabilities(browser, version, platform);
... | [
"public",
"boolean",
"connectToDriverForVersionOnAt",
"(",
"String",
"browser",
",",
"String",
"version",
",",
"String",
"platformName",
",",
"String",
"url",
")",
"throws",
"MalformedURLException",
"{",
"Platform",
"platform",
"=",
"Platform",
".",
"valueOf",
"(",
... | Connects SeleniumHelper to a remote web driver.
@param browser name of browser to connect to.
@param version version of browser.
@param platformName platform browser must run on.
@param url url to connect to browser.
@return true.
@throws MalformedURLException if supplied url can not be transformed to URL. | [
"Connects",
"SeleniumHelper",
"to",
"a",
"remote",
"web",
"driver",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/web/SeleniumDriverSetup.java#L138-L144 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.listSiteDetectorsWithServiceResponseAsync | public Observable<ServiceResponse<Page<DetectorDefinitionInner>>> listSiteDetectorsWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) {
"""
Get Detectors.
Get Detectors.
@param resourceGroupName Name of the resource group to which the resource belon... | java | public Observable<ServiceResponse<Page<DetectorDefinitionInner>>> listSiteDetectorsWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) {
return listSiteDetectorsSinglePageAsync(resourceGroupName, siteName, diagnosticCategory)
.concatMap(ne... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"DetectorDefinitionInner",
">",
">",
">",
"listSiteDetectorsWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"siteName",
",",
"final",
"String",
"diagnosticC... | Get Detectors.
Get Detectors.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Diagnostic Category
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<DetectorDefinitio... | [
"Get",
"Detectors",
".",
"Get",
"Detectors",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L916-L928 |
code4everything/util | src/main/java/com/zhazhapan/util/BeanUtils.java | BeanUtils.serialize | public static void serialize(Object object, String file) throws Exception {
"""
序列化对象
@param object 实现了 {@link Serializable} 接口的对象
@param file 保存到指定文件
@throws Exception 异常
@since 1.0.8
"""
if (object instanceof Serializable) {
try (FileOutputStream fileOut = new FileOutputStream(fil... | java | public static void serialize(Object object, String file) throws Exception {
if (object instanceof Serializable) {
try (FileOutputStream fileOut = new FileOutputStream(file); ObjectOutputStream out =
new ObjectOutputStream(fileOut)) {
out.writeObject(object);
... | [
"public",
"static",
"void",
"serialize",
"(",
"Object",
"object",
",",
"String",
"file",
")",
"throws",
"Exception",
"{",
"if",
"(",
"object",
"instanceof",
"Serializable",
")",
"{",
"try",
"(",
"FileOutputStream",
"fileOut",
"=",
"new",
"FileOutputStream",
"(... | 序列化对象
@param object 实现了 {@link Serializable} 接口的对象
@param file 保存到指定文件
@throws Exception 异常
@since 1.0.8 | [
"序列化对象"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/BeanUtils.java#L170-L179 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/FileInputFormat.java | FileInputFormat.setInputPaths | public static void setInputPaths(JobConf conf, String commaSeparatedPaths) {
"""
Sets the given comma separated paths as the list of inputs
for the map-reduce job.
@param conf Configuration of the job
@param commaSeparatedPaths Comma separated paths to be set as
the list of inputs for the map-reduce job.
... | java | public static void setInputPaths(JobConf conf, String commaSeparatedPaths) {
setInputPaths(conf, StringUtils.stringToPath(
getPathStrings(commaSeparatedPaths)));
} | [
"public",
"static",
"void",
"setInputPaths",
"(",
"JobConf",
"conf",
",",
"String",
"commaSeparatedPaths",
")",
"{",
"setInputPaths",
"(",
"conf",
",",
"StringUtils",
".",
"stringToPath",
"(",
"getPathStrings",
"(",
"commaSeparatedPaths",
")",
")",
")",
";",
"}"... | Sets the given comma separated paths as the list of inputs
for the map-reduce job.
@param conf Configuration of the job
@param commaSeparatedPaths Comma separated paths to be set as
the list of inputs for the map-reduce job. | [
"Sets",
"the",
"given",
"comma",
"separated",
"paths",
"as",
"the",
"list",
"of",
"inputs",
"for",
"the",
"map",
"-",
"reduce",
"job",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/FileInputFormat.java#L488-L491 |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java | IotHubResourcesInner.getStats | public RegistryStatisticsInner getStats(String resourceGroupName, String resourceName) {
"""
Get the statistics from an IoT hub.
Get the statistics from an IoT hub.
@param resourceGroupName The name of the resource group that contains the IoT hub.
@param resourceName The name of the IoT hub.
@throws IllegalA... | java | public RegistryStatisticsInner getStats(String resourceGroupName, String resourceName) {
return getStatsWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body();
} | [
"public",
"RegistryStatisticsInner",
"getStats",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"getStatsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
... | Get the statistics from an IoT hub.
Get the statistics from an IoT hub.
@param resourceGroupName The name of the resource group that contains the IoT hub.
@param resourceName The name of the IoT hub.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorDetailsException thrown if the r... | [
"Get",
"the",
"statistics",
"from",
"an",
"IoT",
"hub",
".",
"Get",
"the",
"statistics",
"from",
"an",
"IoT",
"hub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L1414-L1416 |
jbehave/jbehave-core | jbehave-core/src/main/java/org/jbehave/core/reporters/PrintStreamOutput.java | PrintStreamOutput.lookupPattern | protected String lookupPattern(String key, String defaultPattern) {
"""
Looks up the format pattern for the event output by key, conventionally
equal to the method name. The pattern is used by the
{#format(String,String,Object...)} method and by default is formatted
using the {@link MessageFormat#format(String,... | java | protected String lookupPattern(String key, String defaultPattern) {
if (outputPatterns.containsKey(key)) {
return outputPatterns.getProperty(key);
}
return defaultPattern;
} | [
"protected",
"String",
"lookupPattern",
"(",
"String",
"key",
",",
"String",
"defaultPattern",
")",
"{",
"if",
"(",
"outputPatterns",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"return",
"outputPatterns",
".",
"getProperty",
"(",
"key",
")",
";",
"}",
... | Looks up the format pattern for the event output by key, conventionally
equal to the method name. The pattern is used by the
{#format(String,String,Object...)} method and by default is formatted
using the {@link MessageFormat#format(String, Object...)} method. If no
pattern is found for key or needs to be overridden, t... | [
"Looks",
"up",
"the",
"format",
"pattern",
"for",
"the",
"event",
"output",
"by",
"key",
"conventionally",
"equal",
"to",
"the",
"method",
"name",
".",
"The",
"pattern",
"is",
"used",
"by",
"the",
"{",
"#format",
"(",
"String",
"String",
"Object",
"...",
... | train | https://github.com/jbehave/jbehave-core/blob/bdd6a6199528df3c35087e72d4644870655b23e6/jbehave-core/src/main/java/org/jbehave/core/reporters/PrintStreamOutput.java#L533-L538 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/CompareUtil.java | CompareUtil.ifTrue | @SuppressWarnings("unchecked")
public static <T> T ifTrue(boolean _b, T _t) {
"""
Returns the second parameter if the condition is true
or null if the condition is false. Returns empty string
instead of null for implementors of {@link CharSequence}.
@param _b condition
@param _t object
@return object or n... | java | @SuppressWarnings("unchecked")
public static <T> T ifTrue(boolean _b, T _t) {
return _b ? _t : (_t instanceof CharSequence ? (T) "" : null);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"ifTrue",
"(",
"boolean",
"_b",
",",
"T",
"_t",
")",
"{",
"return",
"_b",
"?",
"_t",
":",
"(",
"_t",
"instanceof",
"CharSequence",
"?",
"(",
"T",
")",
"\"\"",... | Returns the second parameter if the condition is true
or null if the condition is false. Returns empty string
instead of null for implementors of {@link CharSequence}.
@param _b condition
@param _t object
@return object or null | [
"Returns",
"the",
"second",
"parameter",
"if",
"the",
"condition",
"is",
"true",
"or",
"null",
"if",
"the",
"condition",
"is",
"false",
".",
"Returns",
"empty",
"string",
"instead",
"of",
"null",
"for",
"implementors",
"of",
"{"
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/CompareUtil.java#L72-L75 |
kevoree/kevoree-library | web/src/main/java/org/kevoree/library/NanoHTTPD.java | NanoHTTPD.decodeParameters | protected Map<String, List<String>> decodeParameters(String queryString) {
"""
Decode parameters from a URL, handing the case where a single parameter name might have been
supplied several times, by return lists of values. In general these lists will contain a single
element.
@param queryString a query strin... | java | protected Map<String, List<String>> decodeParameters(String queryString) {
Map<String, List<String>> parms = new HashMap<String, List<String>>();
if (queryString != null) {
StringTokenizer st = new StringTokenizer(queryString, "&");
while (st.hasMoreTokens()) {
St... | [
"protected",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"decodeParameters",
"(",
"String",
"queryString",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"parms",
"=",
"new",
"HashMap",
"<",
"String",
",",
"List",... | Decode parameters from a URL, handing the case where a single parameter name might have been
supplied several times, by return lists of values. In general these lists will contain a single
element.
@param queryString a query string pulled from the URL.
@return a map of <code>String</code> (parameter name) to <code>Li... | [
"Decode",
"parameters",
"from",
"a",
"URL",
"handing",
"the",
"case",
"where",
"a",
"single",
"parameter",
"name",
"might",
"have",
"been",
"supplied",
"several",
"times",
"by",
"return",
"lists",
"of",
"values",
".",
"In",
"general",
"these",
"lists",
"will... | train | https://github.com/kevoree/kevoree-library/blob/617460e6c5881902ebc488a31ecdea179024d8f1/web/src/main/java/org/kevoree/library/NanoHTTPD.java#L284-L302 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/SQSMessageConsumerPrefetch.java | SQSMessageConsumerPrefetch.processReceivedMessages | protected void processReceivedMessages(List<Message> messages) {
"""
Converts the received message to JMS message, and pushes to messages to
either callback scheduler for asynchronous message delivery or to
internal buffers for synchronous message delivery. Messages that was not
converted to JMS message will be... | java | protected void processReceivedMessages(List<Message> messages) {
List<String> nackMessages = new ArrayList<String>();
List<MessageManager> messageManagers = new ArrayList<MessageManager>();
for (Message message : messages) {
try {
javax.jms.Message jmsMessage = conver... | [
"protected",
"void",
"processReceivedMessages",
"(",
"List",
"<",
"Message",
">",
"messages",
")",
"{",
"List",
"<",
"String",
">",
"nackMessages",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"List",
"<",
"MessageManager",
">",
"messageManage... | Converts the received message to JMS message, and pushes to messages to
either callback scheduler for asynchronous message delivery or to
internal buffers for synchronous message delivery. Messages that was not
converted to JMS message will be immediately negative acknowledged. | [
"Converts",
"the",
"received",
"message",
"to",
"JMS",
"message",
"and",
"pushes",
"to",
"messages",
"to",
"either",
"callback",
"scheduler",
"for",
"asynchronous",
"message",
"delivery",
"or",
"to",
"internal",
"buffers",
"for",
"synchronous",
"message",
"deliver... | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/SQSMessageConsumerPrefetch.java#L283-L312 |
geomajas/geomajas-project-client-gwt2 | common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java | GwtCommandDispatcher.afterLogin | private void afterLogin(GwtCommand command, Deferred deferred) {
"""
Add a command and it's callbacks to the list of commands to retry after login.
@param command
command to retry
@param deferred
callbacks for the command
"""
String token = notNull(command.getUserToken());
if (!afterLoginCommands.con... | java | private void afterLogin(GwtCommand command, Deferred deferred) {
String token = notNull(command.getUserToken());
if (!afterLoginCommands.containsKey(token)) {
afterLoginCommands.put(token, new ArrayList<RetryCommand>());
}
afterLoginCommands.get(token).add(new RetryCommand(command, deferred));
} | [
"private",
"void",
"afterLogin",
"(",
"GwtCommand",
"command",
",",
"Deferred",
"deferred",
")",
"{",
"String",
"token",
"=",
"notNull",
"(",
"command",
".",
"getUserToken",
"(",
")",
")",
";",
"if",
"(",
"!",
"afterLoginCommands",
".",
"containsKey",
"(",
... | Add a command and it's callbacks to the list of commands to retry after login.
@param command
command to retry
@param deferred
callbacks for the command | [
"Add",
"a",
"command",
"and",
"it",
"s",
"callbacks",
"to",
"the",
"list",
"of",
"commands",
"to",
"retry",
"after",
"login",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java#L297-L303 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java | HttpMessage.setIntField | public void setIntField(String name, int value) {
"""
Sets the value of an integer field.
Header or Trailer fields are set depending on message state.
@param name the field name
@param value the field integer value
"""
if (_state!=__MSG_EDITABLE)
return;
_header.put(name, TypeUti... | java | public void setIntField(String name, int value)
{
if (_state!=__MSG_EDITABLE)
return;
_header.put(name, TypeUtil.toString(value));
} | [
"public",
"void",
"setIntField",
"(",
"String",
"name",
",",
"int",
"value",
")",
"{",
"if",
"(",
"_state",
"!=",
"__MSG_EDITABLE",
")",
"return",
";",
"_header",
".",
"put",
"(",
"name",
",",
"TypeUtil",
".",
"toString",
"(",
"value",
")",
")",
";",
... | Sets the value of an integer field.
Header or Trailer fields are set depending on message state.
@param name the field name
@param value the field integer value | [
"Sets",
"the",
"value",
"of",
"an",
"integer",
"field",
".",
"Header",
"or",
"Trailer",
"fields",
"are",
"set",
"depending",
"on",
"message",
"state",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L333-L338 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/LoggingConfigUtils.java | LoggingConfigUtils.getBooleanValue | public static boolean getBooleanValue(Object newValue, boolean defaultValue) {
"""
Read boolean value from properties: begin by preserving the old value. If
the property is found, and the new value is an boolean, the new value
will be returned.
@param newValue
New parameter value to parse/evaluate
@param de... | java | public static boolean getBooleanValue(Object newValue, boolean defaultValue) {
if (newValue != null) {
if (newValue instanceof String) {
return Boolean.parseBoolean((String) newValue);
} else if (newValue instanceof Boolean)
return (Boolean) newValue;
... | [
"public",
"static",
"boolean",
"getBooleanValue",
"(",
"Object",
"newValue",
",",
"boolean",
"defaultValue",
")",
"{",
"if",
"(",
"newValue",
"!=",
"null",
")",
"{",
"if",
"(",
"newValue",
"instanceof",
"String",
")",
"{",
"return",
"Boolean",
".",
"parseBoo... | Read boolean value from properties: begin by preserving the old value. If
the property is found, and the new value is an boolean, the new value
will be returned.
@param newValue
New parameter value to parse/evaluate
@param defaultValue
Starting/Previous value
@return defaultValue if the newValue is null or is was badl... | [
"Read",
"boolean",
"value",
"from",
"properties",
":",
"begin",
"by",
"preserving",
"the",
"old",
"value",
".",
"If",
"the",
"property",
"is",
"found",
"and",
"the",
"new",
"value",
"is",
"an",
"boolean",
"the",
"new",
"value",
"will",
"be",
"returned",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/LoggingConfigUtils.java#L79-L88 |
BioPAX/Paxtools | paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3undirected/ControlWrapper.java | ControlWrapper.bindUpstream | private void bindUpstream(BioPAXElement element) {
"""
Puts the wrapper of the parameter element to the upstream of this Control.
@param element to put at upstream
"""
AbstractNode node = (AbstractNode) graph.getGraphObject(element);
if (node != null)
{
Edge edge = new EdgeL3(node, this, graph);
... | java | private void bindUpstream(BioPAXElement element)
{
AbstractNode node = (AbstractNode) graph.getGraphObject(element);
if (node != null)
{
Edge edge = new EdgeL3(node, this, graph);
node.getDownstreamNoInit().add(edge);
this.getUpstreamNoInit().add(edge);
}
} | [
"private",
"void",
"bindUpstream",
"(",
"BioPAXElement",
"element",
")",
"{",
"AbstractNode",
"node",
"=",
"(",
"AbstractNode",
")",
"graph",
".",
"getGraphObject",
"(",
"element",
")",
";",
"if",
"(",
"node",
"!=",
"null",
")",
"{",
"Edge",
"edge",
"=",
... | Puts the wrapper of the parameter element to the upstream of this Control.
@param element to put at upstream | [
"Puts",
"the",
"wrapper",
"of",
"the",
"parameter",
"element",
"to",
"the",
"upstream",
"of",
"this",
"Control",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3undirected/ControlWrapper.java#L108-L118 |
jamesagnew/hapi-fhir | hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProvider.java | AbstractJaxRsResourceProvider.find | @GET
@Path("/ {
"""
Read the current state of the resource
@param id the id of the resource to read
@return the response
@see <a href="https://www.hl7.org/fhir/http.html#read">https://www.hl7.org/fhir/http.html#read</a>
"""id}")
public Response find(@PathParam("id") final String id)
th... | java | @GET
@Path("/{id}")
public Response find(@PathParam("id") final String id)
throws IOException {
return execute(getResourceRequest(RequestTypeEnum.GET, RestOperationTypeEnum.READ).id(id));
} | [
"@",
"GET",
"@",
"Path",
"(",
"\"/{id}\"",
")",
"public",
"Response",
"find",
"(",
"@",
"PathParam",
"(",
"\"id\"",
")",
"final",
"String",
"id",
")",
"throws",
"IOException",
"{",
"return",
"execute",
"(",
"getResourceRequest",
"(",
"RequestTypeEnum",
".",
... | Read the current state of the resource
@param id the id of the resource to read
@return the response
@see <a href="https://www.hl7.org/fhir/http.html#read">https://www.hl7.org/fhir/http.html#read</a> | [
"Read",
"the",
"current",
"state",
"of",
"the",
"resource"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProvider.java#L222-L227 |
grpc/grpc-java | examples/src/main/java/io/grpc/examples/errorhandling/DetailErrorSample.java | DetailErrorSample.advancedAsyncCall | void advancedAsyncCall() {
"""
This is more advanced and does not make use of the stub. You should not normally need to do
this, but here is how you would.
"""
ClientCall<HelloRequest, HelloReply> call =
channel.newCall(GreeterGrpc.getSayHelloMethod(), CallOptions.DEFAULT);
final CountDownLa... | java | void advancedAsyncCall() {
ClientCall<HelloRequest, HelloReply> call =
channel.newCall(GreeterGrpc.getSayHelloMethod(), CallOptions.DEFAULT);
final CountDownLatch latch = new CountDownLatch(1);
call.start(new ClientCall.Listener<HelloReply>() {
@Override
public void onClose(Status sta... | [
"void",
"advancedAsyncCall",
"(",
")",
"{",
"ClientCall",
"<",
"HelloRequest",
",",
"HelloReply",
">",
"call",
"=",
"channel",
".",
"newCall",
"(",
"GreeterGrpc",
".",
"getSayHelloMethod",
"(",
")",
",",
"CallOptions",
".",
"DEFAULT",
")",
";",
"final",
"Cou... | This is more advanced and does not make use of the stub. You should not normally need to do
this, but here is how you would. | [
"This",
"is",
"more",
"advanced",
"and",
"does",
"not",
"make",
"use",
"of",
"the",
"stub",
".",
"You",
"should",
"not",
"normally",
"need",
"to",
"do",
"this",
"but",
"here",
"is",
"how",
"you",
"would",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/examples/src/main/java/io/grpc/examples/errorhandling/DetailErrorSample.java#L199-L227 |
weld/core | environments/servlet/core/src/main/java/org/jboss/weld/environment/tomcat/SecurityActions.java | SecurityActions.lookupField | static Field lookupField(Class<?> javaClass, String fieldName) throws NoSuchFieldException {
"""
Does not perform {@link PrivilegedAction} unless necessary.
@param javaClass
@param fieldName
@return a field from the class
@throws NoSuchMethodException
"""
if (System.getSecurityManager() != null) ... | java | static Field lookupField(Class<?> javaClass, String fieldName) throws NoSuchFieldException {
if (System.getSecurityManager() != null) {
try {
return AccessController.doPrivileged(new FieldLookupAction(javaClass, fieldName));
} catch (PrivilegedActionException e) {
... | [
"static",
"Field",
"lookupField",
"(",
"Class",
"<",
"?",
">",
"javaClass",
",",
"String",
"fieldName",
")",
"throws",
"NoSuchFieldException",
"{",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"Acc... | Does not perform {@link PrivilegedAction} unless necessary.
@param javaClass
@param fieldName
@return a field from the class
@throws NoSuchMethodException | [
"Does",
"not",
"perform",
"{",
"@link",
"PrivilegedAction",
"}",
"unless",
"necessary",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/servlet/core/src/main/java/org/jboss/weld/environment/tomcat/SecurityActions.java#L72-L85 |
ppiastucki/recast4j | detour-extras/src/main/java/org/recast4j/detour/extras/unity/astar/LinkBuilder.java | LinkBuilder.build | void build(int nodeOffset, GraphMeshData graphData, List<int[]> connections) {
"""
Process connections and transform them into recast neighbour flags
"""
for (int n = 0; n < connections.size(); n++) {
int[] nodeConnections = connections.get(n);
MeshData tile = graphData.getTile(n);
Poly node = graph... | java | void build(int nodeOffset, GraphMeshData graphData, List<int[]> connections) {
for (int n = 0; n < connections.size(); n++) {
int[] nodeConnections = connections.get(n);
MeshData tile = graphData.getTile(n);
Poly node = graphData.getNode(n);
for (int connection : nodeConnections) {
MeshData neighbourT... | [
"void",
"build",
"(",
"int",
"nodeOffset",
",",
"GraphMeshData",
"graphData",
",",
"List",
"<",
"int",
"[",
"]",
">",
"connections",
")",
"{",
"for",
"(",
"int",
"n",
"=",
"0",
";",
"n",
"<",
"connections",
".",
"size",
"(",
")",
";",
"n",
"++",
... | Process connections and transform them into recast neighbour flags | [
"Process",
"connections",
"and",
"transform",
"them",
"into",
"recast",
"neighbour",
"flags"
] | train | https://github.com/ppiastucki/recast4j/blob/a414dc34f16b87c95fb4e0f46c28a7830d421788/detour-extras/src/main/java/org/recast4j/detour/extras/unity/astar/LinkBuilder.java#L13-L28 |
jenkinsci/jenkins | core/src/main/java/hudson/util/ArgumentListBuilder.java | ArgumentListBuilder.addKeyValuePairs | public ArgumentListBuilder addKeyValuePairs(String prefix, Map<String,String> props) {
"""
Adds key value pairs as "-Dkey=value -Dkey=value ..."
{@code -D} portion is configurable as the 'prefix' parameter.
@since 1.114
"""
for (Entry<String,String> e : props.entrySet())
addKeyValuePair... | java | public ArgumentListBuilder addKeyValuePairs(String prefix, Map<String,String> props) {
for (Entry<String,String> e : props.entrySet())
addKeyValuePair(prefix, e.getKey(), e.getValue(), false);
return this;
} | [
"public",
"ArgumentListBuilder",
"addKeyValuePairs",
"(",
"String",
"prefix",
",",
"Map",
"<",
"String",
",",
"String",
">",
"props",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"String",
">",
"e",
":",
"props",
".",
"entrySet",
"(",
")",
")",
"... | Adds key value pairs as "-Dkey=value -Dkey=value ..."
{@code -D} portion is configurable as the 'prefix' parameter.
@since 1.114 | [
"Adds",
"key",
"value",
"pairs",
"as",
"-",
"Dkey",
"=",
"value",
"-",
"Dkey",
"=",
"value",
"..."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/ArgumentListBuilder.java#L171-L175 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/results/WrapperImages.java | WrapperImages.updateArtworkType | private void updateArtworkType(List<Artwork> artworkList, ArtworkType type) {
"""
Update the artwork type for the artwork list
@param artworkList
@param type
"""
for (Artwork artwork : artworkList) {
artwork.setArtworkType(type);
}
} | java | private void updateArtworkType(List<Artwork> artworkList, ArtworkType type) {
for (Artwork artwork : artworkList) {
artwork.setArtworkType(type);
}
} | [
"private",
"void",
"updateArtworkType",
"(",
"List",
"<",
"Artwork",
">",
"artworkList",
",",
"ArtworkType",
"type",
")",
"{",
"for",
"(",
"Artwork",
"artwork",
":",
"artworkList",
")",
"{",
"artwork",
".",
"setArtworkType",
"(",
"type",
")",
";",
"}",
"}"... | Update the artwork type for the artwork list
@param artworkList
@param type | [
"Update",
"the",
"artwork",
"type",
"for",
"the",
"artwork",
"list"
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/results/WrapperImages.java#L124-L128 |
wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java | MonthView.onDayClick | private void onDayClick(int day) {
"""
Called when the user clicks on a day. Handles callbacks to the
{@link OnDayClickListener} if one is set.
<p/>
If the day is out of the range set by minDate and/or maxDate, this is a no-op.
@param day The day that was clicked
"""
// If the min / max date are ... | java | private void onDayClick(int day) {
// If the min / max date are set, only process the click if it's a valid selection.
if (mController.isOutOfRange(mYear, mMonth, day)) {
return;
}
if (mOnDayClickListener != null) {
mOnDayClickListener.onDayClick(this, new Calen... | [
"private",
"void",
"onDayClick",
"(",
"int",
"day",
")",
"{",
"// If the min / max date are set, only process the click if it's a valid selection.",
"if",
"(",
"mController",
".",
"isOutOfRange",
"(",
"mYear",
",",
"mMonth",
",",
"day",
")",
")",
"{",
"return",
";",
... | Called when the user clicks on a day. Handles callbacks to the
{@link OnDayClickListener} if one is set.
<p/>
If the day is out of the range set by minDate and/or maxDate, this is a no-op.
@param day The day that was clicked | [
"Called",
"when",
"the",
"user",
"clicks",
"on",
"a",
"day",
".",
"Handles",
"callbacks",
"to",
"the",
"{",
"@link",
"OnDayClickListener",
"}",
"if",
"one",
"is",
"set",
".",
"<p",
"/",
">",
"If",
"the",
"day",
"is",
"out",
"of",
"the",
"range",
"set... | train | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java#L540-L553 |
brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.dateTimeEquals | @SuppressWarnings("deprecation")
public static boolean dateTimeEquals(java.util.Date d1, java.util.Date d2) {
"""
Checks the second, hour, month, day, month and year are equal.
"""
if (d1 == null || d2 == null) {
return false;
}
return d1.getDate() == d2.getDate()
... | java | @SuppressWarnings("deprecation")
public static boolean dateTimeEquals(java.util.Date d1, java.util.Date d2) {
if (d1 == null || d2 == null) {
return false;
}
return d1.getDate() == d2.getDate()
&& d1.getMonth() == d2.getMonth()
&& d1.getYear() == d2.... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"boolean",
"dateTimeEquals",
"(",
"java",
".",
"util",
".",
"Date",
"d1",
",",
"java",
".",
"util",
".",
"Date",
"d2",
")",
"{",
"if",
"(",
"d1",
"==",
"null",
"||",
"d2",
"==",
... | Checks the second, hour, month, day, month and year are equal. | [
"Checks",
"the",
"second",
"hour",
"month",
"day",
"month",
"and",
"year",
"are",
"equal",
"."
] | train | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L237-L249 |
pravega/pravega | controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java | StreamMetrics.truncateStream | public void truncateStream(String scope, String streamName, Duration latency) {
"""
This method increments the global and Stream-specific counters of Stream truncations and reports the latency of
the operation.
@param scope Scope.
@param streamName Name of the Stream.
@param latency Latency ... | java | public void truncateStream(String scope, String streamName, Duration latency) {
DYNAMIC_LOGGER.incCounterValue(globalMetricName(TRUNCATE_STREAM), 1);
DYNAMIC_LOGGER.incCounterValue(TRUNCATE_STREAM, 1, streamTags(scope, streamName));
truncateStreamLatency.reportSuccessValue(latency.toMillis());
... | [
"public",
"void",
"truncateStream",
"(",
"String",
"scope",
",",
"String",
"streamName",
",",
"Duration",
"latency",
")",
"{",
"DYNAMIC_LOGGER",
".",
"incCounterValue",
"(",
"globalMetricName",
"(",
"TRUNCATE_STREAM",
")",
",",
"1",
")",
";",
"DYNAMIC_LOGGER",
"... | This method increments the global and Stream-specific counters of Stream truncations and reports the latency of
the operation.
@param scope Scope.
@param streamName Name of the Stream.
@param latency Latency of the truncateStream operation. | [
"This",
"method",
"increments",
"the",
"global",
"and",
"Stream",
"-",
"specific",
"counters",
"of",
"Stream",
"truncations",
"and",
"reports",
"the",
"latency",
"of",
"the",
"operation",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L165-L169 |
jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java | ReflectionUtils.setFieldValueWithPath | public static void setFieldValueWithPath(Object object, String path, Object value) throws IllegalStateException {
"""
Returns the value of a field identified using a path from the parent.
@param object
Parent object.
@param path
Path to identify the field. May contain one or more dots, e.g.
"address.city"... | java | public static void setFieldValueWithPath(Object object, String path, Object value) throws IllegalStateException {
int lastDot = path.lastIndexOf('.');
if (lastDot > -1) {
String parentPath = path.substring(0, lastDot);
String field = path.substring(lastDot + 1);
Ob... | [
"public",
"static",
"void",
"setFieldValueWithPath",
"(",
"Object",
"object",
",",
"String",
"path",
",",
"Object",
"value",
")",
"throws",
"IllegalStateException",
"{",
"int",
"lastDot",
"=",
"path",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
... | Returns the value of a field identified using a path from the parent.
@param object
Parent object.
@param path
Path to identify the field. May contain one or more dots, e.g.
"address.city".
@param value
Value to which to set the field.
@throws IllegalStateException
if one of the intermediate objects on the path is nu... | [
"Returns",
"the",
"value",
"of",
"a",
"field",
"identified",
"using",
"a",
"path",
"from",
"the",
"parent",
"."
] | train | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java#L163-L186 |
stratosphere/stratosphere | stratosphere-compiler/src/main/java/eu/stratosphere/compiler/contextcheck/ContextChecker.java | ContextChecker.checkDualInputContract | private void checkDualInputContract(DualInputOperator<?, ?, ?, ?> dualInputContract) {
"""
Checks whether a DualInputOperator is correctly connected. In case that
the contract is incorrectly connected a RuntimeException is thrown.
@param dualInputContract
DualInputOperator that is checked.
"""
Operator<... | java | private void checkDualInputContract(DualInputOperator<?, ?, ?, ?> dualInputContract) {
Operator<?> input1 = dualInputContract.getFirstInput();
Operator<?> input2 = dualInputContract.getSecondInput();
// check if input exists
if (input1 == null || input2 == null) {
throw new MissingChildException();
}
} | [
"private",
"void",
"checkDualInputContract",
"(",
"DualInputOperator",
"<",
"?",
",",
"?",
",",
"?",
",",
"?",
">",
"dualInputContract",
")",
"{",
"Operator",
"<",
"?",
">",
"input1",
"=",
"dualInputContract",
".",
"getFirstInput",
"(",
")",
";",
"Operator",... | Checks whether a DualInputOperator is correctly connected. In case that
the contract is incorrectly connected a RuntimeException is thrown.
@param dualInputContract
DualInputOperator that is checked. | [
"Checks",
"whether",
"a",
"DualInputOperator",
"is",
"correctly",
"connected",
".",
"In",
"case",
"that",
"the",
"contract",
"is",
"incorrectly",
"connected",
"a",
"RuntimeException",
"is",
"thrown",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-compiler/src/main/java/eu/stratosphere/compiler/contextcheck/ContextChecker.java#L192-L199 |
Netflix/karyon | karyon2-governator/src/main/java/netflix/karyon/Karyon.java | Karyon.forWebSocketServer | public static KaryonServer forWebSocketServer(RxServer<? extends WebSocketFrame, ? extends WebSocketFrame> server, Module... modules) {
"""
Creates a new {@link KaryonServer} which combines lifecycle of the passed WebSockets {@link RxServer} with
it's own lifecycle.
@param server WebSocket server
@param modul... | java | public static KaryonServer forWebSocketServer(RxServer<? extends WebSocketFrame, ? extends WebSocketFrame> server, Module... modules) {
return forWebSocketServer(server, toBootstrapModule(modules));
} | [
"public",
"static",
"KaryonServer",
"forWebSocketServer",
"(",
"RxServer",
"<",
"?",
"extends",
"WebSocketFrame",
",",
"?",
"extends",
"WebSocketFrame",
">",
"server",
",",
"Module",
"...",
"modules",
")",
"{",
"return",
"forWebSocketServer",
"(",
"server",
",",
... | Creates a new {@link KaryonServer} which combines lifecycle of the passed WebSockets {@link RxServer} with
it's own lifecycle.
@param server WebSocket server
@param modules Additional bootstrapModules if any.
@return {@link KaryonServer} which is to be used to start the created server. | [
"Creates",
"a",
"new",
"{",
"@link",
"KaryonServer",
"}",
"which",
"combines",
"lifecycle",
"of",
"the",
"passed",
"WebSockets",
"{",
"@link",
"RxServer",
"}",
"with",
"it",
"s",
"own",
"lifecycle",
"."
] | train | https://github.com/Netflix/karyon/blob/d50bc0ff37693ef3fbda373e90a109d1f92e0b9a/karyon2-governator/src/main/java/netflix/karyon/Karyon.java#L204-L206 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/Form.java | Form.setAnswer | public void setAnswer(String variable, String value) {
"""
Sets a new String value to a given form's field. The field whose variable matches the
requested variable will be completed with the specified value. If no field could be found
for the specified variable then an exception will be raised.<p>
If the valu... | java | public void setAnswer(String variable, String value) {
FormField field = getField(variable);
if (field == null) {
throw new IllegalArgumentException("Field not found for the specified variable name.");
}
switch (field.getType()) {
case text_multi:
case text_pr... | [
"public",
"void",
"setAnswer",
"(",
"String",
"variable",
",",
"String",
"value",
")",
"{",
"FormField",
"field",
"=",
"getField",
"(",
"variable",
")",
";",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Fi... | Sets a new String value to a given form's field. The field whose variable matches the
requested variable will be completed with the specified value. If no field could be found
for the specified variable then an exception will be raised.<p>
If the value to set to the field is not a basic type (e.g. String, boolean, int... | [
"Sets",
"a",
"new",
"String",
"value",
"to",
"a",
"given",
"form",
"s",
"field",
".",
"The",
"field",
"whose",
"variable",
"matches",
"the",
"requested",
"variable",
"will",
"be",
"completed",
"with",
"the",
"specified",
"value",
".",
"If",
"no",
"field",
... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/Form.java#L110-L126 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java | PyExpressionGenerator._generate | protected XExpression _generate(XBasicForLoopExpression forLoop, IAppendable it, IExtraLanguageGeneratorContext context) {
"""
Generate the given object.
@param forLoop the for-loop.
@param it the target for the generated content.
@param context the context.
@return the last statement in the loop or {@code n... | java | protected XExpression _generate(XBasicForLoopExpression forLoop, IAppendable it, IExtraLanguageGeneratorContext context) {
for (final XExpression expr : forLoop.getInitExpressions()) {
generate(expr, it, context);
it.newLine();
}
it.append("while "); //$NON-NLS-1$
generate(forLoop.getExpression(), it, con... | [
"protected",
"XExpression",
"_generate",
"(",
"XBasicForLoopExpression",
"forLoop",
",",
"IAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"for",
"(",
"final",
"XExpression",
"expr",
":",
"forLoop",
".",
"getInitExpressions",
"(",
")",
... | Generate the given object.
@param forLoop the for-loop.
@param it the target for the generated content.
@param context the context.
@return the last statement in the loop or {@code null}. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java#L649-L665 |
zaproxy/zaproxy | src/org/parosproxy/paros/core/scanner/AbstractAppParamPlugin.java | AbstractAppParamPlugin.setParameter | protected String setParameter(HttpMessage message, String param, String value) {
"""
Sets the parameter into the given {@code message}. If both parameter name and value are {@code null}, the parameter will
be removed.
@param message the message that will be changed
@param param the name of the parameter
@par... | java | protected String setParameter(HttpMessage message, String param, String value) {
return variant.setParameter(message, originalPair, param, value);
} | [
"protected",
"String",
"setParameter",
"(",
"HttpMessage",
"message",
",",
"String",
"param",
",",
"String",
"value",
")",
"{",
"return",
"variant",
".",
"setParameter",
"(",
"message",
",",
"originalPair",
",",
"param",
",",
"value",
")",
";",
"}"
] | Sets the parameter into the given {@code message}. If both parameter name and value are {@code null}, the parameter will
be removed.
@param message the message that will be changed
@param param the name of the parameter
@param value the value of the parameter
@return the parameter set
@see #setEscapedParameter(HttpMes... | [
"Sets",
"the",
"parameter",
"into",
"the",
"given",
"{",
"@code",
"message",
"}",
".",
"If",
"both",
"parameter",
"name",
"and",
"value",
"are",
"{",
"@code",
"null",
"}",
"the",
"parameter",
"will",
"be",
"removed",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/AbstractAppParamPlugin.java#L285-L287 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/util/sys/System.java | System.runCommand | public static void runCommand(String[] cmdArray, File logFile, File dir) {
"""
Checks the exit code and throws an Exception if the process failed.
"""
Process proc = System.runProcess(cmdArray, logFile, dir);
if (proc.exitValue() != 0) {
throw new RuntimeException("Command failed wi... | java | public static void runCommand(String[] cmdArray, File logFile, File dir) {
Process proc = System.runProcess(cmdArray, logFile, dir);
if (proc.exitValue() != 0) {
throw new RuntimeException("Command failed with exit code " + proc.exitValue() + ": "
+ System.cmdToString(cmd... | [
"public",
"static",
"void",
"runCommand",
"(",
"String",
"[",
"]",
"cmdArray",
",",
"File",
"logFile",
",",
"File",
"dir",
")",
"{",
"Process",
"proc",
"=",
"System",
".",
"runProcess",
"(",
"cmdArray",
",",
"logFile",
",",
"dir",
")",
";",
"if",
"(",
... | Checks the exit code and throws an Exception if the process failed. | [
"Checks",
"the",
"exit",
"code",
"and",
"throws",
"an",
"Exception",
"if",
"the",
"process",
"failed",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/util/sys/System.java#L20-L26 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipPhone.java | SipPhone.addBuddy | public PresenceSubscriber addBuddy(String uri, String eventId, long timeout) {
"""
This method is the same as addBuddy(uri, duration, eventId, timeout) except that the duration
is defaulted to the default period defined in the event package RFC (3600 seconds).
@param uri the URI (ie, sip:bob@nist.gov) of the b... | java | public PresenceSubscriber addBuddy(String uri, String eventId, long timeout) {
return addBuddy(uri, DEFAULT_SUBSCRIBE_DURATION, eventId, timeout);
} | [
"public",
"PresenceSubscriber",
"addBuddy",
"(",
"String",
"uri",
",",
"String",
"eventId",
",",
"long",
"timeout",
")",
"{",
"return",
"addBuddy",
"(",
"uri",
",",
"DEFAULT_SUBSCRIBE_DURATION",
",",
"eventId",
",",
"timeout",
")",
";",
"}"
] | This method is the same as addBuddy(uri, duration, eventId, timeout) except that the duration
is defaulted to the default period defined in the event package RFC (3600 seconds).
@param uri the URI (ie, sip:bob@nist.gov) of the buddy to be added to the list.
@param eventId the event "id" to use in the SUBSCRIBE message... | [
"This",
"method",
"is",
"the",
"same",
"as",
"addBuddy",
"(",
"uri",
"duration",
"eventId",
"timeout",
")",
"except",
"that",
"the",
"duration",
"is",
"defaulted",
"to",
"the",
"default",
"period",
"defined",
"in",
"the",
"event",
"package",
"RFC",
"(",
"3... | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipPhone.java#L1475-L1477 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java | GlobalAddressClient.insertGlobalAddress | @BetaApi
public final Operation insertGlobalAddress(ProjectName project, Address addressResource) {
"""
Creates an address resource in the specified project using the data included in the request.
<p>Sample code:
<pre><code>
try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
P... | java | @BetaApi
public final Operation insertGlobalAddress(ProjectName project, Address addressResource) {
InsertGlobalAddressHttpRequest request =
InsertGlobalAddressHttpRequest.newBuilder()
.setProject(project == null ? null : project.toString())
.setAddressResource(addressResource)
... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertGlobalAddress",
"(",
"ProjectName",
"project",
",",
"Address",
"addressResource",
")",
"{",
"InsertGlobalAddressHttpRequest",
"request",
"=",
"InsertGlobalAddressHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setP... | Creates an address resource in the specified project using the data included in the request.
<p>Sample code:
<pre><code>
try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
Address addressResource = Address.newBuilder().build();
Operation r... | [
"Creates",
"an",
"address",
"resource",
"in",
"the",
"specified",
"project",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java#L375-L384 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/Tools.java | Tools.Scale | public static int Scale(IntRange from, IntRange to, int x) {
"""
Converts the value x (which is measured in the scale 'from') to another value measured in the scale 'to'.
@param from Scale from.
@param to Scale to.
@param x Value.
@return Result.
"""
if (from.length() == 0) return 0;
... | java | public static int Scale(IntRange from, IntRange to, int x) {
if (from.length() == 0) return 0;
return (int) ((to.length()) * (x - from.getMin()) / from.length() + to.getMin());
} | [
"public",
"static",
"int",
"Scale",
"(",
"IntRange",
"from",
",",
"IntRange",
"to",
",",
"int",
"x",
")",
"{",
"if",
"(",
"from",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"0",
";",
"return",
"(",
"int",
")",
"(",
"(",
"to",
".",
"leng... | Converts the value x (which is measured in the scale 'from') to another value measured in the scale 'to'.
@param from Scale from.
@param to Scale to.
@param x Value.
@return Result. | [
"Converts",
"the",
"value",
"x",
"(",
"which",
"is",
"measured",
"in",
"the",
"scale",
"from",
")",
"to",
"another",
"value",
"measured",
"in",
"the",
"scale",
"to",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/Tools.java#L409-L412 |
korpling/ANNIS | annis-service/src/main/java/annis/administration/AdministrationDao.java | AdministrationDao.importResolverVisMapTable | private void importResolverVisMapTable(String path, String table, String annisFileSuffix) {
"""
Imported the old and the new version of the resolver_vis_map.tab. The new
version has an additional column for visibility status of the
visualization.
@param path The path to the ANNIS file.
@param table The final... | java | private void importResolverVisMapTable(String path, String table, String annisFileSuffix)
{
try
{
// count cols for detecting old resolver_vis_map table format
File resolver_vis_tab = new File(path, table + annisFileSuffix);
if (!resolver_vis_tab.isFile())
{
return;
}
... | [
"private",
"void",
"importResolverVisMapTable",
"(",
"String",
"path",
",",
"String",
"table",
",",
"String",
"annisFileSuffix",
")",
"{",
"try",
"{",
"// count cols for detecting old resolver_vis_map table format",
"File",
"resolver_vis_tab",
"=",
"new",
"File",
"(",
"... | Imported the old and the new version of the resolver_vis_map.tab. The new
version has an additional column for visibility status of the
visualization.
@param path The path to the ANNIS file.
@param table The final table in the database of the resolver_vis_map table. | [
"Imported",
"the",
"old",
"and",
"the",
"new",
"version",
"of",
"the",
"resolver_vis_map",
".",
"tab",
".",
"The",
"new",
"version",
"has",
"an",
"additional",
"column",
"for",
"visibility",
"status",
"of",
"the",
"visualization",
"."
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L2013-L2062 |
m-m-m/util | pojo/src/main/java/net/sf/mmm/util/pojo/descriptor/impl/DefaultPojoDescriptorEnhancer.java | DefaultPojoDescriptorEnhancer.addVirtualAccessor | private void addVirtualAccessor(AbstractPojoPropertyDescriptor propertyDescriptor, PojoPropertyAccessor accessor) {
"""
This method adds the given {@code accessor} to the given {@code propertyDescriptor}.
@param propertyDescriptor is the descriptor of the property where to add the given {@code accessor}.
@para... | java | private void addVirtualAccessor(AbstractPojoPropertyDescriptor propertyDescriptor, PojoPropertyAccessor accessor) {
LOG.trace("adding virtual accessor: {}", accessor);
propertyDescriptor.putAccessor(accessor);
} | [
"private",
"void",
"addVirtualAccessor",
"(",
"AbstractPojoPropertyDescriptor",
"propertyDescriptor",
",",
"PojoPropertyAccessor",
"accessor",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"adding virtual accessor: {}\"",
",",
"accessor",
")",
";",
"propertyDescriptor",
".",
"put... | This method adds the given {@code accessor} to the given {@code propertyDescriptor}.
@param propertyDescriptor is the descriptor of the property where to add the given {@code accessor}.
@param accessor is the (virtual) accessor to add. | [
"This",
"method",
"adds",
"the",
"given",
"{",
"@code",
"accessor",
"}",
"to",
"the",
"given",
"{",
"@code",
"propertyDescriptor",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/pojo/src/main/java/net/sf/mmm/util/pojo/descriptor/impl/DefaultPojoDescriptorEnhancer.java#L211-L215 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.