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 |
|---|---|---|---|---|---|---|---|---|---|---|
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.appendString | public static File appendString(String content, File file, String charset) throws IORuntimeException {
"""
将String写入文件,追加模式
@param content 写入的内容
@param file 文件
@param charset 字符集
@return 写入的文件
@throws IORuntimeException IO异常
"""
return FileWriter.create(file, CharsetUtil.charset(charset)).append(cont... | java | public static File appendString(String content, File file, String charset) throws IORuntimeException {
return FileWriter.create(file, CharsetUtil.charset(charset)).append(content);
} | [
"public",
"static",
"File",
"appendString",
"(",
"String",
"content",
",",
"File",
"file",
",",
"String",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"return",
"FileWriter",
".",
"create",
"(",
"file",
",",
"CharsetUtil",
".",
"charset",
"(",
"charset... | 将String写入文件,追加模式
@param content 写入的内容
@param file 文件
@param charset 字符集
@return 写入的文件
@throws IORuntimeException IO异常 | [
"将String写入文件,追加模式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2826-L2828 |
elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java | LogPanel.publishTextRecord | private void publishTextRecord(final LogRecord record) {
"""
Publish a text record to the pane
@param record Record to publish
"""
try {
logpane.publish(record);
}
catch(Exception e) {
throw new RuntimeException("Error writing a log-like message.", e);
}
} | java | private void publishTextRecord(final LogRecord record) {
try {
logpane.publish(record);
}
catch(Exception e) {
throw new RuntimeException("Error writing a log-like message.", e);
}
} | [
"private",
"void",
"publishTextRecord",
"(",
"final",
"LogRecord",
"record",
")",
"{",
"try",
"{",
"logpane",
".",
"publish",
"(",
"record",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Error writing a ... | Publish a text record to the pane
@param record Record to publish | [
"Publish",
"a",
"text",
"record",
"to",
"the",
"pane"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java#L117-L124 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.safeInvoke | private Object safeInvoke(Method method, Object object, Object... arguments) {
"""
Swallows the checked exceptions around Method.invoke and repackages them
as {@link DynamoDBMappingException}
"""
try {
return method.invoke(object, arguments);
} catch ( IllegalAccessException e ) {
... | java | private Object safeInvoke(Method method, Object object, Object... arguments) {
try {
return method.invoke(object, arguments);
} catch ( IllegalAccessException e ) {
throw new DynamoDBMappingException("Couldn't invoke " + method, e);
} catch ( IllegalArgumentException e ) ... | [
"private",
"Object",
"safeInvoke",
"(",
"Method",
"method",
",",
"Object",
"object",
",",
"Object",
"...",
"arguments",
")",
"{",
"try",
"{",
"return",
"method",
".",
"invoke",
"(",
"object",
",",
"arguments",
")",
";",
"}",
"catch",
"(",
"IllegalAccessExc... | Swallows the checked exceptions around Method.invoke and repackages them
as {@link DynamoDBMappingException} | [
"Swallows",
"the",
"checked",
"exceptions",
"around",
"Method",
".",
"invoke",
"and",
"repackages",
"them",
"as",
"{"
] | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L968-L978 |
wildfly/wildfly-core | elytron/src/main/java/org/wildfly/extension/elytron/ProviderAttributeDefinition.java | ProviderAttributeDefinition.populateProviders | static void populateProviders(final ModelNode response, final Provider[] providers) {
"""
Populate the supplied response {@link ModelNode} with information about each {@link Provider} in the included array.
@param response the response to populate.
@param providers the array or {@link Provider} instances to us... | java | static void populateProviders(final ModelNode response, final Provider[] providers) {
for (Provider current : providers) {
ModelNode providerModel = new ModelNode();
populateProvider(providerModel, current, true);
response.add(providerModel);
}
} | [
"static",
"void",
"populateProviders",
"(",
"final",
"ModelNode",
"response",
",",
"final",
"Provider",
"[",
"]",
"providers",
")",
"{",
"for",
"(",
"Provider",
"current",
":",
"providers",
")",
"{",
"ModelNode",
"providerModel",
"=",
"new",
"ModelNode",
"(",
... | Populate the supplied response {@link ModelNode} with information about each {@link Provider} in the included array.
@param response the response to populate.
@param providers the array or {@link Provider} instances to use to populate the response. | [
"Populate",
"the",
"supplied",
"response",
"{",
"@link",
"ModelNode",
"}",
"with",
"information",
"about",
"each",
"{",
"@link",
"Provider",
"}",
"in",
"the",
"included",
"array",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/elytron/src/main/java/org/wildfly/extension/elytron/ProviderAttributeDefinition.java#L180-L186 |
alkacon/opencms-core | src/org/opencms/jsp/search/controller/CmsSearchControllerFacetRange.java | CmsSearchControllerFacetRange.addFacetOptions | protected void addFacetOptions(StringBuffer query) {
"""
Adds the query parts for the facet options, except the filter parts.
@param query The query part that is extended with the facet options.
"""
// start
appendFacetOption(query, "range.start", m_config.getStart());
// end
... | java | protected void addFacetOptions(StringBuffer query) {
// start
appendFacetOption(query, "range.start", m_config.getStart());
// end
appendFacetOption(query, "range.end", m_config.getEnd());
// gap
appendFacetOption(query, "range.gap", m_config.getGap());
// other
... | [
"protected",
"void",
"addFacetOptions",
"(",
"StringBuffer",
"query",
")",
"{",
"// start",
"appendFacetOption",
"(",
"query",
",",
"\"range.start\"",
",",
"m_config",
".",
"getStart",
"(",
")",
")",
";",
"// end",
"appendFacetOption",
"(",
"query",
",",
"\"rang... | Adds the query parts for the facet options, except the filter parts.
@param query The query part that is extended with the facet options. | [
"Adds",
"the",
"query",
"parts",
"for",
"the",
"facet",
"options",
"except",
"the",
"filter",
"parts",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/controller/CmsSearchControllerFacetRange.java#L139-L157 |
ocelotds/ocelot | ocelot-core/src/main/java/org/ocelotds/messaging/JsTopicInterceptor.java | JsTopicInterceptor.computeTopic | String computeTopic(JsTopicName jsTopicName, String topic) {
"""
Compute full topicname from jsTopicName.prefix, topic and jsTopicName.postfix
@param jsTopicName
@param topic
@return
"""
StringBuilder result = new StringBuilder();
if (!jsTopicName.prefix().isEmpty()) {
result.append(jsTopicName.pr... | java | String computeTopic(JsTopicName jsTopicName, String topic) {
StringBuilder result = new StringBuilder();
if (!jsTopicName.prefix().isEmpty()) {
result.append(jsTopicName.prefix()).append(Constants.Topic.COLON);
}
result.append(topic);
if (!jsTopicName.postfix().isEmpty()) {
result.append(Constant... | [
"String",
"computeTopic",
"(",
"JsTopicName",
"jsTopicName",
",",
"String",
"topic",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"!",
"jsTopicName",
".",
"prefix",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"... | Compute full topicname from jsTopicName.prefix, topic and jsTopicName.postfix
@param jsTopicName
@param topic
@return | [
"Compute",
"full",
"topicname",
"from",
"jsTopicName",
".",
"prefix",
"topic",
"and",
"jsTopicName",
".",
"postfix"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-core/src/main/java/org/ocelotds/messaging/JsTopicInterceptor.java#L131-L141 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java | BouncyCastleCertProcessingFactory.createCertificateRequest | public byte[] createCertificateRequest(X509Certificate cert, KeyPair keyPair) throws GeneralSecurityException {
"""
Creates a certificate request from the specified certificate and a key pair. The certificate's subject
DN with <I>"CN=proxy"</I> name component appended to the subject is used as the subject of the
... | java | public byte[] createCertificateRequest(X509Certificate cert, KeyPair keyPair) throws GeneralSecurityException {
String issuer = cert.getSubjectDN().getName();
X509Name subjectDN = new X509Name(issuer + ",CN=proxy");
String sigAlgName = cert.getSigAlgName();
return createCertificateReque... | [
"public",
"byte",
"[",
"]",
"createCertificateRequest",
"(",
"X509Certificate",
"cert",
",",
"KeyPair",
"keyPair",
")",
"throws",
"GeneralSecurityException",
"{",
"String",
"issuer",
"=",
"cert",
".",
"getSubjectDN",
"(",
")",
".",
"getName",
"(",
")",
";",
"X... | Creates a certificate request from the specified certificate and a key pair. The certificate's subject
DN with <I>"CN=proxy"</I> name component appended to the subject is used as the subject of the
certificate request. Also the certificate's signing algorithm is used as the certificate request
signing algorithm.
@para... | [
"Creates",
"a",
"certificate",
"request",
"from",
"the",
"specified",
"certificate",
"and",
"a",
"key",
"pair",
".",
"The",
"certificate",
"s",
"subject",
"DN",
"with",
"<I",
">",
"CN",
"=",
"proxy",
"<",
"/",
"I",
">",
"name",
"component",
"appended",
"... | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L962-L968 |
powermock/powermock | powermock-core/src/main/java/org/powermock/core/MockRepository.java | MockRepository.putAdditionalState | public static synchronized Object putAdditionalState(String key, Object value) {
"""
When a mock framework API needs to store additional state not applicable
for the other methods, it may use this method to do so.
@param key
The key under which the <tt>value</tt> is stored.
@param value
The value to store u... | java | public static synchronized Object putAdditionalState(String key, Object value) {
return additionalState.put(key, value);
} | [
"public",
"static",
"synchronized",
"Object",
"putAdditionalState",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"return",
"additionalState",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | When a mock framework API needs to store additional state not applicable
for the other methods, it may use this method to do so.
@param key
The key under which the <tt>value</tt> is stored.
@param value
The value to store under the specified <tt>key</tt>.
@return The previous object under the specified <tt>key</tt> or... | [
"When",
"a",
"mock",
"framework",
"API",
"needs",
"to",
"store",
"additional",
"state",
"not",
"applicable",
"for",
"the",
"other",
"methods",
"it",
"may",
"use",
"this",
"method",
"to",
"do",
"so",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-core/src/main/java/org/powermock/core/MockRepository.java#L240-L242 |
duracloud/management-console | account-management-monitor/src/main/java/org/duracloud/account/monitor/duplication/DuplicationMonitor.java | DuplicationMonitor.getSpaceCount | private long getSpaceCount(ContentStore store, String spaceId)
throws ContentStoreException {
"""
/*
Count the number of content items in a space in a DuraCloud account
"""
SpaceStatsDTOList stats =
store.getSpaceStats(spaceId, new Date(System.currentTimeMillis() - (24 * 60 * 60 * ... | java | private long getSpaceCount(ContentStore store, String spaceId)
throws ContentStoreException {
SpaceStatsDTOList stats =
store.getSpaceStats(spaceId, new Date(System.currentTimeMillis() - (24 * 60 * 60 * 1000)), new Date());
long count = 0;
if (stats != null && stats.size() ... | [
"private",
"long",
"getSpaceCount",
"(",
"ContentStore",
"store",
",",
"String",
"spaceId",
")",
"throws",
"ContentStoreException",
"{",
"SpaceStatsDTOList",
"stats",
"=",
"store",
".",
"getSpaceStats",
"(",
"spaceId",
",",
"new",
"Date",
"(",
"System",
".",
"cu... | /*
Count the number of content items in a space in a DuraCloud account | [
"/",
"*",
"Count",
"the",
"number",
"of",
"content",
"items",
"in",
"a",
"space",
"in",
"a",
"DuraCloud",
"account"
] | train | https://github.com/duracloud/management-console/blob/7331015c01f9ac5cc5c0aa8ae9a2a1a77e9f4ac6/account-management-monitor/src/main/java/org/duracloud/account/monitor/duplication/DuplicationMonitor.java#L209-L221 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java | DomainsInner.createOrUpdateOwnershipIdentifier | public DomainOwnershipIdentifierInner createOrUpdateOwnershipIdentifier(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) {
"""
Creates an ownership identifier for a domain or updates identifier details for an existing identifer.
Creates an ownersh... | java | public DomainOwnershipIdentifierInner createOrUpdateOwnershipIdentifier(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) {
return createOrUpdateOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name, domainOwnershipIdent... | [
"public",
"DomainOwnershipIdentifierInner",
"createOrUpdateOwnershipIdentifier",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
",",
"String",
"name",
",",
"DomainOwnershipIdentifierInner",
"domainOwnershipIdentifier",
")",
"{",
"return",
"createOrUpdateOwnershi... | Creates an ownership identifier for a domain or updates identifier details for an existing identifer.
Creates an ownership identifier for a domain or updates identifier details for an existing identifer.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param domainName Name of domain... | [
"Creates",
"an",
"ownership",
"identifier",
"for",
"a",
"domain",
"or",
"updates",
"identifier",
"details",
"for",
"an",
"existing",
"identifer",
".",
"Creates",
"an",
"ownership",
"identifier",
"for",
"a",
"domain",
"or",
"updates",
"identifier",
"details",
"fo... | 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/DomainsInner.java#L1521-L1523 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ServletStartedListener.java | ServletStartedListener.getConstraintFromHttpElement | private SecurityConstraint getConstraintFromHttpElement(SecurityMetadata securityMetadataFromDD, Collection<String> urlPatterns, ServletSecurityElement servletSecurity) {
"""
Gets the security constraint from the HttpConstraint element defined in the given ServletSecurityElement
with the given list of url pattern... | java | private SecurityConstraint getConstraintFromHttpElement(SecurityMetadata securityMetadataFromDD, Collection<String> urlPatterns, ServletSecurityElement servletSecurity) {
List<String> omissionMethods = new ArrayList<String>();
if (!servletSecurity.getMethodNames().isEmpty()) {
omissionMethod... | [
"private",
"SecurityConstraint",
"getConstraintFromHttpElement",
"(",
"SecurityMetadata",
"securityMetadataFromDD",
",",
"Collection",
"<",
"String",
">",
"urlPatterns",
",",
"ServletSecurityElement",
"servletSecurity",
")",
"{",
"List",
"<",
"String",
">",
"omissionMethods... | Gets the security constraint from the HttpConstraint element defined in the given ServletSecurityElement
with the given list of url patterns.
This constraint applies to all methods that are not explicitly overridden by the HttpMethodConstraint element. The method
constraints are defined as omission methods in this sec... | [
"Gets",
"the",
"security",
"constraint",
"from",
"the",
"HttpConstraint",
"element",
"defined",
"in",
"the",
"given",
"ServletSecurityElement",
"with",
"the",
"given",
"list",
"of",
"url",
"patterns",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ServletStartedListener.java#L322-L332 |
strator-dev/greenpepper | samples-application/src/main/java/com/greenpepper/samples/application/system/AccountManager.java | AccountManager.deleteGroup | public boolean deleteGroup(String name) {
"""
<p>deleteGroup.</p>
@param name a {@link java.lang.String} object.
@return a boolean.
"""
if (ADMINISTRATOR_GROUP_ID.equals(name))
{
throw new SystemException(String.format("Cannot delete '%s' group.", ADMINISTRATOR_GROUP_ID));
}
if (USER_GROUP_ID.e... | java | public boolean deleteGroup(String name)
{
if (ADMINISTRATOR_GROUP_ID.equals(name))
{
throw new SystemException(String.format("Cannot delete '%s' group.", ADMINISTRATOR_GROUP_ID));
}
if (USER_GROUP_ID.equals(name))
{
throw new SystemException(String.format("Cannot delete '%s' group.", USER_GROUP_ID));
... | [
"public",
"boolean",
"deleteGroup",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"ADMINISTRATOR_GROUP_ID",
".",
"equals",
"(",
"name",
")",
")",
"{",
"throw",
"new",
"SystemException",
"(",
"String",
".",
"format",
"(",
"\"Cannot delete '%s' group.\"",
",",
"AD... | <p>deleteGroup.</p>
@param name a {@link java.lang.String} object.
@return a boolean. | [
"<p",
">",
"deleteGroup",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/samples-application/src/main/java/com/greenpepper/samples/application/system/AccountManager.java#L79-L102 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java | MapWithProtoValuesSubject.usingDoubleToleranceForFieldDescriptorsForValues | public MapWithProtoValuesFluentAssertion<M> usingDoubleToleranceForFieldDescriptorsForValues(
double tolerance, Iterable<FieldDescriptor> fieldDescriptors) {
"""
Compares double fields with these explicitly specified fields using the provided absolute
tolerance.
@param tolerance A finite, non-negative to... | java | public MapWithProtoValuesFluentAssertion<M> usingDoubleToleranceForFieldDescriptorsForValues(
double tolerance, Iterable<FieldDescriptor> fieldDescriptors) {
return usingConfig(config.usingDoubleToleranceForFieldDescriptors(tolerance, fieldDescriptors));
} | [
"public",
"MapWithProtoValuesFluentAssertion",
"<",
"M",
">",
"usingDoubleToleranceForFieldDescriptorsForValues",
"(",
"double",
"tolerance",
",",
"Iterable",
"<",
"FieldDescriptor",
">",
"fieldDescriptors",
")",
"{",
"return",
"usingConfig",
"(",
"config",
".",
"usingDou... | Compares double fields with these explicitly specified fields using the provided absolute
tolerance.
@param tolerance A finite, non-negative tolerance. | [
"Compares",
"double",
"fields",
"with",
"these",
"explicitly",
"specified",
"fields",
"using",
"the",
"provided",
"absolute",
"tolerance",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java#L552-L555 |
wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/HalResourceFactory.java | HalResourceFactory.createResource | @Deprecated
public static HalResource createResource(ObjectNode model, String href) {
"""
Creates a HAL resource with state and a self link.
@param model The state of the resource
@param href The self link for the resource
@return New HAL resource
@deprecated just create {@link HalResource} and {@link Link} ... | java | @Deprecated
public static HalResource createResource(ObjectNode model, String href) {
return new HalResource(model, href);
} | [
"@",
"Deprecated",
"public",
"static",
"HalResource",
"createResource",
"(",
"ObjectNode",
"model",
",",
"String",
"href",
")",
"{",
"return",
"new",
"HalResource",
"(",
"model",
",",
"href",
")",
";",
"}"
] | Creates a HAL resource with state and a self link.
@param model The state of the resource
@param href The self link for the resource
@return New HAL resource
@deprecated just create {@link HalResource} and {@link Link} instances using the new constructors | [
"Creates",
"a",
"HAL",
"resource",
"with",
"state",
"and",
"a",
"self",
"link",
"."
] | train | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResourceFactory.java#L91-L94 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/Languages.java | Languages.getLanguageForLocale | public static Language getLanguageForLocale(Locale locale) {
"""
Get the best match for a locale, using American English as the final fallback if nothing
else fits. The returned language will be a country variant language (e.g. British English, not just English)
if available.
Note: this does not consider langua... | java | public static Language getLanguageForLocale(Locale locale) {
Language language = getLanguageForLanguageNameAndCountry(locale);
if (language != null) {
return language;
} else {
Language firstFallbackLanguage = getLanguageForLanguageNameOnly(locale);
if (firstFallbackLanguage != null) {
... | [
"public",
"static",
"Language",
"getLanguageForLocale",
"(",
"Locale",
"locale",
")",
"{",
"Language",
"language",
"=",
"getLanguageForLanguageNameAndCountry",
"(",
"locale",
")",
";",
"if",
"(",
"language",
"!=",
"null",
")",
"{",
"return",
"language",
";",
"}"... | Get the best match for a locale, using American English as the final fallback if nothing
else fits. The returned language will be a country variant language (e.g. British English, not just English)
if available.
Note: this does not consider languages added dynamically
@throws RuntimeException if no language was found a... | [
"Get",
"the",
"best",
"match",
"for",
"a",
"locale",
"using",
"American",
"English",
"as",
"the",
"final",
"fallback",
"if",
"nothing",
"else",
"fits",
".",
"The",
"returned",
"language",
"will",
"be",
"a",
"country",
"variant",
"language",
"(",
"e",
".",
... | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/Languages.java#L262-L278 |
spotify/crtauth-java | src/main/java/com/spotify/crtauth/CrtAuthClient.java | CrtAuthClient.createResponse | public String createResponse(String challenge)
throws IllegalArgumentException, KeyNotFoundException, ProtocolVersionException {
"""
Generate a response String using the Signer of this instance, additionally verifying that the
embedded serverName matches the serverName of this instance.
@param challenge ... | java | public String createResponse(String challenge)
throws IllegalArgumentException, KeyNotFoundException, ProtocolVersionException {
byte[] decodedChallenge = decode(challenge);
Challenge deserializedChallenge = CrtAuthCodec.deserializeChallenge(decodedChallenge);
if (!deserializedChallenge.getServerName(... | [
"public",
"String",
"createResponse",
"(",
"String",
"challenge",
")",
"throws",
"IllegalArgumentException",
",",
"KeyNotFoundException",
",",
"ProtocolVersionException",
"{",
"byte",
"[",
"]",
"decodedChallenge",
"=",
"decode",
"(",
"challenge",
")",
";",
"Challenge"... | Generate a response String using the Signer of this instance, additionally verifying that the
embedded serverName matches the serverName of this instance.
@param challenge A challenge String obtained from a server.
@return The response String to be returned to the server.
@throws IllegalArgumentException if there is s... | [
"Generate",
"a",
"response",
"String",
"using",
"the",
"Signer",
"of",
"this",
"instance",
"additionally",
"verifying",
"that",
"the",
"embedded",
"serverName",
"matches",
"the",
"serverName",
"of",
"this",
"instance",
"."
] | train | https://github.com/spotify/crtauth-java/blob/90f3b40323848740c915b195ad1b547fbeb41700/src/main/java/com/spotify/crtauth/CrtAuthClient.java#L60-L72 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.translationRotateTowards | public Matrix4d translationRotateTowards(Vector3dc pos, Vector3dc dir, Vector3dc up) {
"""
Set this matrix to a model transformation for a right-handed coordinate system,
that translates to the given <code>pos</code> and aligns the local <code>-z</code>
axis with <code>dir</code>.
<p>
This method is equivalent... | java | public Matrix4d translationRotateTowards(Vector3dc pos, Vector3dc dir, Vector3dc up) {
return translationRotateTowards(pos.x(), pos.y(), pos.z(), dir.x(), dir.y(), dir.z(), up.x(), up.y(), up.z());
} | [
"public",
"Matrix4d",
"translationRotateTowards",
"(",
"Vector3dc",
"pos",
",",
"Vector3dc",
"dir",
",",
"Vector3dc",
"up",
")",
"{",
"return",
"translationRotateTowards",
"(",
"pos",
".",
"x",
"(",
")",
",",
"pos",
".",
"y",
"(",
")",
",",
"pos",
".",
"... | Set this matrix to a model transformation for a right-handed coordinate system,
that translates to the given <code>pos</code> and aligns the local <code>-z</code>
axis with <code>dir</code>.
<p>
This method is equivalent to calling: <code>translation(pos).rotateTowards(dir, up)</code>
@see #translation(Vector3dc)
@see... | [
"Set",
"this",
"matrix",
"to",
"a",
"model",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"that",
"translates",
"to",
"the",
"given",
"<code",
">",
"pos<",
"/",
"code",
">",
"and",
"aligns",
"the",
"local",
"<code",
">",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L15377-L15379 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java | DocTreeScanner.visitParam | @Override
public R visitParam(ParamTree node, P p) {
"""
{@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning
"""
R r = scan(node.getName(), p);
r = scanAndReduce(node.getDescripti... | java | @Override
public R visitParam(ParamTree node, P p) {
R r = scan(node.getName(), p);
r = scanAndReduce(node.getDescription(), p, r);
return r;
} | [
"@",
"Override",
"public",
"R",
"visitParam",
"(",
"ParamTree",
"node",
",",
"P",
"p",
")",
"{",
"R",
"r",
"=",
"scan",
"(",
"node",
".",
"getName",
"(",
")",
",",
"p",
")",
";",
"r",
"=",
"scanAndReduce",
"(",
"node",
".",
"getDescription",
"(",
... | {@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"scans",
"the",
"children",
"in",
"left",
"to",
"right",
"order",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java#L320-L325 |
alkacon/opencms-core | src/org/opencms/importexport/CmsExport.java | CmsExport.exportFile | protected void exportFile(CmsFile file) throws CmsImportExportException, SAXException, IOException {
"""
Exports one single file with all its data and content.<p>
@param file the file to be exported
@throws CmsImportExportException if something goes wrong
@throws SAXException if something goes wrong process... | java | protected void exportFile(CmsFile file) throws CmsImportExportException, SAXException, IOException {
String source = trimResourceName(getCms().getSitePath(file));
I_CmsReport report = getReport();
m_exportCount++;
report.print(
org.opencms.report.Messages.get().container(
... | [
"protected",
"void",
"exportFile",
"(",
"CmsFile",
"file",
")",
"throws",
"CmsImportExportException",
",",
"SAXException",
",",
"IOException",
"{",
"String",
"source",
"=",
"trimResourceName",
"(",
"getCms",
"(",
")",
".",
"getSitePath",
"(",
"file",
")",
")",
... | Exports one single file with all its data and content.<p>
@param file the file to be exported
@throws CmsImportExportException if something goes wrong
@throws SAXException if something goes wrong processing the manifest.xml
@throws IOException if the ZIP entry for the file could be appended to the ZIP archive | [
"Exports",
"one",
"single",
"file",
"with",
"all",
"its",
"data",
"and",
"content",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsExport.java#L889-L927 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/CertificatesImpl.java | CertificatesImpl.listNextAsync | public Observable<Page<Certificate>> listNextAsync(final String nextPageLink, final CertificateListNextOptions certificateListNextOptions) {
"""
Lists all of the certificates that have been added to the specified account.
@param nextPageLink The NextLink from the previous successful call to List operation.
@pa... | java | public Observable<Page<Certificate>> listNextAsync(final String nextPageLink, final CertificateListNextOptions certificateListNextOptions) {
return listNextWithServiceResponseAsync(nextPageLink, certificateListNextOptions)
.map(new Func1<ServiceResponseWithHeaders<Page<Certificate>, CertificateListH... | [
"public",
"Observable",
"<",
"Page",
"<",
"Certificate",
">",
">",
"listNextAsync",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"CertificateListNextOptions",
"certificateListNextOptions",
")",
"{",
"return",
"listNextWithServiceResponseAsync",
"(",
"nextPageLink... | Lists all of the certificates that have been added to the specified account.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param certificateListNextOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return ... | [
"Lists",
"all",
"of",
"the",
"certificates",
"that",
"have",
"been",
"added",
"to",
"the",
"specified",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/CertificatesImpl.java#L1354-L1362 |
aboutsip/pkts | pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipParser.java | SipParser.consumeSeparator | private static int consumeSeparator(final Buffer buffer, final byte b) throws IndexOutOfBoundsException,
IOException {
"""
Helper function for checking stuff as described below. It is all the same pattern so...
(from rfc 3261 section 25.1)
When tokens are used or separators are used between element... | java | private static int consumeSeparator(final Buffer buffer, final byte b) throws IndexOutOfBoundsException,
IOException {
buffer.markReaderIndex();
int consumed = consumeSWS(buffer);
if (isNext(buffer, b)) {
buffer.readByte();
++consumed;
} else {
... | [
"private",
"static",
"int",
"consumeSeparator",
"(",
"final",
"Buffer",
"buffer",
",",
"final",
"byte",
"b",
")",
"throws",
"IndexOutOfBoundsException",
",",
"IOException",
"{",
"buffer",
".",
"markReaderIndex",
"(",
")",
";",
"int",
"consumed",
"=",
"consumeSWS... | Helper function for checking stuff as described below. It is all the same pattern so...
(from rfc 3261 section 25.1)
When tokens are used or separators are used between elements,
whitespace is often allowed before or after these characters:
STAR = SWS "*" SWS ; asterisk
SLASH = SWS "/" SWS ; slash
EQUAL = S... | [
"Helper",
"function",
"for",
"checking",
"stuff",
"as",
"described",
"below",
".",
"It",
"is",
"all",
"the",
"same",
"pattern",
"so",
"...",
"(",
"from",
"rfc",
"3261",
"section",
"25",
".",
"1",
")"
] | train | https://github.com/aboutsip/pkts/blob/0f06bb0dac76c812187829f580a8d476ca99a1a1/pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipParser.java#L957-L970 |
threerings/narya | core/src/main/java/com/threerings/presents/server/ShutdownManager.java | ShutdownManager.addConstraint | public void addConstraint (Shutdowner lhs, Constraint constraint, Shutdowner rhs) {
"""
Adds a constraint that a certain shutdowner must be run before another.
"""
switch (constraint) {
case RUNS_BEFORE:
_cycle.addShutdownConstraint(lhs, Lifecycle.Constraint.RUNS_BEFORE, rhs);
... | java | public void addConstraint (Shutdowner lhs, Constraint constraint, Shutdowner rhs)
{
switch (constraint) {
case RUNS_BEFORE:
_cycle.addShutdownConstraint(lhs, Lifecycle.Constraint.RUNS_BEFORE, rhs);
break;
case RUNS_AFTER:
_cycle.addShutdownConstraint(lhs, ... | [
"public",
"void",
"addConstraint",
"(",
"Shutdowner",
"lhs",
",",
"Constraint",
"constraint",
",",
"Shutdowner",
"rhs",
")",
"{",
"switch",
"(",
"constraint",
")",
"{",
"case",
"RUNS_BEFORE",
":",
"_cycle",
".",
"addShutdownConstraint",
"(",
"lhs",
",",
"Lifec... | Adds a constraint that a certain shutdowner must be run before another. | [
"Adds",
"a",
"constraint",
"that",
"a",
"certain",
"shutdowner",
"must",
"be",
"run",
"before",
"another",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ShutdownManager.java#L64-L74 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java | ResultIterator.onCheckRelation | private void onCheckRelation() {
"""
on check relation event, invokes populate entities and set relational
entities, in case relations are present.
"""
try
{
results = populateEntities(entityMetadata, client);
if (entityMetadata.isRelationViaJoinTable()
... | java | private void onCheckRelation()
{
try
{
results = populateEntities(entityMetadata, client);
if (entityMetadata.isRelationViaJoinTable()
|| (entityMetadata.getRelationNames() != null && !(entityMetadata.getRelationNames().isEmpty())))
{
... | [
"private",
"void",
"onCheckRelation",
"(",
")",
"{",
"try",
"{",
"results",
"=",
"populateEntities",
"(",
"entityMetadata",
",",
"client",
")",
";",
"if",
"(",
"entityMetadata",
".",
"isRelationViaJoinTable",
"(",
")",
"||",
"(",
"entityMetadata",
".",
"getRel... | on check relation event, invokes populate entities and set relational
entities, in case relations are present. | [
"on",
"check",
"relation",
"event",
"invokes",
"populate",
"entities",
"and",
"set",
"relational",
"entities",
"in",
"case",
"relations",
"are",
"present",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java#L238-L254 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.rawQueryWithFactory | public Cursor rawQueryWithFactory(
CursorFactory cursorFactory, String sql, String[] selectionArgs,
String editTable) {
"""
Runs the provided SQL and returns a cursor over the result set.
@param cursorFactory the cursor factory to use, or null for the default factory
@param sql the SQL ... | java | public Cursor rawQueryWithFactory(
CursorFactory cursorFactory, String sql, String[] selectionArgs,
String editTable) {
return rawQueryWithFactory(cursorFactory, sql, selectionArgs, editTable, null);
} | [
"public",
"Cursor",
"rawQueryWithFactory",
"(",
"CursorFactory",
"cursorFactory",
",",
"String",
"sql",
",",
"String",
"[",
"]",
"selectionArgs",
",",
"String",
"editTable",
")",
"{",
"return",
"rawQueryWithFactory",
"(",
"cursorFactory",
",",
"sql",
",",
"selecti... | Runs the provided SQL and returns a cursor over the result set.
@param cursorFactory the cursor factory to use, or null for the default factory
@param sql the SQL query. The SQL string must not be ; terminated
@param selectionArgs You may include ?s in where clause in the query,
which will be replaced by the values fr... | [
"Runs",
"the",
"provided",
"SQL",
"and",
"returns",
"a",
"cursor",
"over",
"the",
"result",
"set",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L1292-L1296 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/math/Combination.java | Combination.count | public static long count(int n, int m) {
"""
计算组合数,即C(n, m) = n!/((n-m)! * m!)
@param n 总数
@param m 选择的个数
@return 组合数
"""
if(0 == m) {
return 1;
}
if(n == m) {
return NumberUtil.factorial(n) / NumberUtil.factorial(m);
}
return (n > m) ? NumberUtil.factorial(n, n - m) / NumberUtil.fa... | java | public static long count(int n, int m) {
if(0 == m) {
return 1;
}
if(n == m) {
return NumberUtil.factorial(n) / NumberUtil.factorial(m);
}
return (n > m) ? NumberUtil.factorial(n, n - m) / NumberUtil.factorial(m) : 0;
} | [
"public",
"static",
"long",
"count",
"(",
"int",
"n",
",",
"int",
"m",
")",
"{",
"if",
"(",
"0",
"==",
"m",
")",
"{",
"return",
"1",
";",
"}",
"if",
"(",
"n",
"==",
"m",
")",
"{",
"return",
"NumberUtil",
".",
"factorial",
"(",
"n",
")",
"/",
... | 计算组合数,即C(n, m) = n!/((n-m)! * m!)
@param n 总数
@param m 选择的个数
@return 组合数 | [
"计算组合数,即C",
"(",
"n",
"m",
")",
"=",
"n!",
"/",
"((",
"n",
"-",
"m",
")",
"!",
"*",
"m!",
")"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/math/Combination.java#L37-L45 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.updateState | private void updateState(CmsDbContext dbc, CmsResource resource, boolean resourceState)
throws CmsDataAccessException {
"""
Updates the state of a resource, depending on the <code>resourceState</code> parameter.<p>
@param dbc the db context
@param resource the resource
@param resourceState if <code>true</... | java | private void updateState(CmsDbContext dbc, CmsResource resource, boolean resourceState)
throws CmsDataAccessException {
CmsUUID projectId = ((dbc.getProjectId() == null) || dbc.getProjectId().isNullUUID())
? dbc.currentProject().getUuid()
: dbc.getProjectId();
resource.setUserLastMo... | [
"private",
"void",
"updateState",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
",",
"boolean",
"resourceState",
")",
"throws",
"CmsDataAccessException",
"{",
"CmsUUID",
"projectId",
"=",
"(",
"(",
"dbc",
".",
"getProjectId",
"(",
")",
"==",
"null"... | Updates the state of a resource, depending on the <code>resourceState</code> parameter.<p>
@param dbc the db context
@param resource the resource
@param resourceState if <code>true</code> the resource state will be updated, if not just the structure state.
@throws CmsDataAccessException if something goes wrong | [
"Updates",
"the",
"state",
"of",
"a",
"resource",
"depending",
"on",
"the",
"<code",
">",
"resourceState<",
"/",
"code",
">",
"parameter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L11962-L11976 |
52inc/android-52Kit | library/src/main/java/com/ftinc/kit/util/MediaUtils.java | MediaUtils.nonDuplicateFile | public static File nonDuplicateFile(File dir, String name) {
"""
Create a non duplicate file in the given directory with the given name, appending a duplicate
counter to the end of the name but before the extension like: `some_file(1).jpg`
@param dir The parent directory of the desired file
@param name The de... | java | public static File nonDuplicateFile(File dir, String name){
int count = 1;
File outputFile = new File(dir, name);
while(outputFile.exists()){
String cleanName = cleanFilename(name);
int extIndex = name.lastIndexOf(".");
String extension = "";
if(ex... | [
"public",
"static",
"File",
"nonDuplicateFile",
"(",
"File",
"dir",
",",
"String",
"name",
")",
"{",
"int",
"count",
"=",
"1",
";",
"File",
"outputFile",
"=",
"new",
"File",
"(",
"dir",
",",
"name",
")",
";",
"while",
"(",
"outputFile",
".",
"exists",
... | Create a non duplicate file in the given directory with the given name, appending a duplicate
counter to the end of the name but before the extension like: `some_file(1).jpg`
@param dir The parent directory of the desired file
@param name The desired name of the file
@return The non-duplicate file | [
"Create",
"a",
"non",
"duplicate",
"file",
"in",
"the",
"given",
"directory",
"with",
"the",
"given",
"name",
"appending",
"a",
"duplicate",
"counter",
"to",
"the",
"end",
"of",
"the",
"name",
"but",
"before",
"the",
"extension",
"like",
":",
"some_file",
... | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/MediaUtils.java#L317-L334 |
sniffy/sniffy | sniffy-core/src/main/java/io/sniffy/LegacySpy.java | LegacySpy.expectBetween | @Deprecated
public C expectBetween(int minAllowedStatements, int maxAllowedStatements) {
"""
Alias for {@link #expectBetween(int, int, Threads, Query)} with arguments {@code minAllowedStatements}, {@code maxAllowedStatements}, {@link Threads#CURRENT}, {@link Query#ANY}
@since 2.0
"""
return expect... | java | @Deprecated
public C expectBetween(int minAllowedStatements, int maxAllowedStatements) {
return expect(SqlQueries.queriesBetween(minAllowedStatements, maxAllowedStatements));
} | [
"@",
"Deprecated",
"public",
"C",
"expectBetween",
"(",
"int",
"minAllowedStatements",
",",
"int",
"maxAllowedStatements",
")",
"{",
"return",
"expect",
"(",
"SqlQueries",
".",
"queriesBetween",
"(",
"minAllowedStatements",
",",
"maxAllowedStatements",
")",
")",
";"... | Alias for {@link #expectBetween(int, int, Threads, Query)} with arguments {@code minAllowedStatements}, {@code maxAllowedStatements}, {@link Threads#CURRENT}, {@link Query#ANY}
@since 2.0 | [
"Alias",
"for",
"{"
] | train | https://github.com/sniffy/sniffy/blob/7bdddb9593e6b6e9fe5c7c87519f864acbc3a5c0/sniffy-core/src/main/java/io/sniffy/LegacySpy.java#L586-L589 |
guardtime/ksi-java-sdk | ksi-common/src/main/java/com/guardtime/ksi/util/Base16.java | Base16.encodeWithColons | public static String encodeWithColons(byte[] in, int off, int len) {
"""
Encodes the given bytes into a base-16 string, inserting colons after
every 2 characters of output.
@param in
the bytes to encode.
@param off
the start offset of the data within {@code in}.
@param len
the number of bytes to encode.
... | java | public static String encodeWithColons(byte[] in, int off, int len) {
return inst.encode(in, off, len, ":", 2).toString();
} | [
"public",
"static",
"String",
"encodeWithColons",
"(",
"byte",
"[",
"]",
"in",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"return",
"inst",
".",
"encode",
"(",
"in",
",",
"off",
",",
"len",
",",
"\":\"",
",",
"2",
")",
".",
"toString",
"(",
... | Encodes the given bytes into a base-16 string, inserting colons after
every 2 characters of output.
@param in
the bytes to encode.
@param off
the start offset of the data within {@code in}.
@param len
the number of bytes to encode.
@return The formatted base-16 string. | [
"Encodes",
"the",
"given",
"bytes",
"into",
"a",
"base",
"-",
"16",
"string",
"inserting",
"colons",
"after",
"every",
"2",
"characters",
"of",
"output",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/util/Base16.java#L95-L97 |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/storage/DataSet.java | DataSet.findRowIgnoreCase | public DataRow findRowIgnoreCase(int columnIndex, String value) {
"""
checks whether dataset contains the value given (ignoring the case)
@param columnIndex
@param value
@return
"""
for (DataRow dataRow : dataRows)
{
String columnValue = (String) dataRow.getColumn(columnIndex);
if (value.equalsIgn... | java | public DataRow findRowIgnoreCase(int columnIndex, String value)
{
for (DataRow dataRow : dataRows)
{
String columnValue = (String) dataRow.getColumn(columnIndex);
if (value.equalsIgnoreCase(columnValue))
{
return dataRow;
}
}
return null;
} | [
"public",
"DataRow",
"findRowIgnoreCase",
"(",
"int",
"columnIndex",
",",
"String",
"value",
")",
"{",
"for",
"(",
"DataRow",
"dataRow",
":",
"dataRows",
")",
"{",
"String",
"columnValue",
"=",
"(",
"String",
")",
"dataRow",
".",
"getColumn",
"(",
"columnInd... | checks whether dataset contains the value given (ignoring the case)
@param columnIndex
@param value
@return | [
"checks",
"whether",
"dataset",
"contains",
"the",
"value",
"given",
"(",
"ignoring",
"the",
"case",
")"
] | train | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/storage/DataSet.java#L76-L87 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImageCompression.java | FSImageCompression.createCompression | static FSImageCompression createCompression(Configuration conf, boolean forceUncompressed)
throws IOException {
"""
Create a compression instance based on the user's configuration in the given
Configuration object.
@throws IOException if the specified codec is not available.
"""
boolean compressImage... | java | static FSImageCompression createCompression(Configuration conf, boolean forceUncompressed)
throws IOException {
boolean compressImage = (!forceUncompressed) && conf.getBoolean(
HdfsConstants.DFS_IMAGE_COMPRESS_KEY,
HdfsConstants.DFS_IMAGE_COMPRESS_DEFAULT);
if (!compressImage) {
return cr... | [
"static",
"FSImageCompression",
"createCompression",
"(",
"Configuration",
"conf",
",",
"boolean",
"forceUncompressed",
")",
"throws",
"IOException",
"{",
"boolean",
"compressImage",
"=",
"(",
"!",
"forceUncompressed",
")",
"&&",
"conf",
".",
"getBoolean",
"(",
"Hdf... | Create a compression instance based on the user's configuration in the given
Configuration object.
@throws IOException if the specified codec is not available. | [
"Create",
"a",
"compression",
"instance",
"based",
"on",
"the",
"user",
"s",
"configuration",
"in",
"the",
"given",
"Configuration",
"object",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImageCompression.java#L72-L86 |
aaberg/sql2o | core/src/main/java/org/sql2o/Sql2o.java | Sql2o.runInTransaction | public void runInTransaction(StatementRunnable runnable, Object argument) {
"""
Calls the {@link StatementRunnable#run(Connection, Object)} method on the {@link StatementRunnable} parameter. All statements
run on the {@link Connection} instance in the {@link StatementRunnable#run(Connection, Object) run} method w... | java | public void runInTransaction(StatementRunnable runnable, Object argument){
runInTransaction(runnable, argument, java.sql.Connection.TRANSACTION_READ_COMMITTED);
} | [
"public",
"void",
"runInTransaction",
"(",
"StatementRunnable",
"runnable",
",",
"Object",
"argument",
")",
"{",
"runInTransaction",
"(",
"runnable",
",",
"argument",
",",
"java",
".",
"sql",
".",
"Connection",
".",
"TRANSACTION_READ_COMMITTED",
")",
";",
"}"
] | Calls the {@link StatementRunnable#run(Connection, Object)} method on the {@link StatementRunnable} parameter. All statements
run on the {@link Connection} instance in the {@link StatementRunnable#run(Connection, Object) run} method will be
executed in a transaction. The transaction will automatically be committed if t... | [
"Calls",
"the",
"{",
"@link",
"StatementRunnable#run",
"(",
"Connection",
"Object",
")",
"}",
"method",
"on",
"the",
"{",
"@link",
"StatementRunnable",
"}",
"parameter",
".",
"All",
"statements",
"run",
"on",
"the",
"{",
"@link",
"Connection",
"}",
"instance",... | train | https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/Sql2o.java#L360-L362 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/util/SparseDoubleArray.java | SparseDoubleArray.dividePrimitive | public double dividePrimitive(int index, double value) {
"""
Divides the specified value to the index by the provided value and stores
the result at the index (just as {@code array[index] /= value})
@param index the position in the array
@param value the value by which the value at the index will be divided
... | java | public double dividePrimitive(int index, double value) {
if (index < 0 || index >= maxLength)
throw new ArrayIndexOutOfBoundsException(
"invalid index: " + index);
int pos = Arrays.binarySearch(indices, index);
// The divide operation is dividin... | [
"public",
"double",
"dividePrimitive",
"(",
"int",
"index",
",",
"double",
"value",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"maxLength",
")",
"throw",
"new",
"ArrayIndexOutOfBoundsException",
"(",
"\"invalid index: \"",
"+",
"index",
")",
... | Divides the specified value to the index by the provided value and stores
the result at the index (just as {@code array[index] /= value})
@param index the position in the array
@param value the value by which the value at the index will be divided
@return the new value stored at the index | [
"Divides",
"the",
"specified",
"value",
"to",
"the",
"index",
"by",
"the",
"provided",
"value",
"and",
"stores",
"the",
"result",
"at",
"the",
"index",
"(",
"just",
"as",
"{",
"@code",
"array",
"[",
"index",
"]",
"/",
"=",
"value",
"}",
")"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/util/SparseDoubleArray.java#L252-L290 |
dhanji/sitebricks | sitebricks-mail/src/main/java/com/google/sitebricks/mail/imap/MessageStatusExtractor.java | MessageStatusExtractor.isUnterminatedString | @VisibleForTesting
static boolean isUnterminatedString(String message, boolean alreadyInString) {
"""
Check for string termination, will check for quote escaping, but only if it's escaped
within a string... otherwise it's illegal and we'll treat it as a regular quote.
A trailing backslash indicates a \CRLF was... | java | @VisibleForTesting
static boolean isUnterminatedString(String message, boolean alreadyInString) {
boolean escaped = false;
boolean inString = alreadyInString;
for (int i = 0; i < message.length(); i++) {
final char c = message.charAt(i);
if (inString) {
if (c == '\\') {
escap... | [
"@",
"VisibleForTesting",
"static",
"boolean",
"isUnterminatedString",
"(",
"String",
"message",
",",
"boolean",
"alreadyInString",
")",
"{",
"boolean",
"escaped",
"=",
"false",
";",
"boolean",
"inString",
"=",
"alreadyInString",
";",
"for",
"(",
"int",
"i",
"="... | Check for string termination, will check for quote escaping, but only if it's escaped
within a string... otherwise it's illegal and we'll treat it as a regular quote.
A trailing backslash indicates a \CRLF was received (as envisaged in RFC 822 3.4.5). | [
"Check",
"for",
"string",
"termination",
"will",
"check",
"for",
"quote",
"escaping",
"but",
"only",
"if",
"it",
"s",
"escaped",
"within",
"a",
"string",
"...",
"otherwise",
"it",
"s",
"illegal",
"and",
"we",
"ll",
"treat",
"it",
"as",
"a",
"regular",
"q... | train | https://github.com/dhanji/sitebricks/blob/8682029a78bd48fb8566173d970800499e9e5d97/sitebricks-mail/src/main/java/com/google/sitebricks/mail/imap/MessageStatusExtractor.java#L138-L157 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.vpnDeviceConfigurationScript | public String vpnDeviceConfigurationScript(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) {
"""
Gets a xml format representation for vpn device configuration script.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewa... | java | public String vpnDeviceConfigurationScript(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) {
return vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body();
... | [
"public",
"String",
"vpnDeviceConfigurationScript",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayConnectionName",
",",
"VpnDeviceScriptParameters",
"parameters",
")",
"{",
"return",
"vpnDeviceConfigurationScriptWithServiceResponseAsync",
"(",
"resourceGr... | Gets a xml format representation for vpn device configuration script.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated.
@param parameters Parameters supplied to the gene... | [
"Gets",
"a",
"xml",
"format",
"representation",
"for",
"vpn",
"device",
"configuration",
"script",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L2978-L2980 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableDocument.java | MutableDocument.setBoolean | @NonNull
@Override
public MutableDocument setBoolean(@NonNull String key, boolean value) {
"""
Set a boolean value for the given key
@param key the key.
@param key the boolean value.
@return this MutableDocument instance
"""
return setValue(key, value);
} | java | @NonNull
@Override
public MutableDocument setBoolean(@NonNull String key, boolean value) {
return setValue(key, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableDocument",
"setBoolean",
"(",
"@",
"NonNull",
"String",
"key",
",",
"boolean",
"value",
")",
"{",
"return",
"setValue",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Set a boolean value for the given key
@param key the key.
@param key the boolean value.
@return this MutableDocument instance | [
"Set",
"a",
"boolean",
"value",
"for",
"the",
"given",
"key"
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableDocument.java#L236-L240 |
JoeKerouac/utils | src/main/java/com/joe/utils/collection/CollectionUtil.java | CollectionUtil.intersection | public static <T> List<T> intersection(List<T> arr1, List<T> arr2) {
"""
求集合交集
@param arr1 集合1
@param arr2 集合2
@param <T> 集合中的数据
@return 集合的交集
"""
return intersection(arr1, 0, arr1.size(), arr2, 0, arr2.size());
} | java | public static <T> List<T> intersection(List<T> arr1, List<T> arr2) {
return intersection(arr1, 0, arr1.size(), arr2, 0, arr2.size());
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"intersection",
"(",
"List",
"<",
"T",
">",
"arr1",
",",
"List",
"<",
"T",
">",
"arr2",
")",
"{",
"return",
"intersection",
"(",
"arr1",
",",
"0",
",",
"arr1",
".",
"size",
"(",
")",
","... | 求集合交集
@param arr1 集合1
@param arr2 集合2
@param <T> 集合中的数据
@return 集合的交集 | [
"求集合交集"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/collection/CollectionUtil.java#L467-L469 |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/data/Parser.java | Parser.parseString | public Object parseString(Schema schema, String input) {
"""
Method is used to parse String data to the proper Java types.
@param schema Input schema to parse the String data by.
@param input Java type specific to the schema supplied.
@return Java type for the
@throws DataException Exception... | java | public Object parseString(Schema schema, String input) {
checkSchemaAndInput(schema, input);
if (null == input) {
return null;
}
TypeParser parser = findParser(schema);
try {
Object result = parser.parseString(input, schema);
return result;
} catch (Exception ex) {
Str... | [
"public",
"Object",
"parseString",
"(",
"Schema",
"schema",
",",
"String",
"input",
")",
"{",
"checkSchemaAndInput",
"(",
"schema",
",",
"input",
")",
";",
"if",
"(",
"null",
"==",
"input",
")",
"{",
"return",
"null",
";",
"}",
"TypeParser",
"parser",
"=... | Method is used to parse String data to the proper Java types.
@param schema Input schema to parse the String data by.
@param input Java type specific to the schema supplied.
@return Java type for the
@throws DataException Exception is thrown when there is an exception thrown while parsing the input st... | [
"Method",
"is",
"used",
"to",
"parse",
"String",
"data",
"to",
"the",
"proper",
"Java",
"types",
"."
] | train | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/data/Parser.java#L99-L115 |
bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/uac/LocalSubjectUserAccessControl.java | LocalSubjectUserAccessControl.verifyPermissionToGrantRoles | private void verifyPermissionToGrantRoles(Subject subject, Iterable<RoleIdentifier> roleIds) {
"""
Verifies whether the user has permission to grant all of the provided roles. If not it throws an UnauthorizedException.
@throws UnauthorizedException User did not have the permission to grant at least one role.
... | java | private void verifyPermissionToGrantRoles(Subject subject, Iterable<RoleIdentifier> roleIds) {
Set<RoleIdentifier> unauthorizedIds = Sets.newTreeSet();
boolean anyAuthorized = false;
for (RoleIdentifier roleId : roleIds) {
// Verify the caller has permission to grant this role
... | [
"private",
"void",
"verifyPermissionToGrantRoles",
"(",
"Subject",
"subject",
",",
"Iterable",
"<",
"RoleIdentifier",
">",
"roleIds",
")",
"{",
"Set",
"<",
"RoleIdentifier",
">",
"unauthorizedIds",
"=",
"Sets",
".",
"newTreeSet",
"(",
")",
";",
"boolean",
"anyAu... | Verifies whether the user has permission to grant all of the provided roles. If not it throws an UnauthorizedException.
@throws UnauthorizedException User did not have the permission to grant at least one role. | [
"Verifies",
"whether",
"the",
"user",
"has",
"permission",
"to",
"grant",
"all",
"of",
"the",
"provided",
"roles",
".",
"If",
"not",
"it",
"throws",
"an",
"UnauthorizedException",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/uac/LocalSubjectUserAccessControl.java#L594-L618 |
petergeneric/stdlib | guice/common/src/main/java/com/peterphi/std/guice/apploader/impl/GuiceFactory.java | GuiceFactory.applyConfigs | private static void applyConfigs(final ClassLoader classloader, final GuiceConfig config) {
"""
Discover and add to the configuration any properties on disk and on the network
@param classloader
@param config
"""
// Load all the local configs
for (String configFile : getPropertyFiles(config))
{
tr... | java | private static void applyConfigs(final ClassLoader classloader, final GuiceConfig config)
{
// Load all the local configs
for (String configFile : getPropertyFiles(config))
{
try
{
for (PropertyFile properties : loadConfig(classloader, configFile))
config.setAll(properties);
}
catch (IOExcep... | [
"private",
"static",
"void",
"applyConfigs",
"(",
"final",
"ClassLoader",
"classloader",
",",
"final",
"GuiceConfig",
"config",
")",
"{",
"// Load all the local configs",
"for",
"(",
"String",
"configFile",
":",
"getPropertyFiles",
"(",
"config",
")",
")",
"{",
"t... | Discover and add to the configuration any properties on disk and on the network
@param classloader
@param config | [
"Discover",
"and",
"add",
"to",
"the",
"configuration",
"any",
"properties",
"on",
"disk",
"and",
"on",
"the",
"network"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/common/src/main/java/com/peterphi/std/guice/apploader/impl/GuiceFactory.java#L338-L363 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java | CommonMpJwtFat.buildAppSecureUrl | public String buildAppSecureUrl(LibertyServer theServer, String root, String app) throws Exception {
"""
Build the https app url
@param theServer - The server where the app is running (used to get the port)
@param root - the root context of the app
@param app - the specific app to run
@return - returns the f... | java | public String buildAppSecureUrl(LibertyServer theServer, String root, String app) throws Exception {
return SecurityFatHttpUtils.getServerSecureUrlBase(theServer) + root + "/rest/" + app + "/" + MpJwtFatConstants.MPJWT_GENERIC_APP_NAME;
} | [
"public",
"String",
"buildAppSecureUrl",
"(",
"LibertyServer",
"theServer",
",",
"String",
"root",
",",
"String",
"app",
")",
"throws",
"Exception",
"{",
"return",
"SecurityFatHttpUtils",
".",
"getServerSecureUrlBase",
"(",
"theServer",
")",
"+",
"root",
"+",
"\"/... | Build the https app url
@param theServer - The server where the app is running (used to get the port)
@param root - the root context of the app
@param app - the specific app to run
@return - returns the full url to invoke
@throws Exception | [
"Build",
"the",
"https",
"app",
"url"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java#L144-L148 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/converter/AbstractTypeConverter.java | AbstractTypeConverter.parse | public Object parse(String value, Class type) {
"""
{@inheritDoc}
Template implementation of the <code>convert()</code> method. Takes care
of handling null and empty string values. Once these basic operations
are handled, will delegate to the <code>doConvert()</code> method of
subclasses.
"""
if ... | java | public Object parse(String value, Class type)
{
if (StringUtil.isBlank(value))
{
return null;
}
return doConvert(value.trim(), type);
} | [
"public",
"Object",
"parse",
"(",
"String",
"value",
",",
"Class",
"type",
")",
"{",
"if",
"(",
"StringUtil",
".",
"isBlank",
"(",
"value",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"doConvert",
"(",
"value",
".",
"trim",
"(",
")",
",",
... | {@inheritDoc}
Template implementation of the <code>convert()</code> method. Takes care
of handling null and empty string values. Once these basic operations
are handled, will delegate to the <code>doConvert()</code> method of
subclasses. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/converter/AbstractTypeConverter.java#L43-L51 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java | MemberSummaryBuilder.buildEnumConstantsSummary | public void buildEnumConstantsSummary(XMLNode node, Content memberSummaryTree) {
"""
Build the summary for the enum constants.
@param node the XML element that specifies which components to document
@param memberSummaryTree the content tree to which the documentation will be added
"""
MemberSummary... | java | public void buildEnumConstantsSummary(XMLNode node, Content memberSummaryTree) {
MemberSummaryWriter writer =
memberSummaryWriters[VisibleMemberMap.ENUM_CONSTANTS];
VisibleMemberMap visibleMemberMap =
visibleMemberMaps[VisibleMemberMap.ENUM_CONSTANTS];
addSummary(... | [
"public",
"void",
"buildEnumConstantsSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"memberSummaryTree",
")",
"{",
"MemberSummaryWriter",
"writer",
"=",
"memberSummaryWriters",
"[",
"VisibleMemberMap",
".",
"ENUM_CONSTANTS",
"]",
";",
"VisibleMemberMap",
"visibleMember... | Build the summary for the enum constants.
@param node the XML element that specifies which components to document
@param memberSummaryTree the content tree to which the documentation will be added | [
"Build",
"the",
"summary",
"for",
"the",
"enum",
"constants",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java#L208-L214 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_automaticCall_identifier_GET | public OvhCallsGenerated billingAccount_line_serviceName_automaticCall_identifier_GET(String billingAccount, String serviceName, String identifier) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/line/{serviceName}/automaticCall/{identifier}
@param billingAccount [requ... | java | public OvhCallsGenerated billingAccount_line_serviceName_automaticCall_identifier_GET(String billingAccount, String serviceName, String identifier) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/automaticCall/{identifier}";
StringBuilder sb = path(qPath, billingAccount, serviceN... | [
"public",
"OvhCallsGenerated",
"billingAccount_line_serviceName_automaticCall_identifier_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"identifier",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/l... | Get this object properties
REST: GET /telephony/{billingAccount}/line/{serviceName}/automaticCall/{identifier}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param identifier [required] Generated call identifier | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L1784-L1789 |
neoremind/fluent-validator | fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/QuickValidator.java | QuickValidator.doAndGetComplexResult2 | public static ComplexResult2 doAndGetComplexResult2(Decorator decorator) {
"""
Execute validation by using a new FluentValidator instance and without a shared context.
The result type is {@link ComplexResult2}
@param decorator Same as decorator design pattern, provided to add more functions to the fluentValida... | java | public static ComplexResult2 doAndGetComplexResult2(Decorator decorator) {
return validate(decorator, FluentValidator.checkAll(), null, ResultCollectors.toComplex2());
} | [
"public",
"static",
"ComplexResult2",
"doAndGetComplexResult2",
"(",
"Decorator",
"decorator",
")",
"{",
"return",
"validate",
"(",
"decorator",
",",
"FluentValidator",
".",
"checkAll",
"(",
")",
",",
"null",
",",
"ResultCollectors",
".",
"toComplex2",
"(",
")",
... | Execute validation by using a new FluentValidator instance and without a shared context.
The result type is {@link ComplexResult2}
@param decorator Same as decorator design pattern, provided to add more functions to the fluentValidator
@return ComplexResult2 | [
"Execute",
"validation",
"by",
"using",
"a",
"new",
"FluentValidator",
"instance",
"and",
"without",
"a",
"shared",
"context",
".",
"The",
"result",
"type",
"is",
"{",
"@link",
"ComplexResult2",
"}"
] | train | https://github.com/neoremind/fluent-validator/blob/b516970591aa9468b44ba63938b98ec341fd6ead/fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/QuickValidator.java#L62-L64 |
MenoData/Time4J | base/src/main/java/net/time4j/tz/model/GregorianTimezoneRule.java | GregorianTimezoneRule.ofFixedDay | public static GregorianTimezoneRule ofFixedDay(
Month month,
int dayOfMonth,
int timeOfDay,
OffsetIndicator indicator,
int savings
) {
"""
/*[deutsch]
<p>Konstruiert ein Muster für einen festen Tag im angegebenen
Monat. </p>
@param month calendar month
... | java | public static GregorianTimezoneRule ofFixedDay(
Month month,
int dayOfMonth,
int timeOfDay,
OffsetIndicator indicator,
int savings
) {
return new FixedDayPattern(month, dayOfMonth, timeOfDay, indicator, savings);
} | [
"public",
"static",
"GregorianTimezoneRule",
"ofFixedDay",
"(",
"Month",
"month",
",",
"int",
"dayOfMonth",
",",
"int",
"timeOfDay",
",",
"OffsetIndicator",
"indicator",
",",
"int",
"savings",
")",
"{",
"return",
"new",
"FixedDayPattern",
"(",
"month",
",",
"day... | /*[deutsch]
<p>Konstruiert ein Muster für einen festen Tag im angegebenen
Monat. </p>
@param month calendar month
@param dayOfMonth day of month (1 - 31)
@param timeOfDay clock time in seconds after midnight when time switch happens
@param indicator offset indicator
@param savings fixed D... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Konstruiert",
"ein",
"Muster",
"fü",
";",
"r",
"einen",
"festen",
"Tag",
"im",
"angegebenen",
"Monat",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/tz/model/GregorianTimezoneRule.java#L166-L176 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java | OdsElements.writeSettings | public void writeSettings(final XMLUtil xmlUtil, final ZipUTF8Writer writer) throws IOException {
"""
Write the settings element to a writer.
@param xmlUtil the xml util
@param writer the writer
@throws IOException if write fails
"""
this.settingsElement.setTables(this.getTables());
thi... | java | public void writeSettings(final XMLUtil xmlUtil, final ZipUTF8Writer writer) throws IOException {
this.settingsElement.setTables(this.getTables());
this.logger.log(Level.FINER, "Writing odselement: settingsElement to zip file");
this.settingsElement.write(xmlUtil, writer);
} | [
"public",
"void",
"writeSettings",
"(",
"final",
"XMLUtil",
"xmlUtil",
",",
"final",
"ZipUTF8Writer",
"writer",
")",
"throws",
"IOException",
"{",
"this",
".",
"settingsElement",
".",
"setTables",
"(",
"this",
".",
"getTables",
"(",
")",
")",
";",
"this",
".... | Write the settings element to a writer.
@param xmlUtil the xml util
@param writer the writer
@throws IOException if write fails | [
"Write",
"the",
"settings",
"element",
"to",
"a",
"writer",
"."
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java#L411-L415 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/parser/PdfContentStreamProcessor.java | PdfContentStreamProcessor.getStringWidth | public float getStringWidth(String string, float tj) {
"""
Gets the width of a String.
@param string the string that needs measuring
@param tj text adjustment
@return the width of a String
"""
DocumentFont font = gs().font;
char[] chars = string.toCharArray();
float totalWidth = 0;
for (int i = ... | java | public float getStringWidth(String string, float tj) {
DocumentFont font = gs().font;
char[] chars = string.toCharArray();
float totalWidth = 0;
for (int i = 0; i < chars.length; i++) {
float w = font.getWidth(chars[i]) / 1000.0f;
float wordSpacing = chars[i] == 32 ? gs().wordSpacing : 0f;
total... | [
"public",
"float",
"getStringWidth",
"(",
"String",
"string",
",",
"float",
"tj",
")",
"{",
"DocumentFont",
"font",
"=",
"gs",
"(",
")",
".",
"font",
";",
"char",
"[",
"]",
"chars",
"=",
"string",
".",
"toCharArray",
"(",
")",
";",
"float",
"totalWidth... | Gets the width of a String.
@param string the string that needs measuring
@param tj text adjustment
@return the width of a String | [
"Gets",
"the",
"width",
"of",
"a",
"String",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/parser/PdfContentStreamProcessor.java#L225-L237 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_worklight_new_GET | public ArrayList<String> license_worklight_new_GET(String ip, Boolean lessThan1000Users, OvhWorkLightVersionEnum version) throws IOException {
"""
Get allowed durations for 'new' option
REST: GET /order/license/worklight/new
@param version [required] This license version
@param ip [required] Ip on which this ... | java | public ArrayList<String> license_worklight_new_GET(String ip, Boolean lessThan1000Users, OvhWorkLightVersionEnum version) throws IOException {
String qPath = "/order/license/worklight/new";
StringBuilder sb = path(qPath);
query(sb, "ip", ip);
query(sb, "lessThan1000Users", lessThan1000Users);
query(sb, "versi... | [
"public",
"ArrayList",
"<",
"String",
">",
"license_worklight_new_GET",
"(",
"String",
"ip",
",",
"Boolean",
"lessThan1000Users",
",",
"OvhWorkLightVersionEnum",
"version",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/license/worklight/new\"",
";... | Get allowed durations for 'new' option
REST: GET /order/license/worklight/new
@param version [required] This license version
@param ip [required] Ip on which this license would be installed (for dedicated your main server Ip)
@param lessThan1000Users [required] Does your company have less than 1000 potential users | [
"Get",
"allowed",
"durations",
"for",
"new",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1597-L1605 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/selector/ExecutorComparator.java | ExecutorComparator.getLstDispatchedTimeComparator | private static FactorComparator<Executor> getLstDispatchedTimeComparator(final int weight) {
"""
function defines the last dispatched time comparator.
@param weight weight of the comparator.
"""
return FactorComparator
.create(LSTDISPATCHED_COMPARATOR_NAME, weight, new Comparator<Executor>() {
... | java | private static FactorComparator<Executor> getLstDispatchedTimeComparator(final int weight) {
return FactorComparator
.create(LSTDISPATCHED_COMPARATOR_NAME, weight, new Comparator<Executor>() {
@Override
public int compare(final Executor o1, final Executor o2) {
final Executo... | [
"private",
"static",
"FactorComparator",
"<",
"Executor",
">",
"getLstDispatchedTimeComparator",
"(",
"final",
"int",
"weight",
")",
"{",
"return",
"FactorComparator",
".",
"create",
"(",
"LSTDISPATCHED_COMPARATOR_NAME",
",",
"weight",
",",
"new",
"Comparator",
"<",
... | function defines the last dispatched time comparator.
@param weight weight of the comparator. | [
"function",
"defines",
"the",
"last",
"dispatched",
"time",
"comparator",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/selector/ExecutorComparator.java#L197-L214 |
pravega/pravega | client/src/main/java/io/pravega/client/stream/impl/ModelHelper.java | ModelHelper.encode | public static final Transaction.Status encode(final TxnState.State state, final String logString) {
"""
Returns actual status of given transaction status instance.
@param state TxnState object instance.
@param logString Description text to be logged when transaction status is invalid.
@return Transaction.... | java | public static final Transaction.Status encode(final TxnState.State state, final String logString) {
Preconditions.checkNotNull(state, "state");
Exceptions.checkNotNullOrEmpty(logString, "logString");
Transaction.Status result;
switch (state) {
case COMMITTED:
... | [
"public",
"static",
"final",
"Transaction",
".",
"Status",
"encode",
"(",
"final",
"TxnState",
".",
"State",
"state",
",",
"final",
"String",
"logString",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"state",
",",
"\"state\"",
")",
";",
"Exceptions",
... | Returns actual status of given transaction status instance.
@param state TxnState object instance.
@param logString Description text to be logged when transaction status is invalid.
@return Transaction.Status | [
"Returns",
"actual",
"status",
"of",
"given",
"transaction",
"status",
"instance",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/ModelHelper.java#L146-L174 |
belaban/JGroups | src/org/jgroups/protocols/pbcast/FLUSH.java | FLUSH.maxSeqnos | protected static Digest maxSeqnos(final View view, List<Digest> digests) {
"""
Returns a digest which contains, for all members of view, the highest delivered and received
seqno of all digests
"""
if(view == null || digests == null)
return null;
MutableDigest digest=new MutableDig... | java | protected static Digest maxSeqnos(final View view, List<Digest> digests) {
if(view == null || digests == null)
return null;
MutableDigest digest=new MutableDigest(view.getMembersRaw());
digests.forEach(digest::merge);
return digest;
} | [
"protected",
"static",
"Digest",
"maxSeqnos",
"(",
"final",
"View",
"view",
",",
"List",
"<",
"Digest",
">",
"digests",
")",
"{",
"if",
"(",
"view",
"==",
"null",
"||",
"digests",
"==",
"null",
")",
"return",
"null",
";",
"MutableDigest",
"digest",
"=",
... | Returns a digest which contains, for all members of view, the highest delivered and received
seqno of all digests | [
"Returns",
"a",
"digest",
"which",
"contains",
"for",
"all",
"members",
"of",
"view",
"the",
"highest",
"delivered",
"and",
"received",
"seqno",
"of",
"all",
"digests"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/protocols/pbcast/FLUSH.java#L872-L879 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_filer_filerId_GET | public OvhFiler serviceName_datacenter_datacenterId_filer_filerId_GET(String serviceName, Long datacenterId, Long filerId) throws IOException {
"""
Get this object properties
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/filer/{filerId}
@param serviceName [required] Domain of the service
@... | java | public OvhFiler serviceName_datacenter_datacenterId_filer_filerId_GET(String serviceName, Long datacenterId, Long filerId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/filer/{filerId}";
StringBuilder sb = path(qPath, serviceName, datacenterId, filerId);
String resp ... | [
"public",
"OvhFiler",
"serviceName_datacenter_datacenterId_filer_filerId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
",",
"Long",
"filerId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/{serviceName}/datacenter/{datacenterId... | Get this object properties
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/filer/{filerId}
@param serviceName [required] Domain of the service
@param datacenterId [required]
@param filerId [required] Filer Id | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L2253-L2258 |
OpenBEL/openbel-framework | org.openbel.framework.tools/src/main/java/org/openbel/framework/tools/PhaseOneApplication.java | PhaseOneApplication.stage6 | public boolean stage6(final Document doc, final ProtoNetwork pn) {
"""
Stage six expansion of the document.
@param doc the original {@link Document document} needed as a dependency
when using {@link ProtoNetworkBuilder proto network builder}
@param pn the {@link ProtoNetwork proto network} to expand into
... | java | public boolean stage6(final Document doc, final ProtoNetwork pn) {
beginStage(PHASE1_STAGE6_HDR, "6", NUM_PHASES);
final StringBuilder bldr = new StringBuilder();
boolean stmtSuccess = false, termSuccess = false;
bldr.append("Expanding statements and terms");
stageOutput(bldr.to... | [
"public",
"boolean",
"stage6",
"(",
"final",
"Document",
"doc",
",",
"final",
"ProtoNetwork",
"pn",
")",
"{",
"beginStage",
"(",
"PHASE1_STAGE6_HDR",
",",
"\"6\"",
",",
"NUM_PHASES",
")",
";",
"final",
"StringBuilder",
"bldr",
"=",
"new",
"StringBuilder",
"(",... | Stage six expansion of the document.
@param doc the original {@link Document document} needed as a dependency
when using {@link ProtoNetworkBuilder proto network builder}
@param pn the {@link ProtoNetwork proto network} to expand into | [
"Stage",
"six",
"expansion",
"of",
"the",
"document",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.tools/src/main/java/org/openbel/framework/tools/PhaseOneApplication.java#L569-L591 |
infinispan/infinispan | hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/InvalidationCacheAccessDelegate.java | InvalidationCacheAccessDelegate.putFromLoad | @Override
@SuppressWarnings("UnusedParameters")
public boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride)
throws CacheException {
"""
Attempt to cache an object, after loading from the database, explicitly
specifying the minimalPut beha... | java | @Override
@SuppressWarnings("UnusedParameters")
public boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride)
throws CacheException {
if ( !region.checkValid() ) {
if (trace) {
log.tracef( "Region %s not valid", region.getName() );
}
... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"UnusedParameters\"",
")",
"public",
"boolean",
"putFromLoad",
"(",
"Object",
"session",
",",
"Object",
"key",
",",
"Object",
"value",
",",
"long",
"txTimestamp",
",",
"Object",
"version",
",",
"boolean",
"minimal... | Attempt to cache an object, after loading from the database, explicitly
specifying the minimalPut behavior.
@param session Current session
@param key The item key
@param value The item
@param txTimestamp a timestamp prior to the transaction start time
@param version the item version number
@param minimalPutOverride Ex... | [
"Attempt",
"to",
"cache",
"an",
"object",
"after",
"loading",
"from",
"the",
"database",
"explicitly",
"specifying",
"the",
"minimalPut",
"behavior",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/InvalidationCacheAccessDelegate.java#L85-L121 |
mhshams/jnbis | src/main/java/org/jnbis/api/handler/FileHandler.java | FileHandler.asFile | public File asFile(String fileName) {
"""
Writes the file data in the specified file and returns the final <code>File</code>.
@param fileName the given file name, not null
@return the final File, not null
"""
File file = new File(fileName);
try (FileOutputStream bos = new FileOutputStream(f... | java | public File asFile(String fileName) {
File file = new File(fileName);
try (FileOutputStream bos = new FileOutputStream(file)) {
bos.write(data);
} catch (IOException e) {
throw new RuntimeException("unexpected error", e);
}
return file;
} | [
"public",
"File",
"asFile",
"(",
"String",
"fileName",
")",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"fileName",
")",
";",
"try",
"(",
"FileOutputStream",
"bos",
"=",
"new",
"FileOutputStream",
"(",
"file",
")",
")",
"{",
"bos",
".",
"write",
"(",... | Writes the file data in the specified file and returns the final <code>File</code>.
@param fileName the given file name, not null
@return the final File, not null | [
"Writes",
"the",
"file",
"data",
"in",
"the",
"specified",
"file",
"and",
"returns",
"the",
"final",
"<code",
">",
"File<",
"/",
"code",
">",
"."
] | train | https://github.com/mhshams/jnbis/blob/e0f4ac750cc98a0363507395a121183fface330e/src/main/java/org/jnbis/api/handler/FileHandler.java#L26-L34 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java | ServletUtil.handleError | public static void handleError(final HttpServletHelper helper, final Throwable throwable) throws
ServletException,
IOException {
"""
Called if a Throwable is caught by the top-level service method. By default we display an error and terminate the
session.
@param helper the current servlet helper
@param ... | java | public static void handleError(final HttpServletHelper helper, final Throwable throwable) throws
ServletException,
IOException {
HttpServletRequest httpServletRequest = helper.getBackingRequest();
HttpServletResponse httpServletResponse = helper.getBackingResponse();
// Allow for multi part requests
Map<... | [
"public",
"static",
"void",
"handleError",
"(",
"final",
"HttpServletHelper",
"helper",
",",
"final",
"Throwable",
"throwable",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"HttpServletRequest",
"httpServletRequest",
"=",
"helper",
".",
"getBackingRequest... | Called if a Throwable is caught by the top-level service method. By default we display an error and terminate the
session.
@param helper the current servlet helper
@param throwable the throwable
@throws ServletException a servlet exception
@throws IOException an IO Exception | [
"Called",
"if",
"a",
"Throwable",
"is",
"caught",
"by",
"the",
"top",
"-",
"level",
"service",
"method",
".",
"By",
"default",
"we",
"display",
"an",
"error",
"and",
"terminate",
"the",
"session",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L465-L512 |
wuman/JReadability | src/main/java/com/wuman/jreadability/Readability.java | Readability.getCharCount | private static int getCharCount(Element e, String s) {
"""
Get the number of times a string s appears in the node e.
@param e
@param s
@return
"""
if (s == null || s.length() == 0) {
s = ",";
}
return getInnerText(e, true).split(s).length;
} | java | private static int getCharCount(Element e, String s) {
if (s == null || s.length() == 0) {
s = ",";
}
return getInnerText(e, true).split(s).length;
} | [
"private",
"static",
"int",
"getCharCount",
"(",
"Element",
"e",
",",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"s",
"=",
"\",\"",
";",
"}",
"return",
"getInnerText",
"(",
"e",... | Get the number of times a string s appears in the node e.
@param e
@param s
@return | [
"Get",
"the",
"number",
"of",
"times",
"a",
"string",
"s",
"appears",
"in",
"the",
"node",
"e",
"."
] | train | https://github.com/wuman/JReadability/blob/16c18c42402bd13c6e024c2fd3a86dd28ba53e74/src/main/java/com/wuman/jreadability/Readability.java#L511-L516 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/source/FileSourceDao.java | FileSourceDao.scrollLineHashes | public void scrollLineHashes(DbSession dbSession, Collection<String> fileUUids, ResultHandler<LineHashesWithUuidDto> rowHandler) {
"""
Scroll line hashes of all <strong>enabled</strong> components (should be files, but not enforced) with specified
uuids in no specific order with 'SOURCE' source and a non null pat... | java | public void scrollLineHashes(DbSession dbSession, Collection<String> fileUUids, ResultHandler<LineHashesWithUuidDto> rowHandler) {
for (List<String> partition : toUniqueAndSortedPartitions(fileUUids)) {
mapper(dbSession).scrollLineHashes(partition, rowHandler);
}
} | [
"public",
"void",
"scrollLineHashes",
"(",
"DbSession",
"dbSession",
",",
"Collection",
"<",
"String",
">",
"fileUUids",
",",
"ResultHandler",
"<",
"LineHashesWithUuidDto",
">",
"rowHandler",
")",
"{",
"for",
"(",
"List",
"<",
"String",
">",
"partition",
":",
... | Scroll line hashes of all <strong>enabled</strong> components (should be files, but not enforced) with specified
uuids in no specific order with 'SOURCE' source and a non null path. | [
"Scroll",
"line",
"hashes",
"of",
"all",
"<strong",
">",
"enabled<",
"/",
"strong",
">",
"components",
"(",
"should",
"be",
"files",
"but",
"not",
"enforced",
")",
"with",
"specified",
"uuids",
"in",
"no",
"specific",
"order",
"with",
"SOURCE",
"source",
"... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/source/FileSourceDao.java#L84-L88 |
landawn/AbacusUtil | src/com/landawn/abacus/util/SQLExecutor.java | SQLExecutor.queryForSingleResult | @SuppressWarnings("unchecked")
@SafeVarargs
public final <V> Nullable<V> queryForSingleResult(final Class<V> targetClass, final Connection conn, final String sql,
final StatementSetter statementSetter, final JdbcSettings jdbcSettings, final Object... parameters) {
"""
Returns a {@code Nullab... | java | @SuppressWarnings("unchecked")
@SafeVarargs
public final <V> Nullable<V> queryForSingleResult(final Class<V> targetClass, final Connection conn, final String sql,
final StatementSetter statementSetter, final JdbcSettings jdbcSettings, final Object... parameters) {
return query(conn, sql,... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"SafeVarargs",
"public",
"final",
"<",
"V",
">",
"Nullable",
"<",
"V",
">",
"queryForSingleResult",
"(",
"final",
"Class",
"<",
"V",
">",
"targetClass",
",",
"final",
"Connection",
"conn",
",",
"final"... | Returns a {@code Nullable} describing the value in the first row/column if it exists, otherwise return an empty {@code Nullable}.
<br />
Special note for type conversion for {@code boolean} or {@code Boolean} type: {@code true} is returned if the
{@code String} value of the target column is {@code "true"}, case insens... | [
"Returns",
"a",
"{",
"@code",
"Nullable",
"}",
"describing",
"the",
"value",
"in",
"the",
"first",
"row",
"/",
"column",
"if",
"it",
"exists",
"otherwise",
"return",
"an",
"empty",
"{",
"@code",
"Nullable",
"}",
".",
"<br",
"/",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/SQLExecutor.java#L2284-L2289 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/AbstractEntityReader.java | AbstractEntityReader.findById | protected EnhanceEntity findById(Object primaryKey, EntityMetadata m, Client client) {
"""
Retrieves an entity from ID
@param primaryKey
@param m
@param client
@return
"""
try
{
Object o = client.find(m.getEntityClazz(), primaryKey);
if (o == null)
{
... | java | protected EnhanceEntity findById(Object primaryKey, EntityMetadata m, Client client)
{
try
{
Object o = client.find(m.getEntityClazz(), primaryKey);
if (o == null)
{
// No entity found
return null;
}
else
... | [
"protected",
"EnhanceEntity",
"findById",
"(",
"Object",
"primaryKey",
",",
"EntityMetadata",
"m",
",",
"Client",
"client",
")",
"{",
"try",
"{",
"Object",
"o",
"=",
"client",
".",
"find",
"(",
"m",
".",
"getEntityClazz",
"(",
")",
",",
"primaryKey",
")",
... | Retrieves an entity from ID
@param primaryKey
@param m
@param client
@return | [
"Retrieves",
"an",
"entity",
"from",
"ID"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/AbstractEntityReader.java#L77-L97 |
square/okhttp | mockwebserver/src/main/java/okhttp3/mockwebserver/MockWebServer.java | MockWebServer.takeRequest | public RecordedRequest takeRequest(long timeout, TimeUnit unit) throws InterruptedException {
"""
Awaits the next HTTP request (waiting up to the specified wait time if necessary), removes it,
and returns it. Callers should use this to verify the request was sent as intended within the
given time.
@param time... | java | public RecordedRequest takeRequest(long timeout, TimeUnit unit) throws InterruptedException {
return requestQueue.poll(timeout, unit);
} | [
"public",
"RecordedRequest",
"takeRequest",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"return",
"requestQueue",
".",
"poll",
"(",
"timeout",
",",
"unit",
")",
";",
"}"
] | Awaits the next HTTP request (waiting up to the specified wait time if necessary), removes it,
and returns it. Callers should use this to verify the request was sent as intended within the
given time.
@param timeout how long to wait before giving up, in units of {@code unit}
@param unit a {@code TimeUnit} determining ... | [
"Awaits",
"the",
"next",
"HTTP",
"request",
"(",
"waiting",
"up",
"to",
"the",
"specified",
"wait",
"time",
"if",
"necessary",
")",
"removes",
"it",
"and",
"returns",
"it",
".",
"Callers",
"should",
"use",
"this",
"to",
"verify",
"the",
"request",
"was",
... | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/mockwebserver/src/main/java/okhttp3/mockwebserver/MockWebServer.java#L309-L311 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java | ZooKeeperMasterModel.rolloutOptionsWithFallback | static RolloutOptions rolloutOptionsWithFallback(final RolloutOptions options, final Job job) {
"""
Returns a {@link RolloutOptions} instance that will replace null attributes in options with
values from two tiers of fallbacks. First fallback to job then
{@link RolloutOptions#getDefault()}.
"""
return op... | java | static RolloutOptions rolloutOptionsWithFallback(final RolloutOptions options, final Job job) {
return options.withFallback(
job.getRolloutOptions() == null
? RolloutOptions.getDefault()
: job.getRolloutOptions().withFallback(RolloutOptions.getDefault()));
} | [
"static",
"RolloutOptions",
"rolloutOptionsWithFallback",
"(",
"final",
"RolloutOptions",
"options",
",",
"final",
"Job",
"job",
")",
"{",
"return",
"options",
".",
"withFallback",
"(",
"job",
".",
"getRolloutOptions",
"(",
")",
"==",
"null",
"?",
"RolloutOptions"... | Returns a {@link RolloutOptions} instance that will replace null attributes in options with
values from two tiers of fallbacks. First fallback to job then
{@link RolloutOptions#getDefault()}. | [
"Returns",
"a",
"{"
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java#L625-L630 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.areAntiparallel | public static boolean areAntiparallel(PolymerNotation polymerOne, PolymerNotation polymerTwo)
throws RNAUtilsException, HELM2HandledException, ChemistryException, NucleotideLoadingException {
"""
method to check if two given polymers are complement to each other
@param polymerOne
PolymerNotation of the fir... | java | public static boolean areAntiparallel(PolymerNotation polymerOne, PolymerNotation polymerTwo)
throws RNAUtilsException, HELM2HandledException, ChemistryException, NucleotideLoadingException {
checkRNA(polymerOne);
checkRNA(polymerTwo);
PolymerNotation antiparallel = getAntiparallel(polymerOne);
String s... | [
"public",
"static",
"boolean",
"areAntiparallel",
"(",
"PolymerNotation",
"polymerOne",
",",
"PolymerNotation",
"polymerTwo",
")",
"throws",
"RNAUtilsException",
",",
"HELM2HandledException",
",",
"ChemistryException",
",",
"NucleotideLoadingException",
"{",
"checkRNA",
"("... | method to check if two given polymers are complement to each other
@param polymerOne
PolymerNotation of the first polymer
@param polymerTwo
PolymerNotation of the second polymer
@return true, if they are opposite to each other, false otherwise
@throws RNAUtilsException
if the polymers are not rna/dna or the antiparall... | [
"method",
"to",
"check",
"if",
"two",
"given",
"polymers",
"are",
"complement",
"to",
"each",
"other"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L147-L157 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/message/HttpCarbonMessage.java | HttpCarbonMessage.pushResponse | public HttpResponseFuture pushResponse(HttpCarbonMessage httpCarbonMessage, Http2PushPromise pushPromise)
throws ServerConnectorException {
"""
Sends a push response message back to the client.
@param httpCarbonMessage the push response message
@param pushPromise the push promise associated w... | java | public HttpResponseFuture pushResponse(HttpCarbonMessage httpCarbonMessage, Http2PushPromise pushPromise)
throws ServerConnectorException {
httpOutboundRespFuture.notifyHttpListener(httpCarbonMessage, pushPromise);
return httpOutboundRespStatusFuture;
} | [
"public",
"HttpResponseFuture",
"pushResponse",
"(",
"HttpCarbonMessage",
"httpCarbonMessage",
",",
"Http2PushPromise",
"pushPromise",
")",
"throws",
"ServerConnectorException",
"{",
"httpOutboundRespFuture",
".",
"notifyHttpListener",
"(",
"httpCarbonMessage",
",",
"pushPromis... | Sends a push response message back to the client.
@param httpCarbonMessage the push response message
@param pushPromise the push promise associated with the push response message
@return HttpResponseFuture which gives the status of the operation
@throws ServerConnectorException if there is an error occurs while ... | [
"Sends",
"a",
"push",
"response",
"message",
"back",
"to",
"the",
"client",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/message/HttpCarbonMessage.java#L311-L315 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.createSSHKey | public GitlabSSHKey createSSHKey(Integer targetUserId, String title, String key) throws IOException {
"""
Create a new ssh key for the user
@param targetUserId The id of the Gitlab user
@param title The title of the ssh key
@param key The public key
@return The new GitlabSSHKey
@throws IOExc... | java | public GitlabSSHKey createSSHKey(Integer targetUserId, String title, String key) throws IOException {
Query query = new Query()
.append("title", title)
.append("key", key);
String tailUrl = GitlabUser.USERS_URL + "/" + targetUserId + GitlabSSHKey.KEYS_URL + query.toStri... | [
"public",
"GitlabSSHKey",
"createSSHKey",
"(",
"Integer",
"targetUserId",
",",
"String",
"title",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"Query",
"query",
"=",
"new",
"Query",
"(",
")",
".",
"append",
"(",
"\"title\"",
",",
"title",
")",
... | Create a new ssh key for the user
@param targetUserId The id of the Gitlab user
@param title The title of the ssh key
@param key The public key
@return The new GitlabSSHKey
@throws IOException on gitlab api call error | [
"Create",
"a",
"new",
"ssh",
"key",
"for",
"the",
"user"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L385-L394 |
cloudiator/flexiant-client | src/main/java/de/uniulm/omi/cloudiator/flexiant/client/compute/FlexiantComputeClient.java | FlexiantComputeClient.createServer | public de.uniulm.omi.cloudiator.flexiant.client.domain.Server createServer(
final ServerTemplate serverTemplate) throws FlexiantException {
"""
Creates a server with the given properties.
@param serverTemplate A template describing the server which should be started.
@return the created server.
@throw... | java | public de.uniulm.omi.cloudiator.flexiant.client.domain.Server createServer(
final ServerTemplate serverTemplate) throws FlexiantException {
checkNotNull(serverTemplate);
io.github.cloudiator.flexiant.extility.Server server =
new io.github.cloudiator.flexiant.extility.Server();
... | [
"public",
"de",
".",
"uniulm",
".",
"omi",
".",
"cloudiator",
".",
"flexiant",
".",
"client",
".",
"domain",
".",
"Server",
"createServer",
"(",
"final",
"ServerTemplate",
"serverTemplate",
")",
"throws",
"FlexiantException",
"{",
"checkNotNull",
"(",
"serverTem... | Creates a server with the given properties.
@param serverTemplate A template describing the server which should be started.
@return the created server.
@throws FlexiantException | [
"Creates",
"a",
"server",
"with",
"the",
"given",
"properties",
"."
] | train | https://github.com/cloudiator/flexiant-client/blob/30024501a6ae034ea3646f71ec0761c8bc5daa69/src/main/java/de/uniulm/omi/cloudiator/flexiant/client/compute/FlexiantComputeClient.java#L216-L266 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/util/Version.java | Version.jarVersion | public static String jarVersion(Class<?> jarClass) {
"""
Returns the "version" entry from a jar file's manifest, if available.
If the class isn't in a jar file, or that jar file doesn't define a
"version" entry, then a "not available" string is returned.
@param jarClass any class from the target jar
"""
... | java | public static String jarVersion(Class<?> jarClass) {
String j2objcVersion = null;
String path = jarClass.getProtectionDomain().getCodeSource().getLocation().getPath();
try (JarFile jar = new JarFile(URLDecoder.decode(path, "UTF-8"))) {
Manifest manifest = jar.getManifest();
j2objcVersion = mani... | [
"public",
"static",
"String",
"jarVersion",
"(",
"Class",
"<",
"?",
">",
"jarClass",
")",
"{",
"String",
"j2objcVersion",
"=",
"null",
";",
"String",
"path",
"=",
"jarClass",
".",
"getProtectionDomain",
"(",
")",
".",
"getCodeSource",
"(",
")",
".",
"getLo... | Returns the "version" entry from a jar file's manifest, if available.
If the class isn't in a jar file, or that jar file doesn't define a
"version" entry, then a "not available" string is returned.
@param jarClass any class from the target jar | [
"Returns",
"the",
"version",
"entry",
"from",
"a",
"jar",
"file",
"s",
"manifest",
"if",
"available",
".",
"If",
"the",
"class",
"isn",
"t",
"in",
"a",
"jar",
"file",
"or",
"that",
"jar",
"file",
"doesn",
"t",
"define",
"a",
"version",
"entry",
"then",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/util/Version.java#L31-L47 |
korpling/ANNIS | annis-interfaces/src/main/java/annis/TimelineReconstructor.java | TimelineReconstructor.removeVirtualTokenizationUsingNamespace | public static void removeVirtualTokenizationUsingNamespace(SDocumentGraph graph) {
"""
Removes the virtual tokenization from a {@link SDocumentGraph} and replaces it with an
{@link STimeline} and multiple {@link STextualDS}.
This alters the original graph.
@param orig
@return
"""
if(graph.getTimeline... | java | public static void removeVirtualTokenizationUsingNamespace(SDocumentGraph graph)
{
if(graph.getTimeline() != null)
{
// do nothing if the graph does not contain any virtual tokenization
return;
}
TimelineReconstructor reconstructor = new TimelineReconstructor(graph, true);
reconst... | [
"public",
"static",
"void",
"removeVirtualTokenizationUsingNamespace",
"(",
"SDocumentGraph",
"graph",
")",
"{",
"if",
"(",
"graph",
".",
"getTimeline",
"(",
")",
"!=",
"null",
")",
"{",
"// do nothing if the graph does not contain any virtual tokenization",
"return",
";"... | Removes the virtual tokenization from a {@link SDocumentGraph} and replaces it with an
{@link STimeline} and multiple {@link STextualDS}.
This alters the original graph.
@param orig
@return | [
"Removes",
"the",
"virtual",
"tokenization",
"from",
"a",
"{",
"@link",
"SDocumentGraph",
"}",
"and",
"replaces",
"it",
"with",
"an",
"{",
"@link",
"STimeline",
"}",
"and",
"multiple",
"{",
"@link",
"STextualDS",
"}",
"."
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/TimelineReconstructor.java#L449-L463 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/chrome/ChromeOptions.java | ChromeOptions.setExperimentalOption | public ChromeOptions setExperimentalOption(String name, Object value) {
"""
Sets an experimental option. Useful for new ChromeDriver options not yet
exposed through the {@link ChromeOptions} API.
@param name Name of the experimental option.
@param value Value of the experimental option, which must be converti... | java | public ChromeOptions setExperimentalOption(String name, Object value) {
experimentalOptions.put(checkNotNull(name), value);
return this;
} | [
"public",
"ChromeOptions",
"setExperimentalOption",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"experimentalOptions",
".",
"put",
"(",
"checkNotNull",
"(",
"name",
")",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Sets an experimental option. Useful for new ChromeDriver options not yet
exposed through the {@link ChromeOptions} API.
@param name Name of the experimental option.
@param value Value of the experimental option, which must be convertible
to JSON. | [
"Sets",
"an",
"experimental",
"option",
".",
"Useful",
"for",
"new",
"ChromeDriver",
"options",
"not",
"yet",
"exposed",
"through",
"the",
"{",
"@link",
"ChromeOptions",
"}",
"API",
"."
] | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java#L198-L201 |
threerings/narya | core/src/main/java/com/threerings/io/ObjectInputStream.java | ObjectInputStream.createClassMapping | protected ClassMapping createClassMapping (short code, String cname)
throws IOException, ClassNotFoundException {
"""
Creates and returns a class mapping for the specified code and class name.
"""
// resolve the class and streamer
ClassLoader loader = (_loader != null) ? _loader :
... | java | protected ClassMapping createClassMapping (short code, String cname)
throws IOException, ClassNotFoundException
{
// resolve the class and streamer
ClassLoader loader = (_loader != null) ? _loader :
Thread.currentThread().getContextClassLoader();
Class<?> sclass = Class.f... | [
"protected",
"ClassMapping",
"createClassMapping",
"(",
"short",
"code",
",",
"String",
"cname",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"// resolve the class and streamer",
"ClassLoader",
"loader",
"=",
"(",
"_loader",
"!=",
"null",
")",
"?"... | Creates and returns a class mapping for the specified code and class name. | [
"Creates",
"and",
"returns",
"a",
"class",
"mapping",
"for",
"the",
"specified",
"code",
"and",
"class",
"name",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ObjectInputStream.java#L238-L258 |
flow/caustic | api/src/main/java/com/flowpowered/caustic/api/util/MeshGenerator.java | MeshGenerator.generateNormals | public static void generateNormals(TFloatList positions, TIntList indices, TFloatList normals) {
"""
Generate the normals for the positions, according to the indices. This assumes that the positions have 3 components, in the x, y, z order. The normals are stored as a 3 component vector, in the
x, y, z order.
@... | java | public static void generateNormals(TFloatList positions, TIntList indices, TFloatList normals) {
// Initialize normals to (0, 0, 0)
normals.fill(0, positions.size(), 0);
// Iterate over the entire mesh
for (int i = 0; i < indices.size(); i += 3) {
// Triangle position indices... | [
"public",
"static",
"void",
"generateNormals",
"(",
"TFloatList",
"positions",
",",
"TIntList",
"indices",
",",
"TFloatList",
"normals",
")",
"{",
"// Initialize normals to (0, 0, 0)",
"normals",
".",
"fill",
"(",
"0",
",",
"positions",
".",
"size",
"(",
")",
",... | Generate the normals for the positions, according to the indices. This assumes that the positions have 3 components, in the x, y, z order. The normals are stored as a 3 component vector, in the
x, y, z order.
@param positions The position components
@param indices The indices
@param normals The list in which to store ... | [
"Generate",
"the",
"normals",
"for",
"the",
"positions",
"according",
"to",
"the",
"indices",
".",
"This",
"assumes",
"that",
"the",
"positions",
"have",
"3",
"components",
"in",
"the",
"x",
"y",
"z",
"order",
".",
"The",
"normals",
"are",
"stored",
"as",
... | train | https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/util/MeshGenerator.java#L156-L221 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.setup | public void setup(String host, String path, Map<String, Object> params) {
"""
Initialize connection.
@param host
Connection host
@param path
Connection path
@param params
Params passed from client
"""
this.host = host;
this.path = path;
this.params = params;
if (Inte... | java | public void setup(String host, String path, Map<String, Object> params) {
this.host = host;
this.path = path;
this.params = params;
if (Integer.valueOf(3).equals(params.get("objectEncoding"))) {
if (log.isDebugEnabled()) {
log.debug("Setting object encod... | [
"public",
"void",
"setup",
"(",
"String",
"host",
",",
"String",
"path",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"{",
"this",
".",
"host",
"=",
"host",
";",
"this",
".",
"path",
"=",
"path",
";",
"this",
".",
"params",
"=",
... | Initialize connection.
@param host
Connection host
@param path
Connection path
@param params
Params passed from client | [
"Initialize",
"connection",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L574-L584 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/PropertiesField.java | PropertiesField.doSetData | public int doSetData(Object data, boolean bDisplayOption, int iMoveMode) {
"""
Move this physical binary data to this field.
@param data The physical data to move to this field (must be the correct raw data class).
@param bDisplayOption If true, display after setting the data.
@param iMoveMode The type of move.... | java | public int doSetData(Object data, boolean bDisplayOption, int iMoveMode)
{
int iErrorCode = super.doSetData(data, bDisplayOption, iMoveMode);
if (this.isJustModified())
m_propertiesCache = null; // Cache is no longer valid
return iErrorCode;
} | [
"public",
"int",
"doSetData",
"(",
"Object",
"data",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"int",
"iErrorCode",
"=",
"super",
".",
"doSetData",
"(",
"data",
",",
"bDisplayOption",
",",
"iMoveMode",
")",
";",
"if",
"(",
"this"... | Move this physical binary data to this field.
@param data The physical data to move to this field (must be the correct raw data class).
@param bDisplayOption If true, display after setting the data.
@param iMoveMode The type of move.
@return an error code (0 if success). | [
"Move",
"this",
"physical",
"binary",
"data",
"to",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/PropertiesField.java#L292-L298 |
3pillarlabs/spring-data-simpledb | spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/repository/support/entityinformation/SimpleDbEntityInformationSupport.java | SimpleDbEntityInformationSupport.getMetadata | @SuppressWarnings( {
"""
Creates a {@link SimpleDbEntityInformation} for the given domain class.
@param domainClass
must not be {@literal null}.
@return
""" "rawtypes", "unchecked" })
public static <T> SimpleDbEntityInformation<T, ?> getMetadata(Class<T> domainClass, String simpleDbDomain) {
Assert.not... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> SimpleDbEntityInformation<T, ?> getMetadata(Class<T> domainClass, String simpleDbDomain) {
Assert.notNull(domainClass);
Assert.notNull(simpleDbDomain);
return new SimpleDbMetamodelEntityInformation(domainClass, simpleDbDomain);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"<",
"T",
">",
"SimpleDbEntityInformation",
"<",
"T",
",",
"?",
">",
"getMetadata",
"(",
"Class",
"<",
"T",
">",
"domainClass",
",",
"String",
"simpleDbDom... | Creates a {@link SimpleDbEntityInformation} for the given domain class.
@param domainClass
must not be {@literal null}.
@return | [
"Creates",
"a",
"{",
"@link",
"SimpleDbEntityInformation",
"}",
"for",
"the",
"given",
"domain",
"class",
"."
] | train | https://github.com/3pillarlabs/spring-data-simpledb/blob/f1e0eb4e48ec4674d3966e8f5bc04c95031f93ae/spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/repository/support/entityinformation/SimpleDbEntityInformationSupport.java#L48-L54 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java | DeploymentsInner.createOrUpdate | public DeploymentExtendedInner createOrUpdate(String resourceGroupName, String deploymentName, DeploymentProperties properties) {
"""
Deploys resources to a resource group.
You can provide the template and parameters directly in the request or link to JSON files.
@param resourceGroupName The name of the resour... | java | public DeploymentExtendedInner createOrUpdate(String resourceGroupName, String deploymentName, DeploymentProperties properties) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, deploymentName, properties).toBlocking().last().body();
} | [
"public",
"DeploymentExtendedInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"deploymentName",
",",
"DeploymentProperties",
"properties",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"deploymentName",
... | Deploys resources to a resource group.
You can provide the template and parameters directly in the request or link to JSON files.
@param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist.
@param deploymentName The name of th... | [
"Deploys",
"resources",
"to",
"a",
"resource",
"group",
".",
"You",
"can",
"provide",
"the",
"template",
"and",
"parameters",
"directly",
"in",
"the",
"request",
"or",
"link",
"to",
"JSON",
"files",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java#L376-L378 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/SparkUtils.java | SparkUtils.balancedRandomSplit | public static <T, U> JavaPairRDD<T, U>[] balancedRandomSplit(int totalObjectCount, int numObjectsPerSplit,
JavaPairRDD<T, U> data) {
"""
Equivalent to {@link #balancedRandomSplit(int, int, JavaRDD)} but for Pair RDDs
"""
return balancedRandomSplit(totalObjectCount, numObjectsPerSpli... | java | public static <T, U> JavaPairRDD<T, U>[] balancedRandomSplit(int totalObjectCount, int numObjectsPerSplit,
JavaPairRDD<T, U> data) {
return balancedRandomSplit(totalObjectCount, numObjectsPerSplit, data, new Random().nextLong());
} | [
"public",
"static",
"<",
"T",
",",
"U",
">",
"JavaPairRDD",
"<",
"T",
",",
"U",
">",
"[",
"]",
"balancedRandomSplit",
"(",
"int",
"totalObjectCount",
",",
"int",
"numObjectsPerSplit",
",",
"JavaPairRDD",
"<",
"T",
",",
"U",
">",
"data",
")",
"{",
"retu... | Equivalent to {@link #balancedRandomSplit(int, int, JavaRDD)} but for Pair RDDs | [
"Equivalent",
"to",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/SparkUtils.java#L487-L490 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/PrimaryWorkitem.java | PrimaryWorkitem.createTask | public Task createTask(String name, Map<String, Object> attributes) {
"""
Create a task that belongs to this item.
@param name The name of the task.
@param attributes additional attributes for task.
@return created task.
"""
return getInstance().create().task(name, this, attributes);
} | java | public Task createTask(String name, Map<String, Object> attributes) {
return getInstance().create().task(name, this, attributes);
} | [
"public",
"Task",
"createTask",
"(",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"return",
"getInstance",
"(",
")",
".",
"create",
"(",
")",
".",
"task",
"(",
"name",
",",
"this",
",",
"attributes",
")",
"... | Create a task that belongs to this item.
@param name The name of the task.
@param attributes additional attributes for task.
@return created task. | [
"Create",
"a",
"task",
"that",
"belongs",
"to",
"this",
"item",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/PrimaryWorkitem.java#L187-L189 |
netkicorp/java-wns-resolver | src/main/java/com/netki/tlsa/TLSAValidator.java | TLSAValidator.getMatchingCert | public Certificate getMatchingCert(TLSARecord tlsaRecord, List<Certificate> certs) {
"""
Returns the certificate matching the TLSA record from the given certs
@param tlsaRecord TLSARecord type describing the TLSA Record to be validated
@param certs All certs retrieved from the URL's SSL/TLS connection
@return... | java | public Certificate getMatchingCert(TLSARecord tlsaRecord, List<Certificate> certs) {
for (Certificate cert : certs) {
byte[] digestMatch = new byte[0];
byte[] selectorData = new byte[0];
try {
// Get Selector Value
switch (tlsaRecord.getSele... | [
"public",
"Certificate",
"getMatchingCert",
"(",
"TLSARecord",
"tlsaRecord",
",",
"List",
"<",
"Certificate",
">",
"certs",
")",
"{",
"for",
"(",
"Certificate",
"cert",
":",
"certs",
")",
"{",
"byte",
"[",
"]",
"digestMatch",
"=",
"new",
"byte",
"[",
"0",
... | Returns the certificate matching the TLSA record from the given certs
@param tlsaRecord TLSARecord type describing the TLSA Record to be validated
@param certs All certs retrieved from the URL's SSL/TLS connection
@return Matching certificate or null | [
"Returns",
"the",
"certificate",
"matching",
"the",
"TLSA",
"record",
"from",
"the",
"given",
"certs"
] | train | https://github.com/netkicorp/java-wns-resolver/blob/a7aad04d96c03feb05536aef189617beb4f011bc/src/main/java/com/netki/tlsa/TLSAValidator.java#L140-L181 |
VoltDB/voltdb | src/frontend/org/voltdb/expressions/ComparisonExpression.java | ComparisonExpression.getGteFilterFromPrefixLike | public ComparisonExpression getGteFilterFromPrefixLike() {
"""
/ Construct the lower bound comparison filter implied by a prefix LIKE comparison.
"""
ExpressionType rangeComparator = ExpressionType.COMPARE_GREATERTHANOREQUALTO;
String comparand = extractLikePatternPrefix();
return range... | java | public ComparisonExpression getGteFilterFromPrefixLike() {
ExpressionType rangeComparator = ExpressionType.COMPARE_GREATERTHANOREQUALTO;
String comparand = extractLikePatternPrefix();
return rangeFilterFromPrefixLike(m_left, rangeComparator, comparand);
} | [
"public",
"ComparisonExpression",
"getGteFilterFromPrefixLike",
"(",
")",
"{",
"ExpressionType",
"rangeComparator",
"=",
"ExpressionType",
".",
"COMPARE_GREATERTHANOREQUALTO",
";",
"String",
"comparand",
"=",
"extractLikePatternPrefix",
"(",
")",
";",
"return",
"rangeFilter... | / Construct the lower bound comparison filter implied by a prefix LIKE comparison. | [
"/",
"Construct",
"the",
"lower",
"bound",
"comparison",
"filter",
"implied",
"by",
"a",
"prefix",
"LIKE",
"comparison",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ComparisonExpression.java#L189-L193 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/JavaClasspathParser.java | JavaClasspathParser.readFileEntriesWithException | public static IClasspathEntry[][] readFileEntriesWithException(String projectName, URL projectRootAbsoluteFullPath)
throws CoreException, IOException, ClasspathEntry.AssertionFailedException, URISyntaxException {
"""
Reads entry of a .classpath file.
@param projectName
- the name of project contain... | java | public static IClasspathEntry[][] readFileEntriesWithException(String projectName, URL projectRootAbsoluteFullPath)
throws CoreException, IOException, ClasspathEntry.AssertionFailedException, URISyntaxException {
return readFileEntriesWithException(projectName, projectRootAbsoluteFullPath, null);
... | [
"public",
"static",
"IClasspathEntry",
"[",
"]",
"[",
"]",
"readFileEntriesWithException",
"(",
"String",
"projectName",
",",
"URL",
"projectRootAbsoluteFullPath",
")",
"throws",
"CoreException",
",",
"IOException",
",",
"ClasspathEntry",
".",
"AssertionFailedException",
... | Reads entry of a .classpath file.
@param projectName
- the name of project containing the .classpath file
@param projectRootAbsoluteFullPath
- the path to project containing the .classpath file
@return the set of CLasspath ENtries extracted from the .classpath
@throws CoreException
- exception during parsing of .class... | [
"Reads",
"entry",
"of",
"a",
".",
"classpath",
"file",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/JavaClasspathParser.java#L125-L128 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/runtime/io/network/netty/InboundEnvelopeDecoder.java | InboundEnvelopeDecoder.copy | private void copy(ByteBuf src, ByteBuffer dst) {
"""
Copies min(from.readableBytes(), to.remaining() bytes from Nettys ByteBuf to the Java NIO ByteBuffer.
"""
// This branch is necessary, because an Exception is thrown if the
// destination buffer has more remaining (writable) bytes than
// currently rea... | java | private void copy(ByteBuf src, ByteBuffer dst) {
// This branch is necessary, because an Exception is thrown if the
// destination buffer has more remaining (writable) bytes than
// currently readable from the Netty ByteBuf source.
if (src.isReadable()) {
if (src.readableBytes() < dst.remaining()) {
int ... | [
"private",
"void",
"copy",
"(",
"ByteBuf",
"src",
",",
"ByteBuffer",
"dst",
")",
"{",
"// This branch is necessary, because an Exception is thrown if the",
"// destination buffer has more remaining (writable) bytes than",
"// currently readable from the Netty ByteBuf source.",
"if",
"(... | Copies min(from.readableBytes(), to.remaining() bytes from Nettys ByteBuf to the Java NIO ByteBuffer. | [
"Copies",
"min",
"(",
"from",
".",
"readableBytes",
"()",
"to",
".",
"remaining",
"()",
"bytes",
"from",
"Nettys",
"ByteBuf",
"to",
"the",
"Java",
"NIO",
"ByteBuffer",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/runtime/io/network/netty/InboundEnvelopeDecoder.java#L320-L336 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Table.java | Table.getNextConstraintIndex | int getNextConstraintIndex(int from, int type) {
"""
Returns the next constraint of a given type
@param from
@param type
"""
for (int i = from, size = constraintList.length; i < size; i++) {
Constraint c = constraintList[i];
if (c.getConstraintType() == type) {
... | java | int getNextConstraintIndex(int from, int type) {
for (int i = from, size = constraintList.length; i < size; i++) {
Constraint c = constraintList[i];
if (c.getConstraintType() == type) {
return i;
}
}
return -1;
} | [
"int",
"getNextConstraintIndex",
"(",
"int",
"from",
",",
"int",
"type",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"from",
",",
"size",
"=",
"constraintList",
".",
"length",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"Constraint",
"c",
"=",
"con... | Returns the next constraint of a given type
@param from
@param type | [
"Returns",
"the",
"next",
"constraint",
"of",
"a",
"given",
"type"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Table.java#L896-L907 |
infinispan/infinispan | core/src/main/java/org/infinispan/util/AbstractDelegatingIntCacheStream.java | AbstractDelegatingIntCacheStream.mapToDouble | @Override
public DoubleCacheStream mapToDouble(IntToDoubleFunction mapper) {
"""
These are methods that convert to a different AbstractDelegating*CacheStream
"""
return new AbstractDelegatingDoubleCacheStream(delegateCacheStream, underlyingStream.mapToDouble(mapper));
} | java | @Override
public DoubleCacheStream mapToDouble(IntToDoubleFunction mapper) {
return new AbstractDelegatingDoubleCacheStream(delegateCacheStream, underlyingStream.mapToDouble(mapper));
} | [
"@",
"Override",
"public",
"DoubleCacheStream",
"mapToDouble",
"(",
"IntToDoubleFunction",
"mapper",
")",
"{",
"return",
"new",
"AbstractDelegatingDoubleCacheStream",
"(",
"delegateCacheStream",
",",
"underlyingStream",
".",
"mapToDouble",
"(",
"mapper",
")",
")",
";",
... | These are methods that convert to a different AbstractDelegating*CacheStream | [
"These",
"are",
"methods",
"that",
"convert",
"to",
"a",
"different",
"AbstractDelegating",
"*",
"CacheStream"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/util/AbstractDelegatingIntCacheStream.java#L52-L55 |
datastax/java-driver | query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java | SchemaBuilder.createMaterializedView | @NonNull
public static CreateMaterializedViewStart createMaterializedView(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier viewName) {
"""
Starts a CREATE MATERIALIZED VIEW query with the given view name for the given keyspace name.
"""
return new DefaultCreateMaterializedView(keyspace, vi... | java | @NonNull
public static CreateMaterializedViewStart createMaterializedView(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier viewName) {
return new DefaultCreateMaterializedView(keyspace, viewName);
} | [
"@",
"NonNull",
"public",
"static",
"CreateMaterializedViewStart",
"createMaterializedView",
"(",
"@",
"Nullable",
"CqlIdentifier",
"keyspace",
",",
"@",
"NonNull",
"CqlIdentifier",
"viewName",
")",
"{",
"return",
"new",
"DefaultCreateMaterializedView",
"(",
"keyspace",
... | Starts a CREATE MATERIALIZED VIEW query with the given view name for the given keyspace name. | [
"Starts",
"a",
"CREATE",
"MATERIALIZED",
"VIEW",
"query",
"with",
"the",
"given",
"view",
"name",
"for",
"the",
"given",
"keyspace",
"name",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L221-L225 |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imagepipeline/bitmaps/PlatformBitmapFactory.java | PlatformBitmapFactory.createBitmap | public CloseableReference<Bitmap> createBitmap(
Bitmap source,
int x,
int y,
int width,
int height,
@Nullable Object callerContext) {
"""
Creates a bitmap from the specified subset of the source
bitmap. It is initialized with the same density as the original bitmap.
@param s... | java | public CloseableReference<Bitmap> createBitmap(
Bitmap source,
int x,
int y,
int width,
int height,
@Nullable Object callerContext) {
return createBitmap(source, x, y, width, height, null, false, callerContext);
} | [
"public",
"CloseableReference",
"<",
"Bitmap",
">",
"createBitmap",
"(",
"Bitmap",
"source",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
",",
"@",
"Nullable",
"Object",
"callerContext",
")",
"{",
"return",
"createBitmap",
"... | Creates a bitmap from the specified subset of the source
bitmap. It is initialized with the same density as the original bitmap.
@param source The bitmap we are subsetting
@param x The x coordinate of the first pixel in source
@param y The y coordinate of the first pixel in source
@param width The n... | [
"Creates",
"a",
"bitmap",
"from",
"the",
"specified",
"subset",
"of",
"the",
"source",
"bitmap",
".",
"It",
"is",
"initialized",
"with",
"the",
"same",
"density",
"as",
"the",
"original",
"bitmap",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/bitmaps/PlatformBitmapFactory.java#L170-L178 |
mikepenz/FastAdapter | app/src/main/java/com/mikepenz/fastadapter/app/items/RealmSampleUserItem.java | RealmSampleUserItem.bindView | @Override
public void bindView(ViewHolder holder, List<Object> payloads) {
"""
Binds the data of this item to the given holder
@param holder
"""
//set the selected state of this item. force this otherwise it may is missed when implementing an item
holder.itemView.setSelected(isSelected()... | java | @Override
public void bindView(ViewHolder holder, List<Object> payloads) {
//set the selected state of this item. force this otherwise it may is missed when implementing an item
holder.itemView.setSelected(isSelected());
//set the name
holder.name.setText(name);
} | [
"@",
"Override",
"public",
"void",
"bindView",
"(",
"ViewHolder",
"holder",
",",
"List",
"<",
"Object",
">",
"payloads",
")",
"{",
"//set the selected state of this item. force this otherwise it may is missed when implementing an item",
"holder",
".",
"itemView",
".",
"setS... | Binds the data of this item to the given holder
@param holder | [
"Binds",
"the",
"data",
"of",
"this",
"item",
"to",
"the",
"given",
"holder"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/app/src/main/java/com/mikepenz/fastadapter/app/items/RealmSampleUserItem.java#L238-L245 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java | QrCodeUtil.encode | public static BitMatrix encode(String content, BarcodeFormat format, QrConfig config) {
"""
将文本内容编码为条形码或二维码
@param content 文本内容
@param format 格式枚举
@param config 二维码配置,包括长、宽、边距、颜色等
@return {@link BitMatrix}
@since 4.1.2
"""
final MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
if (nu... | java | public static BitMatrix encode(String content, BarcodeFormat format, QrConfig config) {
final MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
if (null == config) {
// 默认配置
config = new QrConfig();
}
BitMatrix bitMatrix;
try {
bitMatrix = multiFormatWriter.encode(content, format... | [
"public",
"static",
"BitMatrix",
"encode",
"(",
"String",
"content",
",",
"BarcodeFormat",
"format",
",",
"QrConfig",
"config",
")",
"{",
"final",
"MultiFormatWriter",
"multiFormatWriter",
"=",
"new",
"MultiFormatWriter",
"(",
")",
";",
"if",
"(",
"null",
"==",
... | 将文本内容编码为条形码或二维码
@param content 文本内容
@param format 格式枚举
@param config 二维码配置,包括长、宽、边距、颜色等
@return {@link BitMatrix}
@since 4.1.2 | [
"将文本内容编码为条形码或二维码"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java#L247-L261 |
netty/netty | buffer/src/main/java/io/netty/buffer/Unpooled.java | Unpooled.copiedBuffer | public static ByteBuf copiedBuffer(
CharSequence string, int offset, int length, Charset charset) {
"""
Creates a new big-endian buffer whose content is a subregion of
the specified {@code string} encoded in the specified {@code charset}.
The new buffer's {@code readerIndex} and {@code writerIndex} a... | java | public static ByteBuf copiedBuffer(
CharSequence string, int offset, int length, Charset charset) {
if (string == null) {
throw new NullPointerException("string");
}
if (length == 0) {
return EMPTY_BUFFER;
}
if (string instanceof CharBuffer) {... | [
"public",
"static",
"ByteBuf",
"copiedBuffer",
"(",
"CharSequence",
"string",
",",
"int",
"offset",
",",
"int",
"length",
",",
"Charset",
"charset",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"string... | Creates a new big-endian buffer whose content is a subregion of
the specified {@code string} encoded in the specified {@code charset}.
The new buffer's {@code readerIndex} and {@code writerIndex} are
{@code 0} and the length of the encoded string respectively. | [
"Creates",
"a",
"new",
"big",
"-",
"endian",
"buffer",
"whose",
"content",
"is",
"a",
"subregion",
"of",
"the",
"specified",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L595-L620 |
structr/structr | structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java | HtmlServlet.findFile | private File findFile(final SecurityContext securityContext, final HttpServletRequest request, final String path) throws FrameworkException {
"""
Find a file with its name matching last path part
@param securityContext
@param request
@param path
@return file
@throws FrameworkException
"""
List<Linkab... | java | private File findFile(final SecurityContext securityContext, final HttpServletRequest request, final String path) throws FrameworkException {
List<Linkable> entryPoints = findPossibleEntryPoints(securityContext, request, path);
// If no results were found, try to replace whitespace by '+' or '%20'
if (entryPoin... | [
"private",
"File",
"findFile",
"(",
"final",
"SecurityContext",
"securityContext",
",",
"final",
"HttpServletRequest",
"request",
",",
"final",
"String",
"path",
")",
"throws",
"FrameworkException",
"{",
"List",
"<",
"Linkable",
">",
"entryPoints",
"=",
"findPossibl... | Find a file with its name matching last path part
@param securityContext
@param request
@param path
@return file
@throws FrameworkException | [
"Find",
"a",
"file",
"with",
"its",
"name",
"matching",
"last",
"path",
"part"
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java#L1025-L1046 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProtectedBranchesApi.java | ProtectedBranchesApi.protectBranch | public ProtectedBranch protectBranch(Integer projectIdOrPath, String branchName) throws GitLabApiException {
"""
Protects a single repository branch or several project repository branches using a wildcard protected branch.
<pre><code>GitLab Endpoint: POST /projects/:id/protected_branches</code></pre>
@param ... | java | public ProtectedBranch protectBranch(Integer projectIdOrPath, String branchName) throws GitLabApiException {
return protectBranch(projectIdOrPath, branchName, AccessLevel.MAINTAINER, AccessLevel.MAINTAINER);
} | [
"public",
"ProtectedBranch",
"protectBranch",
"(",
"Integer",
"projectIdOrPath",
",",
"String",
"branchName",
")",
"throws",
"GitLabApiException",
"{",
"return",
"protectBranch",
"(",
"projectIdOrPath",
",",
"branchName",
",",
"AccessLevel",
".",
"MAINTAINER",
",",
"A... | Protects a single repository branch or several project repository branches using a wildcard protected branch.
<pre><code>GitLab Endpoint: POST /projects/:id/protected_branches</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param branchName the name of... | [
"Protects",
"a",
"single",
"repository",
"branch",
"or",
"several",
"project",
"repository",
"branches",
"using",
"a",
"wildcard",
"protected",
"branch",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProtectedBranchesApi.java#L82-L84 |
bekkopen/NoCommons | src/main/java/no/bekk/bekkopen/date/NorwegianDateUtil.java | NorwegianDateUtil.getDate | private static Date getDate(int day, int month, int year) {
"""
Get the date for the given values.
@param day
The day.
@param month
The month.
@param year
The year.
@return The date represented by the given values.
"""
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, year);
cal.set(... | java | private static Date getDate(int day, int month, int year) {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, year);
cal.set(Calendar.MONTH, month);
cal.set(Calendar.DATE, day);
return cal.getTime();
} | [
"private",
"static",
"Date",
"getDate",
"(",
"int",
"day",
",",
"int",
"month",
",",
"int",
"year",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"YEAR",
",",
"year",
")",
... | Get the date for the given values.
@param day
The day.
@param month
The month.
@param year
The year.
@return The date represented by the given values. | [
"Get",
"the",
"date",
"for",
"the",
"given",
"values",
"."
] | train | https://github.com/bekkopen/NoCommons/blob/5a576696390cecaac111fa97fde581e0c1afb9b8/src/main/java/no/bekk/bekkopen/date/NorwegianDateUtil.java#L274-L280 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/taglib/el/EvalHelper.java | EvalHelper.evalString | public static String evalString(String propertyName, String propertyValue, Tag tag, PageContext pageContext) throws JspException {
"""
Evaluate the string EL expression passed as parameter
@param propertyName the property name
@param propertyValue the property value
@param tag the tag
@param pageContext the pa... | java | public static String evalString(String propertyName, String propertyValue, Tag tag, PageContext pageContext) throws JspException{
return (String) ExpressionEvaluatorManager.evaluate(propertyName,
propertyValue, String.class, tag, pageContext);
} | [
"public",
"static",
"String",
"evalString",
"(",
"String",
"propertyName",
",",
"String",
"propertyValue",
",",
"Tag",
"tag",
",",
"PageContext",
"pageContext",
")",
"throws",
"JspException",
"{",
"return",
"(",
"String",
")",
"ExpressionEvaluatorManager",
".",
"e... | Evaluate the string EL expression passed as parameter
@param propertyName the property name
@param propertyValue the property value
@param tag the tag
@param pageContext the page context
@return the value corresponding to the EL expression passed as parameter
@throws JspException if an exception occurs | [
"Evaluate",
"the",
"string",
"EL",
"expression",
"passed",
"as",
"parameter"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/taglib/el/EvalHelper.java#L39-L43 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/ToolScreen.java | ToolScreen.isPrintableControl | public boolean isPrintableControl(ScreenField sField, int iPrintOptions) {
"""
Display this sub-control in html input format?
@param iPrintOptions The view specific print options.
@return True if this sub-control is printable.
"""
// Override this to break
if ((sField == null) || (sField == t... | java | public boolean isPrintableControl(ScreenField sField, int iPrintOptions)
{
// Override this to break
if ((sField == null) || (sField == this))
{ // Asking about this control
return false; // Tool screens are not printed as a sub-screen.
}
return super.isP... | [
"public",
"boolean",
"isPrintableControl",
"(",
"ScreenField",
"sField",
",",
"int",
"iPrintOptions",
")",
"{",
"// Override this to break",
"if",
"(",
"(",
"sField",
"==",
"null",
")",
"||",
"(",
"sField",
"==",
"this",
")",
")",
"{",
"// Asking about this cont... | Display this sub-control in html input format?
@param iPrintOptions The view specific print options.
@return True if this sub-control is printable. | [
"Display",
"this",
"sub",
"-",
"control",
"in",
"html",
"input",
"format?"
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/ToolScreen.java#L179-L187 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMath.java | NumberMath.rightShiftUnsigned | public static Number rightShiftUnsigned(Number left, Number right) {
"""
For this operation, consider the operands independently. Throw an exception if the right operand
(shift distance) is not an integral type. For the left operand (shift value) also require an integral
type, but do NOT promote from Integer t... | java | public static Number rightShiftUnsigned(Number left, Number right) {
if (isFloatingPoint(right) || isBigDecimal(right)) {
throw new UnsupportedOperationException("Shift distance must be an integral type, but " + right + " (" + right.getClass().getName() + ") was supplied");
}
return ... | [
"public",
"static",
"Number",
"rightShiftUnsigned",
"(",
"Number",
"left",
",",
"Number",
"right",
")",
"{",
"if",
"(",
"isFloatingPoint",
"(",
"right",
")",
"||",
"isBigDecimal",
"(",
"right",
")",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(... | For this operation, consider the operands independently. Throw an exception if the right operand
(shift distance) is not an integral type. For the left operand (shift value) also require an integral
type, but do NOT promote from Integer to Long. This is consistent with Java, and makes sense for the
shift operators. | [
"For",
"this",
"operation",
"consider",
"the",
"operands",
"independently",
".",
"Throw",
"an",
"exception",
"if",
"the",
"right",
"operand",
"(",
"shift",
"distance",
")",
"is",
"not",
"an",
"integral",
"type",
".",
"For",
"the",
"left",
"operand",
"(",
"... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMath.java#L123-L128 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/workflow/BaseWorkflowExecutor.java | BaseWorkflowExecutor.addStepFailureContextData | protected void addStepFailureContextData(
StepExecutionResult stepResult,
ExecutionContextImpl.Builder builder
) {
"""
Add step result failure information to the data context
@param stepResult result
@return new context
"""
HashMap<String, String>
... | java | protected void addStepFailureContextData(
StepExecutionResult stepResult,
ExecutionContextImpl.Builder builder
)
{
HashMap<String, String>
resultData = new HashMap<>();
if (null != stepResult.getFailureData()) {
//convert values to string
... | [
"protected",
"void",
"addStepFailureContextData",
"(",
"StepExecutionResult",
"stepResult",
",",
"ExecutionContextImpl",
".",
"Builder",
"builder",
")",
"{",
"HashMap",
"<",
"String",
",",
"String",
">",
"resultData",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
... | Add step result failure information to the data context
@param stepResult result
@return new context | [
"Add",
"step",
"result",
"failure",
"information",
"to",
"the",
"data",
"context"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/workflow/BaseWorkflowExecutor.java#L381-L407 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/DirectQuickSelectSketchR.java | DirectQuickSelectSketchR.readOnlyWrap | static DirectQuickSelectSketchR readOnlyWrap(final Memory srcMem, final long seed) {
"""
Wrap a sketch around the given source Memory containing sketch data that originated from
this sketch.
@param srcMem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
The given Memory object must be in hash t... | java | static DirectQuickSelectSketchR readOnlyWrap(final Memory srcMem, final long seed) {
final int preambleLongs = extractPreLongs(srcMem); //byte 0
final int lgNomLongs = extractLgNomLongs(srcMem); //byte 3
final int lgArrLongs = extractLgArrLongs(srcMem); /... | [
"static",
"DirectQuickSelectSketchR",
"readOnlyWrap",
"(",
"final",
"Memory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"int",
"preambleLongs",
"=",
"extractPreLongs",
"(",
"srcMem",
")",
";",
"//byte 0",
"final",
"int",
"lgNomLongs",
"=",
"extr... | Wrap a sketch around the given source Memory containing sketch data that originated from
this sketch.
@param srcMem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
The given Memory object must be in hash table form and not read only.
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See ... | [
"Wrap",
"a",
"sketch",
"around",
"the",
"given",
"source",
"Memory",
"containing",
"sketch",
"data",
"that",
"originated",
"from",
"this",
"sketch",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/DirectQuickSelectSketchR.java#L60-L72 |
chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/IntervalST.java | IntervalST.prettyPrint | private void prettyPrint(Node<K, V> n) {
"""
Recursively prints the tree.
@param n the node to start recursion at
"""
if (n.left != null) {
prettyPrint(n.left);
}
System.out.println(n);
if (n.right != null) {
prettyPrint(n.right);
}
} | java | private void prettyPrint(Node<K, V> n) {
if (n.left != null) {
prettyPrint(n.left);
}
System.out.println(n);
if (n.right != null) {
prettyPrint(n.right);
}
} | [
"private",
"void",
"prettyPrint",
"(",
"Node",
"<",
"K",
",",
"V",
">",
"n",
")",
"{",
"if",
"(",
"n",
".",
"left",
"!=",
"null",
")",
"{",
"prettyPrint",
"(",
"n",
".",
"left",
")",
";",
"}",
"System",
".",
"out",
".",
"println",
"(",
"n",
"... | Recursively prints the tree.
@param n the node to start recursion at | [
"Recursively",
"prints",
"the",
"tree",
"."
] | train | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/IntervalST.java#L209-L217 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataDecoder.java | DataDecoder.decodeCharacterObj | public static Character decodeCharacterObj(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a Character object from exactly 1 or 3 bytes. If null is
returned, then 1 byte was read.
@param src source of encoded bytes
@param srcOffset offset into source array
@return Character ... | java | public static Character decodeCharacterObj(byte[] src, int srcOffset)
throws CorruptEncodingException
{
try {
int b = src[srcOffset];
if (b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW) {
return null;
}
return decodeChar(src, srcOffs... | [
"public",
"static",
"Character",
"decodeCharacterObj",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"try",
"{",
"int",
"b",
"=",
"src",
"[",
"srcOffset",
"]",
";",
"if",
"(",
"b",
"==",
"NULL_BYTE_H... | Decodes a Character object from exactly 1 or 3 bytes. If null is
returned, then 1 byte was read.
@param src source of encoded bytes
@param srcOffset offset into source array
@return Character object or null | [
"Decodes",
"a",
"Character",
"object",
"from",
"exactly",
"1",
"or",
"3",
"bytes",
".",
"If",
"null",
"is",
"returned",
"then",
"1",
"byte",
"was",
"read",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L231-L243 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/FrameAndRootPainter.java | FrameAndRootPainter.createTitleBarGradient | private Paint createTitleBarGradient(Shape s, int titleHeight, FourColors defColors) {
"""
Create the gradient to paint the frame interior.
@param s the interior shape.
@param titleHeight the height of the title bar, or 0 if none.
@param defColors the color set to construct the gradient from.
... | java | private Paint createTitleBarGradient(Shape s, int titleHeight, FourColors defColors) {
Rectangle2D bounds = s.getBounds2D();
float midX = (float) bounds.getCenterX();
float y = (float) bounds.getY();
float h = (float) bounds.getHeight();
return crea... | [
"private",
"Paint",
"createTitleBarGradient",
"(",
"Shape",
"s",
",",
"int",
"titleHeight",
",",
"FourColors",
"defColors",
")",
"{",
"Rectangle2D",
"bounds",
"=",
"s",
".",
"getBounds2D",
"(",
")",
";",
"float",
"midX",
"=",
"(",
"float",
")",
"bounds",
"... | Create the gradient to paint the frame interior.
@param s the interior shape.
@param titleHeight the height of the title bar, or 0 if none.
@param defColors the color set to construct the gradient from.
@return the gradient. | [
"Create",
"the",
"gradient",
"to",
"paint",
"the",
"frame",
"interior",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/FrameAndRootPainter.java#L349-L357 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.