repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 196 | func_name stringlengths 7 107 | whole_func_string stringlengths 76 3.82k | language stringclasses 1
value | func_code_string stringlengths 76 3.82k | func_code_tokens listlengths 22 717 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 508 | split_name stringclasses 1
value | func_code_url stringlengths 111 310 |
|---|---|---|---|---|---|---|---|---|---|---|
grails/grails-core | grails-core/src/main/groovy/grails/core/ArtefactHandlerAdapter.java | ArtefactHandlerAdapter.newArtefactClass | public GrailsClass newArtefactClass(@SuppressWarnings("rawtypes") Class artefactClass) {
try {
Constructor<?> c = grailsClassImpl.getDeclaredConstructor(new Class[] { Class.class });
// TODO GRAILS-720 plugin class instance created here first
return (GrailsClass) c.newInstance(new Object[] { artefactClass});
}
catch (NoSuchMethodException e) {
throw new GrailsRuntimeException("Unable to locate constructor with Class parameter for "+artefactClass, e);
}
catch (IllegalAccessException e) {
throw new GrailsRuntimeException("Unable to locate constructor with Class parameter for "+artefactClass, e);
}
catch (InvocationTargetException e) {
throw new GrailsRuntimeException("Error instantiated artefact class [" + artefactClass + "] of type ["+grailsClassImpl+"]: " + (e.getMessage() != null ? e.getMessage() : e.getClass().getSimpleName()), e);
}
catch (InstantiationException e) {
throw new GrailsRuntimeException("Error instantiated artefact class [" + artefactClass + "] of type ["+grailsClassImpl+"]: " + (e.getMessage() != null ? e.getMessage() : e.getClass().getSimpleName()), e);
}
} | java | public GrailsClass newArtefactClass(@SuppressWarnings("rawtypes") Class artefactClass) {
try {
Constructor<?> c = grailsClassImpl.getDeclaredConstructor(new Class[] { Class.class });
// TODO GRAILS-720 plugin class instance created here first
return (GrailsClass) c.newInstance(new Object[] { artefactClass});
}
catch (NoSuchMethodException e) {
throw new GrailsRuntimeException("Unable to locate constructor with Class parameter for "+artefactClass, e);
}
catch (IllegalAccessException e) {
throw new GrailsRuntimeException("Unable to locate constructor with Class parameter for "+artefactClass, e);
}
catch (InvocationTargetException e) {
throw new GrailsRuntimeException("Error instantiated artefact class [" + artefactClass + "] of type ["+grailsClassImpl+"]: " + (e.getMessage() != null ? e.getMessage() : e.getClass().getSimpleName()), e);
}
catch (InstantiationException e) {
throw new GrailsRuntimeException("Error instantiated artefact class [" + artefactClass + "] of type ["+grailsClassImpl+"]: " + (e.getMessage() != null ? e.getMessage() : e.getClass().getSimpleName()), e);
}
} | [
"public",
"GrailsClass",
"newArtefactClass",
"(",
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"Class",
"artefactClass",
")",
"{",
"try",
"{",
"Constructor",
"<",
"?",
">",
"c",
"=",
"grailsClassImpl",
".",
"getDeclaredConstructor",
"(",
"new",
"Class",
"[... | <p>Creates new GrailsClass derived object using the type supplied in constructor. May not perform
optimally but is a convenience.</p>
@param artefactClass Creates a new artefact for the given class
@return An instance of the GrailsClass interface representing the artefact | [
"<p",
">",
"Creates",
"new",
"GrailsClass",
"derived",
"object",
"using",
"the",
"type",
"supplied",
"in",
"constructor",
".",
"May",
"not",
"perform",
"optimally",
"but",
"is",
"a",
"convenience",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/ArtefactHandlerAdapter.java#L157-L175 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/MathUtils.java | MathUtils.randomLong | public static long randomLong(final long min, final long max) {
return Math.round(Math.random() * (max - min) + min);
} | java | public static long randomLong(final long min, final long max) {
return Math.round(Math.random() * (max - min) + min);
} | [
"public",
"static",
"long",
"randomLong",
"(",
"final",
"long",
"min",
",",
"final",
"long",
"max",
")",
"{",
"return",
"Math",
".",
"round",
"(",
"Math",
".",
"random",
"(",
")",
"*",
"(",
"max",
"-",
"min",
")",
"+",
"min",
")",
";",
"}"
] | Returns a natural long value between given minimum value and max value.
@param min
the minimum value to random.
@param max
the max value to random.
@return a natural long value between given minimum value and max value. | [
"Returns",
"a",
"natural",
"long",
"value",
"between",
"given",
"minimum",
"value",
"and",
"max",
"value",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/MathUtils.java#L88-L91 |
HadoopGenomics/Hadoop-BAM | src/main/java/org/seqdoop/hadoop_bam/util/NIOFileUtil.java | NIOFileUtil.asPath | public static Path asPath(URI uri) {
try {
return Paths.get(uri);
} catch (FileSystemNotFoundException e) {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null) {
throw e;
}
try {
return FileSystems.newFileSystem(uri, new HashMap<>(), cl).provider().getPath(uri);
} catch (IOException ex) {
throw new RuntimeException("Cannot create filesystem for " + uri, ex);
}
}
} | java | public static Path asPath(URI uri) {
try {
return Paths.get(uri);
} catch (FileSystemNotFoundException e) {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null) {
throw e;
}
try {
return FileSystems.newFileSystem(uri, new HashMap<>(), cl).provider().getPath(uri);
} catch (IOException ex) {
throw new RuntimeException("Cannot create filesystem for " + uri, ex);
}
}
} | [
"public",
"static",
"Path",
"asPath",
"(",
"URI",
"uri",
")",
"{",
"try",
"{",
"return",
"Paths",
".",
"get",
"(",
"uri",
")",
";",
"}",
"catch",
"(",
"FileSystemNotFoundException",
"e",
")",
"{",
"ClassLoader",
"cl",
"=",
"Thread",
".",
"currentThread",... | Convert the given path {@link URI} to a {@link Path} object.
@param uri the path to convert
@return a {@link Path} object | [
"Convert",
"the",
"given",
"path",
"{"
] | train | https://github.com/HadoopGenomics/Hadoop-BAM/blob/9f974cf635a8d72f69604021cc3d5f3469d38d2f/src/main/java/org/seqdoop/hadoop_bam/util/NIOFileUtil.java#L31-L45 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TransliteratorParser.java | TransliteratorParser.resemblesPragma | static boolean resemblesPragma(String rule, int pos, int limit) {
// Must start with /use\s/i
return Utility.parsePattern(rule, pos, limit, "use ", null) >= 0;
} | java | static boolean resemblesPragma(String rule, int pos, int limit) {
// Must start with /use\s/i
return Utility.parsePattern(rule, pos, limit, "use ", null) >= 0;
} | [
"static",
"boolean",
"resemblesPragma",
"(",
"String",
"rule",
",",
"int",
"pos",
",",
"int",
"limit",
")",
"{",
"// Must start with /use\\s/i",
"return",
"Utility",
".",
"parsePattern",
"(",
"rule",
",",
"pos",
",",
"limit",
",",
"\"use \"",
",",
"null",
")... | Return true if the given rule looks like a pragma.
@param pos offset to the first non-whitespace character
of the rule.
@param limit pointer past the last character of the rule. | [
"Return",
"true",
"if",
"the",
"given",
"rule",
"looks",
"like",
"a",
"pragma",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TransliteratorParser.java#L1372-L1375 |
kiegroup/drools | kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/CompiledFEELSemanticMappings.java | CompiledFEELSemanticMappings.div | public static Object div(Object left, Object right) {
return InfixOpNode.div(left, right, null);
} | java | public static Object div(Object left, Object right) {
return InfixOpNode.div(left, right, null);
} | [
"public",
"static",
"Object",
"div",
"(",
"Object",
"left",
",",
"Object",
"right",
")",
"{",
"return",
"InfixOpNode",
".",
"div",
"(",
"left",
",",
"right",
",",
"null",
")",
";",
"}"
] | FEEL spec Table 45
Delegates to {@link InfixOpNode} except evaluationcontext | [
"FEEL",
"spec",
"Table",
"45",
"Delegates",
"to",
"{"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/CompiledFEELSemanticMappings.java#L322-L324 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java | ClustersInner.getGatewaySettings | public GatewaySettingsInner getGatewaySettings(String resourceGroupName, String clusterName) {
return getGatewaySettingsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body();
} | java | public GatewaySettingsInner getGatewaySettings(String resourceGroupName, String clusterName) {
return getGatewaySettingsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body();
} | [
"public",
"GatewaySettingsInner",
"getGatewaySettings",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
")",
"{",
"return",
"getGatewaySettingsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
")",
".",
"toBlocking",
"(",
")",
".",... | Gets the gateway settings for the specified cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
@return the GatewaySettingsInner object if successful. | [
"Gets",
"the",
"gateway",
"settings",
"for",
"the",
"specified",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java#L1463-L1465 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java | FieldUtils.writeField | public static void writeField(final Field field, final Object target, final Object value) throws IllegalAccessException {
writeField(field, target, value, false);
} | java | public static void writeField(final Field field, final Object target, final Object value) throws IllegalAccessException {
writeField(field, target, value, false);
} | [
"public",
"static",
"void",
"writeField",
"(",
"final",
"Field",
"field",
",",
"final",
"Object",
"target",
",",
"final",
"Object",
"value",
")",
"throws",
"IllegalAccessException",
"{",
"writeField",
"(",
"field",
",",
"target",
",",
"value",
",",
"false",
... | Writes an accessible {@link Field}.
@param field
to write
@param target
the object to call on, may be {@code null} for {@code static} fields
@param value
to set
@throws IllegalAccessException
if the field or target is {@code null}, the field is not accessible or is {@code final}, or
{@code value} is not assignable | [
"Writes",
"an",
"accessible",
"{",
"@link",
"Field",
"}",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L661-L663 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/ntp_param.java | ntp_param.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ntp_param_responses result = (ntp_param_responses) service.get_payload_formatter().string_to_resource(ntp_param_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NOT_EXISTS)
service.clear_session();
throw new nitro_exception(result.message, result.errorcode, (base_response [])result.ntp_param_response_array);
}
ntp_param[] result_ntp_param = new ntp_param[result.ntp_param_response_array.length];
for(int i = 0; i < result.ntp_param_response_array.length; i++)
{
result_ntp_param[i] = result.ntp_param_response_array[i].ntp_param[0];
}
return result_ntp_param;
} | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ntp_param_responses result = (ntp_param_responses) service.get_payload_formatter().string_to_resource(ntp_param_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NOT_EXISTS)
service.clear_session();
throw new nitro_exception(result.message, result.errorcode, (base_response [])result.ntp_param_response_array);
}
ntp_param[] result_ntp_param = new ntp_param[result.ntp_param_response_array.length];
for(int i = 0; i < result.ntp_param_response_array.length; i++)
{
result_ntp_param[i] = result.ntp_param_response_array[i].ntp_param[0];
}
return result_ntp_param;
} | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ntp_param_responses",
"result",
"=",
"(",
"ntp_param_responses",
")",
"service",
".",
"get_payload_formatter"... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/ntp_param.java#L289-L306 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorOutputElem.java | ProcessorOutputElem.setForeignAttr | public void setForeignAttr(String attrUri, String attrLocalName, String attrRawName, String attrValue)
{
QName key = new QName(attrUri, attrLocalName);
m_outputProperties.setProperty(key, attrValue);
} | java | public void setForeignAttr(String attrUri, String attrLocalName, String attrRawName, String attrValue)
{
QName key = new QName(attrUri, attrLocalName);
m_outputProperties.setProperty(key, attrValue);
} | [
"public",
"void",
"setForeignAttr",
"(",
"String",
"attrUri",
",",
"String",
"attrLocalName",
",",
"String",
"attrRawName",
",",
"String",
"attrValue",
")",
"{",
"QName",
"key",
"=",
"new",
"QName",
"(",
"attrUri",
",",
"attrLocalName",
")",
";",
"m_outputProp... | Set a foreign property from the attribute value.
@param newValue non-null reference to attribute value. | [
"Set",
"a",
"foreign",
"property",
"from",
"the",
"attribute",
"value",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorOutputElem.java#L151-L155 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/Criteria.java | Criteria.addGreaterOrEqualThan | public void addGreaterOrEqualThan(Object attribute, Object value)
{
// PAW
// addSelectionCriteria(ValueCriteria.buildNotLessCriteria(attribute, value, getAlias()));
addSelectionCriteria(ValueCriteria.buildNotLessCriteria(attribute, value, getUserAlias(attribute)));
} | java | public void addGreaterOrEqualThan(Object attribute, Object value)
{
// PAW
// addSelectionCriteria(ValueCriteria.buildNotLessCriteria(attribute, value, getAlias()));
addSelectionCriteria(ValueCriteria.buildNotLessCriteria(attribute, value, getUserAlias(attribute)));
} | [
"public",
"void",
"addGreaterOrEqualThan",
"(",
"Object",
"attribute",
",",
"Object",
"value",
")",
"{",
"// PAW\r",
"// addSelectionCriteria(ValueCriteria.buildNotLessCriteria(attribute, value, getAlias()));\r",
"addSelectionCriteria",
"(",
"ValueCriteria",
".",
"buildNotLessCrite... | Adds GreaterOrEqual Than (>=) criteria,
customer_id >= 10034
@param attribute The field name to be used
@param value An object representing the value of the field | [
"Adds",
"GreaterOrEqual",
"Than",
"(",
">",
"=",
")",
"criteria",
"customer_id",
">",
"=",
"10034"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/Criteria.java#L407-L412 |
Alluxio/alluxio | underfs/kodo/src/main/java/alluxio/underfs/kodo/KodoClient.java | KodoClient.listFiles | public FileListing listFiles(String prefix, String marker, int limit, String delimiter)
throws QiniuException {
return mBucketManager.listFiles(mBucketName, prefix, marker, limit, delimiter);
} | java | public FileListing listFiles(String prefix, String marker, int limit, String delimiter)
throws QiniuException {
return mBucketManager.listFiles(mBucketName, prefix, marker, limit, delimiter);
} | [
"public",
"FileListing",
"listFiles",
"(",
"String",
"prefix",
",",
"String",
"marker",
",",
"int",
"limit",
",",
"String",
"delimiter",
")",
"throws",
"QiniuException",
"{",
"return",
"mBucketManager",
".",
"listFiles",
"(",
"mBucketName",
",",
"prefix",
",",
... | Lists object for Qiniu kodo.
@param prefix prefix for bucket
@param marker Marker returned the last time a file list was obtained
@param limit Length limit for each iteration, Max. 1000
@param delimiter Specifies a directory separator that lists all common prefixes (simulated
listing directory effects). The default is an empty string
@return result for list | [
"Lists",
"object",
"for",
"Qiniu",
"kodo",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/kodo/src/main/java/alluxio/underfs/kodo/KodoClient.java#L172-L175 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/JodaBeanSer.java | JodaBeanSer.withDeserializers | public JodaBeanSer withDeserializers(SerDeserializers deserializers) {
JodaBeanUtils.notNull(deserializers, "deserializers");
return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived);
} | java | public JodaBeanSer withDeserializers(SerDeserializers deserializers) {
JodaBeanUtils.notNull(deserializers, "deserializers");
return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived);
} | [
"public",
"JodaBeanSer",
"withDeserializers",
"(",
"SerDeserializers",
"deserializers",
")",
"{",
"JodaBeanUtils",
".",
"notNull",
"(",
"deserializers",
",",
"\"deserializers\"",
")",
";",
"return",
"new",
"JodaBeanSer",
"(",
"indent",
",",
"newLine",
",",
"converte... | Returns a copy of this serializer with the specified deserializers.
<p>
The default deserializers can be modified.
<p>
This can be used to select a more lenient mode of parsing, see {@link SerDeserializers#LENIENT}.
@param deserializers the deserializers, not null
@return a copy of this object with the converter changed, not null | [
"Returns",
"a",
"copy",
"of",
"this",
"serializer",
"with",
"the",
"specified",
"deserializers",
".",
"<p",
">",
"The",
"default",
"deserializers",
"can",
"be",
"modified",
".",
"<p",
">",
"This",
"can",
"be",
"used",
"to",
"select",
"a",
"more",
"lenient"... | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/JodaBeanSer.java#L226-L229 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/SafeDatasetCommit.java | SafeDatasetCommit.safeCommitDataset | private void safeCommitDataset(Collection<TaskState> taskStates, DataPublisher publisher) {
synchronized (GLOBAL_LOCK) {
commitDataset(taskStates, publisher);
}
} | java | private void safeCommitDataset(Collection<TaskState> taskStates, DataPublisher publisher) {
synchronized (GLOBAL_LOCK) {
commitDataset(taskStates, publisher);
}
} | [
"private",
"void",
"safeCommitDataset",
"(",
"Collection",
"<",
"TaskState",
">",
"taskStates",
",",
"DataPublisher",
"publisher",
")",
"{",
"synchronized",
"(",
"GLOBAL_LOCK",
")",
"{",
"commitDataset",
"(",
"taskStates",
",",
"publisher",
")",
";",
"}",
"}"
] | Synchronized version of {@link #commitDataset(Collection, DataPublisher)} used when publisher is not
thread safe. | [
"Synchronized",
"version",
"of",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/SafeDatasetCommit.java#L255-L259 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.deleteCertificate | public DeletedCertificateBundle deleteCertificate(String vaultBaseUrl, String certificateName) {
return deleteCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body();
} | java | public DeletedCertificateBundle deleteCertificate(String vaultBaseUrl, String certificateName) {
return deleteCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body();
} | [
"public",
"DeletedCertificateBundle",
"deleteCertificate",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
")",
"{",
"return",
"deleteCertificateWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"certificateName",
")",
".",
"toBlocking",
"(",
")",
".",... | Deletes a certificate from a specified key vault.
Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param certificateName The name of the certificate.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws KeyVaultErrorException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
@return the DeletedCertificateBundle object if successful. | [
"Deletes",
"a",
"certificate",
"from",
"a",
"specified",
"key",
"vault",
".",
"Deletes",
"all",
"versions",
"of",
"a",
"certificate",
"object",
"along",
"with",
"its",
"associated",
"policy",
".",
"Delete",
"certificate",
"cannot",
"be",
"used",
"to",
"remove"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L5325-L5327 |
jfaster/mango | src/main/java/org/jfaster/mango/util/PatternMatchUtils.java | PatternMatchUtils.simpleMatch | public static boolean simpleMatch(String[] patterns, String str) {
if (patterns != null) {
for (int i = 0; i < patterns.length; i++) {
if (simpleMatch(patterns[i], str)) {
return true;
}
}
}
return false;
} | java | public static boolean simpleMatch(String[] patterns, String str) {
if (patterns != null) {
for (int i = 0; i < patterns.length; i++) {
if (simpleMatch(patterns[i], str)) {
return true;
}
}
}
return false;
} | [
"public",
"static",
"boolean",
"simpleMatch",
"(",
"String",
"[",
"]",
"patterns",
",",
"String",
"str",
")",
"{",
"if",
"(",
"patterns",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"patterns",
".",
"length",
";",
"i",
... | Match a String against the given patterns, supporting the following simple
pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an
arbitrary number of pattern parts), as well as direct equality.
@param patterns the patterns to match against
@param str the String to match
@return whether the String matches any of the given patterns | [
"Match",
"a",
"String",
"against",
"the",
"given",
"patterns",
"supporting",
"the",
"following",
"simple",
"pattern",
"styles",
":",
"xxx",
"*",
"*",
"xxx",
"*",
"xxx",
"*",
"and",
"xxx",
"*",
"yyy",
"matches",
"(",
"with",
"an",
"arbitrary",
"number",
"... | train | https://github.com/jfaster/mango/blob/4f078846f1daa2cb92424edcde5964267e390e8f/src/main/java/org/jfaster/mango/util/PatternMatchUtils.java#L57-L66 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/RepositoryCache.java | RepositoryCache.destroyWorkspace | public boolean destroyWorkspace( final String name,
final WritableSessionCache removeSession ) {
if (workspaceNames.contains(name)) {
if (configuration.getPredefinedWorkspaceNames().contains(name)) {
throw new UnsupportedOperationException(JcrI18n.unableToDestroyPredefinedWorkspaceInRepository.text(name,
getName()));
}
if (configuration.getDefaultWorkspaceName().equals(name)) {
throw new UnsupportedOperationException(JcrI18n.unableToDestroyDefaultWorkspaceInRepository.text(name, getName()));
}
if (this.systemWorkspaceName.equals(name)) {
throw new UnsupportedOperationException(JcrI18n.unableToDestroySystemWorkspaceInRepository.text(name, getName()));
}
if (!configuration.isCreatingWorkspacesAllowed()) {
throw new UnsupportedOperationException(JcrI18n.creatingWorkspacesIsNotAllowedInRepository.text(getName()));
}
// persist *all* the changes in one unit, because in case of failure we need to remain in consistent state
localStore().runInTransaction(() -> {
// unlink the system node
removeSession.mutable(removeSession.getRootKey()).removeChild(removeSession, getSystemKey());
// remove the workspace and persist it
RepositoryCache.this.workspaceNames.remove(name);
refreshRepositoryMetadata(true);
// persist the active changes in the session
removeSession.save();
return null;
}, 0);
// And notify the others - this notification will clear & close the WS cache via the local listener
String userId = context.getSecurityContext().getUserName();
Map<String, String> userData = context.getData();
DateTime timestamp = context.getValueFactories().getDateFactory().create();
RecordingChanges changes = new RecordingChanges(context.getId(), context.getProcessId(), this.getKey(), null,
repositoryEnvironment.journalId());
changes.workspaceRemoved(name);
changes.freeze(userId, userData, timestamp);
this.changeBus.notify(changes);
return true;
}
return false;
} | java | public boolean destroyWorkspace( final String name,
final WritableSessionCache removeSession ) {
if (workspaceNames.contains(name)) {
if (configuration.getPredefinedWorkspaceNames().contains(name)) {
throw new UnsupportedOperationException(JcrI18n.unableToDestroyPredefinedWorkspaceInRepository.text(name,
getName()));
}
if (configuration.getDefaultWorkspaceName().equals(name)) {
throw new UnsupportedOperationException(JcrI18n.unableToDestroyDefaultWorkspaceInRepository.text(name, getName()));
}
if (this.systemWorkspaceName.equals(name)) {
throw new UnsupportedOperationException(JcrI18n.unableToDestroySystemWorkspaceInRepository.text(name, getName()));
}
if (!configuration.isCreatingWorkspacesAllowed()) {
throw new UnsupportedOperationException(JcrI18n.creatingWorkspacesIsNotAllowedInRepository.text(getName()));
}
// persist *all* the changes in one unit, because in case of failure we need to remain in consistent state
localStore().runInTransaction(() -> {
// unlink the system node
removeSession.mutable(removeSession.getRootKey()).removeChild(removeSession, getSystemKey());
// remove the workspace and persist it
RepositoryCache.this.workspaceNames.remove(name);
refreshRepositoryMetadata(true);
// persist the active changes in the session
removeSession.save();
return null;
}, 0);
// And notify the others - this notification will clear & close the WS cache via the local listener
String userId = context.getSecurityContext().getUserName();
Map<String, String> userData = context.getData();
DateTime timestamp = context.getValueFactories().getDateFactory().create();
RecordingChanges changes = new RecordingChanges(context.getId(), context.getProcessId(), this.getKey(), null,
repositoryEnvironment.journalId());
changes.workspaceRemoved(name);
changes.freeze(userId, userData, timestamp);
this.changeBus.notify(changes);
return true;
}
return false;
} | [
"public",
"boolean",
"destroyWorkspace",
"(",
"final",
"String",
"name",
",",
"final",
"WritableSessionCache",
"removeSession",
")",
"{",
"if",
"(",
"workspaceNames",
".",
"contains",
"(",
"name",
")",
")",
"{",
"if",
"(",
"configuration",
".",
"getPredefinedWor... | Permanently destroys the workspace with the supplied name, if the repository is appropriately configured, also unlinking
the jcr:system node from the root node . If no such workspace exists in this repository, this method simply returns.
Otherwise, this method attempts to destroy the named workspace.
@param name the workspace name
@param removeSession an outside session which will be used to unlink the jcr:system node and which is needed to guarantee
atomicity.
@return true if the workspace with the supplied name existed and was destroyed, or false otherwise
@throws UnsupportedOperationException if this repository was not configured to allow
{@link RepositoryConfiguration#isCreatingWorkspacesAllowed() creation (and destruction) of workspaces}. | [
"Permanently",
"destroys",
"the",
"workspace",
"with",
"the",
"supplied",
"name",
"if",
"the",
"repository",
"is",
"appropriately",
"configured",
"also",
"unlinking",
"the",
"jcr",
":",
"system",
"node",
"from",
"the",
"root",
"node",
".",
"If",
"no",
"such",
... | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/RepositoryCache.java#L822-L863 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java | EmbeddedNeo4jEntityQueries.findEntity | public Node findEntity(GraphDatabaseService executionEngine, Object[] columnValues) {
Map<String, Object> params = params( columnValues );
Result result = executionEngine.execute( getFindEntityQuery(), params );
return singleResult( result );
} | java | public Node findEntity(GraphDatabaseService executionEngine, Object[] columnValues) {
Map<String, Object> params = params( columnValues );
Result result = executionEngine.execute( getFindEntityQuery(), params );
return singleResult( result );
} | [
"public",
"Node",
"findEntity",
"(",
"GraphDatabaseService",
"executionEngine",
",",
"Object",
"[",
"]",
"columnValues",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
"=",
"params",
"(",
"columnValues",
")",
";",
"Result",
"result",
"=",
"exe... | Find the node corresponding to an entity.
@param executionEngine the {@link GraphDatabaseService} used to run the query
@param columnValues the values in {@link org.hibernate.ogm.model.key.spi.EntityKey#getColumnValues()}
@return the corresponding node | [
"Find",
"the",
"node",
"corresponding",
"to",
"an",
"entity",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java#L79-L83 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.identity | public static <T> T identity(Object self, Closure<T> closure) {
return DefaultGroovyMethods.with(self, closure);
} | java | public static <T> T identity(Object self, Closure<T> closure) {
return DefaultGroovyMethods.with(self, closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"identity",
"(",
"Object",
"self",
",",
"Closure",
"<",
"T",
">",
"closure",
")",
"{",
"return",
"DefaultGroovyMethods",
".",
"with",
"(",
"self",
",",
"closure",
")",
";",
"}"
] | Allows the closure to be called for the object reference self.
Synonym for 'with()'.
@param self the object to have a closure act upon
@param closure the closure to call on the object
@return result of calling the closure
@since 1.0 | [
"Allows",
"the",
"closure",
"to",
"be",
"called",
"for",
"the",
"object",
"reference",
"self",
".",
"Synonym",
"for",
"with",
"()",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L198-L200 |
MTDdk/jawn | jawn-core/src/main/java/net/javapla/jawn/core/routes/InternalRoute.java | InternalRoute.getPathParametersEncoded | public Map<String, String> getPathParametersEncoded(String requestUri) {
Matcher m = regex.matcher(requestUri);
return mapParametersFromPath(requestUri, parameters, m);
} | java | public Map<String, String> getPathParametersEncoded(String requestUri) {
Matcher m = regex.matcher(requestUri);
return mapParametersFromPath(requestUri, parameters, m);
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getPathParametersEncoded",
"(",
"String",
"requestUri",
")",
"{",
"Matcher",
"m",
"=",
"regex",
".",
"matcher",
"(",
"requestUri",
")",
";",
"return",
"mapParametersFromPath",
"(",
"requestUri",
",",
"parame... | This method does not do any decoding / encoding.
If you want to decode you have to do it yourself.
{@linkplain URLCodec}
@param requestUri The whole encoded uri.
@return A map with all parameters of that uri. Encoded in => encoded out. | [
"This",
"method",
"does",
"not",
"do",
"any",
"decoding",
"/",
"encoding",
"."
] | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core/src/main/java/net/javapla/jawn/core/routes/InternalRoute.java#L58-L63 |
alibaba/Tangram-Android | tangram/src/main/java/com/tmall/wireless/tangram/TangramBuilder.java | TangramBuilder.newInnerBuilder | @NonNull
public static InnerBuilder newInnerBuilder(@NonNull final Context context) {
if (!TangramBuilder.isInitialized()) {
throw new IllegalStateException("Tangram must be init first");
}
DefaultResolverRegistry registry = new DefaultResolverRegistry();
// install default cards & mCells
installDefaultRegistry(registry);
return new InnerBuilder(context, registry);
} | java | @NonNull
public static InnerBuilder newInnerBuilder(@NonNull final Context context) {
if (!TangramBuilder.isInitialized()) {
throw new IllegalStateException("Tangram must be init first");
}
DefaultResolverRegistry registry = new DefaultResolverRegistry();
// install default cards & mCells
installDefaultRegistry(registry);
return new InnerBuilder(context, registry);
} | [
"@",
"NonNull",
"public",
"static",
"InnerBuilder",
"newInnerBuilder",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
")",
"{",
"if",
"(",
"!",
"TangramBuilder",
".",
"isInitialized",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Ta... | init a {@link TangramEngine} builder with build-in resource inited, such as registering build-in card and cell. Users use this builder to regiser custom card and cell, then call {@link InnerBuilder#build()} to create a {@link TangramEngine} instance.
@param context activity context
@return a {@link TangramEngine} builder | [
"init",
"a",
"{"
] | train | https://github.com/alibaba/Tangram-Android/blob/caa57f54e009c8dacd34a2322d5761956ebed321/tangram/src/main/java/com/tmall/wireless/tangram/TangramBuilder.java#L353-L365 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricFilterWithInteralReducerTransform.java | MetricFilterWithInteralReducerTransform.sortByValue | public static Map<Metric, String> sortByValue(Map<Metric, String> map, final String reducerType) {
List<Map.Entry<Metric, String>> list = new LinkedList<>(map.entrySet());
Collections.sort(list, new Comparator<Map.Entry<Metric, String>>() {
@Override
public int compare(Map.Entry<Metric, String> o1, Map.Entry<Metric, String> o2) {
if(reducerType.equals("name")) {
return o1.getValue().compareTo(o2.getValue());
}
Double d1 = Double.parseDouble(o1.getValue());
Double d2 = Double.parseDouble(o2.getValue());
return (d1.compareTo(d2));
}
});
Map<Metric, String> result = new LinkedHashMap<>();
for (Map.Entry<Metric, String> entry : list) {
result.put(entry.getKey(), entry.getValue());
}
return result;
} | java | public static Map<Metric, String> sortByValue(Map<Metric, String> map, final String reducerType) {
List<Map.Entry<Metric, String>> list = new LinkedList<>(map.entrySet());
Collections.sort(list, new Comparator<Map.Entry<Metric, String>>() {
@Override
public int compare(Map.Entry<Metric, String> o1, Map.Entry<Metric, String> o2) {
if(reducerType.equals("name")) {
return o1.getValue().compareTo(o2.getValue());
}
Double d1 = Double.parseDouble(o1.getValue());
Double d2 = Double.parseDouble(o2.getValue());
return (d1.compareTo(d2));
}
});
Map<Metric, String> result = new LinkedHashMap<>();
for (Map.Entry<Metric, String> entry : list) {
result.put(entry.getKey(), entry.getValue());
}
return result;
} | [
"public",
"static",
"Map",
"<",
"Metric",
",",
"String",
">",
"sortByValue",
"(",
"Map",
"<",
"Metric",
",",
"String",
">",
"map",
",",
"final",
"String",
"reducerType",
")",
"{",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Metric",
",",
"String",
">",
"... | Sorts a metric.
@param map The metrics to sort.
@param reducerType Sort key / reducer to use
@return The sorted metrics. | [
"Sorts",
"a",
"metric",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricFilterWithInteralReducerTransform.java#L144-L167 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/Project.java | Project.getTotalToDo | public Double getTotalToDo(WorkitemFilter filter, boolean includeChildProjects) {
filter = (filter != null) ? filter : new WorkitemFilter();
return getRollup("Workitems", "ToDo", filter, includeChildProjects);
} | java | public Double getTotalToDo(WorkitemFilter filter, boolean includeChildProjects) {
filter = (filter != null) ? filter : new WorkitemFilter();
return getRollup("Workitems", "ToDo", filter, includeChildProjects);
} | [
"public",
"Double",
"getTotalToDo",
"(",
"WorkitemFilter",
"filter",
",",
"boolean",
"includeChildProjects",
")",
"{",
"filter",
"=",
"(",
"filter",
"!=",
"null",
")",
"?",
"filter",
":",
"new",
"WorkitemFilter",
"(",
")",
";",
"return",
"getRollup",
"(",
"\... | Retrieves the total to do for all workitems in this project optionally
filtered.
@param filter Criteria to filter workitems on.
@param includeChildProjects If true, include open sub projects, otherwise
only include this project.
@return total to do of selected Workitems. | [
"Retrieves",
"the",
"total",
"to",
"do",
"for",
"all",
"workitems",
"in",
"this",
"project",
"optionally",
"filtered",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Project.java#L1129-L1133 |
michaelliao/jsonstream | src/main/java/com/itranswarp/jsonstream/JsonBuilder.java | JsonBuilder.createReader | public JsonReader createReader(InputStream input) {
try {
return createReader(new InputStreamReader(input, "UTF-8"));
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
} | java | public JsonReader createReader(InputStream input) {
try {
return createReader(new InputStreamReader(input, "UTF-8"));
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
} | [
"public",
"JsonReader",
"createReader",
"(",
"InputStream",
"input",
")",
"{",
"try",
"{",
"return",
"createReader",
"(",
"new",
"InputStreamReader",
"(",
"input",
",",
"\"UTF-8\"",
")",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"e",
")",
"{... | Create a JsonReader by providing an InputStream.
@param input The InputStream object.
@return JsonReader object. | [
"Create",
"a",
"JsonReader",
"by",
"providing",
"an",
"InputStream",
"."
] | train | https://github.com/michaelliao/jsonstream/blob/50adcff2e1293e655462eef5fc5f1b59277de514/src/main/java/com/itranswarp/jsonstream/JsonBuilder.java#L102-L109 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/table/ExampleDataUtil.java | ExampleDataUtil.createExampleData | public static List<PersonBean> createExampleData(final int rows, final int documents) {
List<PersonBean> data = new ArrayList<>(rows);
Date date1 = DateUtilities.createDate(1, 2, 1973);
Date date2 = DateUtilities.createDate(2, 3, 1985);
Date date3 = DateUtilities.createDate(3, 4, 2004);
for (int i = 1; i <= rows; i++) {
PersonBean bean = new PersonBean("P" + i, "Joe" + i, "Bloggs" + i, date1);
List<TravelDoc> docs = new ArrayList<>(documents);
for (int j = 1; j <= documents; j++) {
String prefix = i + "-" + j;
TravelDoc doc = new TravelDoc("DOC" + prefix, "Canada" + prefix, "Ottawa" + prefix,
date2, date3);
docs.add(doc);
}
bean.setDocuments(docs);
data.add(bean);
}
return data;
} | java | public static List<PersonBean> createExampleData(final int rows, final int documents) {
List<PersonBean> data = new ArrayList<>(rows);
Date date1 = DateUtilities.createDate(1, 2, 1973);
Date date2 = DateUtilities.createDate(2, 3, 1985);
Date date3 = DateUtilities.createDate(3, 4, 2004);
for (int i = 1; i <= rows; i++) {
PersonBean bean = new PersonBean("P" + i, "Joe" + i, "Bloggs" + i, date1);
List<TravelDoc> docs = new ArrayList<>(documents);
for (int j = 1; j <= documents; j++) {
String prefix = i + "-" + j;
TravelDoc doc = new TravelDoc("DOC" + prefix, "Canada" + prefix, "Ottawa" + prefix,
date2, date3);
docs.add(doc);
}
bean.setDocuments(docs);
data.add(bean);
}
return data;
} | [
"public",
"static",
"List",
"<",
"PersonBean",
">",
"createExampleData",
"(",
"final",
"int",
"rows",
",",
"final",
"int",
"documents",
")",
"{",
"List",
"<",
"PersonBean",
">",
"data",
"=",
"new",
"ArrayList",
"<>",
"(",
"rows",
")",
";",
"Date",
"date1... | Creates the example data.
@param rows the number of rows to create
@param documents the number of documents to add to each person
@return the example data. | [
"Creates",
"the",
"example",
"data",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/table/ExampleDataUtil.java#L121-L145 |
goshippo/shippo-java-client | src/main/java/com/shippo/model/Batch.java | Batch.removeShipments | public static Batch removeShipments(String id, String[] shipmentIds)
throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException {
Map<String, Object> params = new HashMap<String, Object>();
params.put("__list", shipmentIds);
return request(RequestMethod.POST, instanceURL(Batch.class, id) + "/remove_shipments", params, Batch.class,
null);
} | java | public static Batch removeShipments(String id, String[] shipmentIds)
throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException {
Map<String, Object> params = new HashMap<String, Object>();
params.put("__list", shipmentIds);
return request(RequestMethod.POST, instanceURL(Batch.class, id) + "/remove_shipments", params, Batch.class,
null);
} | [
"public",
"static",
"Batch",
"removeShipments",
"(",
"String",
"id",
",",
"String",
"[",
"]",
"shipmentIds",
")",
"throws",
"AuthenticationException",
",",
"InvalidRequestException",
",",
"APIConnectionException",
",",
"APIException",
"{",
"Map",
"<",
"String",
",",... | Remove shipments to an existing batch provided by id. This method
corresponds to https://api.goshippo.com/batches/<i>BATCH OBJECT ID</i>/remove_shipments
endpoint defined in https://goshippo.com/docs/reference#batches-remove-shipments
@param id
Batch object ID
@param shipmentIds
Array of shipment Ids to be removed from the batch
@return The Batch object after shipments have been removed | [
"Remove",
"shipments",
"to",
"an",
"existing",
"batch",
"provided",
"by",
"id",
".",
"This",
"method",
"corresponds",
"to",
"https",
":",
"//",
"api",
".",
"goshippo",
".",
"com",
"/",
"batches",
"/",
"<i",
">",
"BATCH",
"OBJECT",
"ID<",
"/",
"i",
">",... | train | https://github.com/goshippo/shippo-java-client/blob/eecf801c7e07a627c3677a331c0cfcf36cb1678b/src/main/java/com/shippo/model/Batch.java#L294-L300 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryImpl.java | QueryImpl.bindValue | public void bindValue(String varName, Value value) throws IllegalArgumentException, RepositoryException
{
checkInitialized();
query.bindValue(session.getLocationFactory().parseJCRName(varName).getInternalName(), value);
} | java | public void bindValue(String varName, Value value) throws IllegalArgumentException, RepositoryException
{
checkInitialized();
query.bindValue(session.getLocationFactory().parseJCRName(varName).getInternalName(), value);
} | [
"public",
"void",
"bindValue",
"(",
"String",
"varName",
",",
"Value",
"value",
")",
"throws",
"IllegalArgumentException",
",",
"RepositoryException",
"{",
"checkInitialized",
"(",
")",
";",
"query",
".",
"bindValue",
"(",
"session",
".",
"getLocationFactory",
"("... | Binds the given <code>value</code> to the variable named
<code>varName</code>.
@param varName name of variable in query
@param value value to bind
@throws IllegalArgumentException if <code>varName</code> is not a
valid variable in this query.
@throws javax.jcr.RepositoryException if an error occurs. | [
"Binds",
"the",
"given",
"<code",
">",
"value<",
"/",
"code",
">",
"to",
"the",
"variable",
"named",
"<code",
">",
"varName<",
"/",
"code",
">",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryImpl.java#L290-L294 |
forge/core | ui/api/src/main/java/org/jboss/forge/addon/ui/util/Categories.java | Categories.create | public static UICategory create(UICategory category, String... categories)
{
Assert.notNull(category, "Parent UICategory must not be null.");
Assert.notNull(categories, "Sub categories must not be null.");
List<String> args = new ArrayList<>();
args.add(category.getName());
args.addAll(Arrays.asList(categories));
return create(args.toArray(new String[args.size()]));
} | java | public static UICategory create(UICategory category, String... categories)
{
Assert.notNull(category, "Parent UICategory must not be null.");
Assert.notNull(categories, "Sub categories must not be null.");
List<String> args = new ArrayList<>();
args.add(category.getName());
args.addAll(Arrays.asList(categories));
return create(args.toArray(new String[args.size()]));
} | [
"public",
"static",
"UICategory",
"create",
"(",
"UICategory",
"category",
",",
"String",
"...",
"categories",
")",
"{",
"Assert",
".",
"notNull",
"(",
"category",
",",
"\"Parent UICategory must not be null.\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"categories... | Using the given {@link UICategory} as a parent, produce a hierarchical {@link UICategory} instance from the given
sub-category names. | [
"Using",
"the",
"given",
"{"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/ui/api/src/main/java/org/jboss/forge/addon/ui/util/Categories.java#L38-L46 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/ifx/GeomFactory2ifx.java | GeomFactory2ifx.newPoint | @SuppressWarnings("static-method")
public Point2ifx newPoint(IntegerProperty x, IntegerProperty y) {
return new Point2ifx(x, y);
} | java | @SuppressWarnings("static-method")
public Point2ifx newPoint(IntegerProperty x, IntegerProperty y) {
return new Point2ifx(x, y);
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"public",
"Point2ifx",
"newPoint",
"(",
"IntegerProperty",
"x",
",",
"IntegerProperty",
"y",
")",
"{",
"return",
"new",
"Point2ifx",
"(",
"x",
",",
"y",
")",
";",
"}"
] | Create a point with properties.
@param x the x property.
@param y the y property.
@return the vector. | [
"Create",
"a",
"point",
"with",
"properties",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/ifx/GeomFactory2ifx.java#L106-L109 |
PrashamTrivedi/SharedPreferenceInspector | sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/Utils/SharedPreferenceUtils.java | SharedPreferenceUtils.isDebugHandled | public boolean isDebugHandled(Context context, MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_debug) {
startActivity(context);
return true;
}
return false;
} | java | public boolean isDebugHandled(Context context, MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_debug) {
startActivity(context);
return true;
}
return false;
} | [
"public",
"boolean",
"isDebugHandled",
"(",
"Context",
"context",
",",
"MenuItem",
"item",
")",
"{",
"int",
"id",
"=",
"item",
".",
"getItemId",
"(",
")",
";",
"if",
"(",
"id",
"==",
"R",
".",
"id",
".",
"action_debug",
")",
"{",
"startActivity",
"(",
... | Checks if debug menu item clicked or not.
@param context
: context to start activity if debug item handled.
@param item
: Menu item whose click is to be checked.
@return : <code>true</code> if debug menu item is clicked, it will automatically Start the SharedPrefsBrowser activity. If debug menu item is
not clicked, you can handle rest menu items in onOptionsItemSelcted code. | [
"Checks",
"if",
"debug",
"menu",
"item",
"clicked",
"or",
"not",
"."
] | train | https://github.com/PrashamTrivedi/SharedPreferenceInspector/blob/c04d567c4d0fc5e0f8cda308ca85df19c6b3b838/sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/Utils/SharedPreferenceUtils.java#L182-L189 |
JodaOrg/joda-time | src/main/java/org/joda/time/Seconds.java | Seconds.secondsBetween | public static Seconds secondsBetween(ReadableInstant start, ReadableInstant end) {
int amount = BaseSingleFieldPeriod.between(start, end, DurationFieldType.seconds());
return Seconds.seconds(amount);
} | java | public static Seconds secondsBetween(ReadableInstant start, ReadableInstant end) {
int amount = BaseSingleFieldPeriod.between(start, end, DurationFieldType.seconds());
return Seconds.seconds(amount);
} | [
"public",
"static",
"Seconds",
"secondsBetween",
"(",
"ReadableInstant",
"start",
",",
"ReadableInstant",
"end",
")",
"{",
"int",
"amount",
"=",
"BaseSingleFieldPeriod",
".",
"between",
"(",
"start",
",",
"end",
",",
"DurationFieldType",
".",
"seconds",
"(",
")"... | Creates a <code>Seconds</code> representing the number of whole seconds
between the two specified datetimes.
@param start the start instant, must not be null
@param end the end instant, must not be null
@return the period in seconds
@throws IllegalArgumentException if the instants are null or invalid | [
"Creates",
"a",
"<code",
">",
"Seconds<",
"/",
"code",
">",
"representing",
"the",
"number",
"of",
"whole",
"seconds",
"between",
"the",
"two",
"specified",
"datetimes",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Seconds.java#L100-L103 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/rebind/CmsCommandInitGenerator.java | CmsCommandInitGenerator.generateClass | public void generateClass(TreeLogger logger, GeneratorContext context, List<JClassType> subclasses) {
PrintWriter printWriter = context.tryCreate(logger, PACKAGE_NAME, CLASS_NAME);
if (printWriter == null) {
return;
}
ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(PACKAGE_NAME, CLASS_NAME);
composer.addImplementedInterface(INIT_INTERFACE_NAME);
SourceWriter sourceWriter = composer.createSourceWriter(context, printWriter);
sourceWriter.println("public java.util.Map<String, " + COMMAND_INTERFACE + "> initCommands() {");
sourceWriter.indent();
sourceWriter.println(
"java.util.Map<String, "
+ COMMAND_INTERFACE
+ "> result=new java.util.HashMap<String, "
+ COMMAND_INTERFACE
+ ">();");
for (JClassType type : subclasses) {
sourceWriter.println(
"result.put(\""
+ type.getQualifiedSourceName()
+ "\","
+ type.getQualifiedSourceName()
+ "."
+ GET_COMMAND_METHOD
+ "());");
}
sourceWriter.println("return result;");
sourceWriter.outdent();
sourceWriter.println("}");
sourceWriter.outdent();
sourceWriter.println("}");
context.commit(logger, printWriter);
} | java | public void generateClass(TreeLogger logger, GeneratorContext context, List<JClassType> subclasses) {
PrintWriter printWriter = context.tryCreate(logger, PACKAGE_NAME, CLASS_NAME);
if (printWriter == null) {
return;
}
ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(PACKAGE_NAME, CLASS_NAME);
composer.addImplementedInterface(INIT_INTERFACE_NAME);
SourceWriter sourceWriter = composer.createSourceWriter(context, printWriter);
sourceWriter.println("public java.util.Map<String, " + COMMAND_INTERFACE + "> initCommands() {");
sourceWriter.indent();
sourceWriter.println(
"java.util.Map<String, "
+ COMMAND_INTERFACE
+ "> result=new java.util.HashMap<String, "
+ COMMAND_INTERFACE
+ ">();");
for (JClassType type : subclasses) {
sourceWriter.println(
"result.put(\""
+ type.getQualifiedSourceName()
+ "\","
+ type.getQualifiedSourceName()
+ "."
+ GET_COMMAND_METHOD
+ "());");
}
sourceWriter.println("return result;");
sourceWriter.outdent();
sourceWriter.println("}");
sourceWriter.outdent();
sourceWriter.println("}");
context.commit(logger, printWriter);
} | [
"public",
"void",
"generateClass",
"(",
"TreeLogger",
"logger",
",",
"GeneratorContext",
"context",
",",
"List",
"<",
"JClassType",
">",
"subclasses",
")",
"{",
"PrintWriter",
"printWriter",
"=",
"context",
".",
"tryCreate",
"(",
"logger",
",",
"PACKAGE_NAME",
"... | This method generates the source code for the class initializer class.<p>
@param logger the logger to be used
@param context the generator context
@param subclasses the classes for which the generated code should the initClass() method | [
"This",
"method",
"generates",
"the",
"source",
"code",
"for",
"the",
"class",
"initializer",
"class",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/rebind/CmsCommandInitGenerator.java#L106-L139 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/example/cookbook/datamovement/JobInformationRecorder.java | JobInformationRecorder.withProperty | public JobInformationRecorder withProperty(String key, String value) {
if(sourceBatcher.isStarted()) throw new IllegalStateException("Configuration cannot be changed after startJob has been called");
properties.put(key, value);
return this;
} | java | public JobInformationRecorder withProperty(String key, String value) {
if(sourceBatcher.isStarted()) throw new IllegalStateException("Configuration cannot be changed after startJob has been called");
properties.put(key, value);
return this;
} | [
"public",
"JobInformationRecorder",
"withProperty",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"sourceBatcher",
".",
"isStarted",
"(",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Configuration cannot be changed after startJob has b... | Sets the key value pair to the job information. This would be persisted along with the other job
information like start time, end time etc
@param key key of the key value pair
@param value value of the key value pair
@return this object for chaining | [
"Sets",
"the",
"key",
"value",
"pair",
"to",
"the",
"job",
"information",
".",
"This",
"would",
"be",
"persisted",
"along",
"with",
"the",
"other",
"job",
"information",
"like",
"start",
"time",
"end",
"time",
"etc"
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/example/cookbook/datamovement/JobInformationRecorder.java#L201-L205 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java | SARLImages.forAgent | public ImageDescriptor forAgent(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.AGENT, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | java | public ImageDescriptor forAgent(JvmVisibility visibility, int flags) {
return getDecorated(getTypeImageDescriptor(
SarlElementType.AGENT, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags);
} | [
"public",
"ImageDescriptor",
"forAgent",
"(",
"JvmVisibility",
"visibility",
",",
"int",
"flags",
")",
"{",
"return",
"getDecorated",
"(",
"getTypeImageDescriptor",
"(",
"SarlElementType",
".",
"AGENT",
",",
"false",
",",
"false",
",",
"toFlags",
"(",
"visibility"... | Replies the image descriptor for the "agents".
@param visibility the visibility of the agent.
@param flags the mark flags. See {@link JavaElementImageDescriptor#setAdornments(int)} for
a description of the available flags.
@return the image descriptor for the agents. | [
"Replies",
"the",
"image",
"descriptor",
"for",
"the",
"agents",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java#L127-L130 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/data/LibDaiFgIo.java | LibDaiFgIo.configIdToLibDaiIx | public static int configIdToLibDaiIx(int configId, VarSet vs) {
int[] indices = vs.getVarConfigAsArray(configId);
int[] dims = vs.getDims();
return Tensor.ravelIndexMatlab(indices, dims);
} | java | public static int configIdToLibDaiIx(int configId, VarSet vs) {
int[] indices = vs.getVarConfigAsArray(configId);
int[] dims = vs.getDims();
return Tensor.ravelIndexMatlab(indices, dims);
} | [
"public",
"static",
"int",
"configIdToLibDaiIx",
"(",
"int",
"configId",
",",
"VarSet",
"vs",
")",
"{",
"int",
"[",
"]",
"indices",
"=",
"vs",
".",
"getVarConfigAsArray",
"(",
"configId",
")",
";",
"int",
"[",
"]",
"dims",
"=",
"vs",
".",
"getDims",
"(... | converts the internal pacaya index of a config on the varset into the
libdai index corresponding to the same configuration | [
"converts",
"the",
"internal",
"pacaya",
"index",
"of",
"a",
"config",
"on",
"the",
"varset",
"into",
"the",
"libdai",
"index",
"corresponding",
"to",
"the",
"same",
"configuration"
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/data/LibDaiFgIo.java#L158-L162 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/reasoning/bayes/smile/ShanksAgentBayesianReasoningCapability.java | ShanksAgentBayesianReasoningCapability.clearEvidence | public static void clearEvidence(Network bn, int node) {
if (bn.isEvidence(node)) {
bn.clearEvidence(node);
bn.updateBeliefs();
}
} | java | public static void clearEvidence(Network bn, int node) {
if (bn.isEvidence(node)) {
bn.clearEvidence(node);
bn.updateBeliefs();
}
} | [
"public",
"static",
"void",
"clearEvidence",
"(",
"Network",
"bn",
",",
"int",
"node",
")",
"{",
"if",
"(",
"bn",
".",
"isEvidence",
"(",
"node",
")",
")",
"{",
"bn",
".",
"clearEvidence",
"(",
"node",
")",
";",
"bn",
".",
"updateBeliefs",
"(",
")",
... | Clear a hard evidence fixed in a given node
@param bn
@param node | [
"Clear",
"a",
"hard",
"evidence",
"fixed",
"in",
"a",
"given",
"node"
] | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/reasoning/bayes/smile/ShanksAgentBayesianReasoningCapability.java#L330-L335 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.warnv | public void warnv(String format, Object... params) {
doLog(Level.WARN, FQCN, format, params, null);
} | java | public void warnv(String format, Object... params) {
doLog(Level.WARN, FQCN, format, params, null);
} | [
"public",
"void",
"warnv",
"(",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLog",
"(",
"Level",
".",
"WARN",
",",
"FQCN",
",",
"format",
",",
"params",
",",
"null",
")",
";",
"}"
] | Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting.
@param format the message format string
@param params the parameters | [
"Issue",
"a",
"log",
"message",
"with",
"a",
"level",
"of",
"WARN",
"using",
"{",
"@link",
"java",
".",
"text",
".",
"MessageFormat",
"}",
"-",
"style",
"formatting",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L1293-L1295 |
google/closure-compiler | src/com/google/javascript/jscomp/ProcessClosureProvidesAndRequires.java | ProcessClosureProvidesAndRequires.registerAnyProvidedPrefixes | private void registerAnyProvidedPrefixes(String ns, Node node, JSModule module) {
int pos = ns.indexOf('.');
while (pos != -1) {
String prefixNs = ns.substring(0, pos);
pos = ns.indexOf('.', pos + 1);
if (providedNames.containsKey(prefixNs)) {
providedNames.get(prefixNs).addProvide(node, module, /* explicit= */ false);
} else {
providedNames.put(
prefixNs,
new ProvidedName(
prefixNs, node, module, /* explicit= */ false, /* fromPreviousProvide= */ false));
}
}
} | java | private void registerAnyProvidedPrefixes(String ns, Node node, JSModule module) {
int pos = ns.indexOf('.');
while (pos != -1) {
String prefixNs = ns.substring(0, pos);
pos = ns.indexOf('.', pos + 1);
if (providedNames.containsKey(prefixNs)) {
providedNames.get(prefixNs).addProvide(node, module, /* explicit= */ false);
} else {
providedNames.put(
prefixNs,
new ProvidedName(
prefixNs, node, module, /* explicit= */ false, /* fromPreviousProvide= */ false));
}
}
} | [
"private",
"void",
"registerAnyProvidedPrefixes",
"(",
"String",
"ns",
",",
"Node",
"node",
",",
"JSModule",
"module",
")",
"{",
"int",
"pos",
"=",
"ns",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"while",
"(",
"pos",
"!=",
"-",
"1",
")",
"{",
"String"... | Registers ProvidedNames for prefix namespaces if they haven't already been defined. The prefix
namespaces must be registered in order from shortest to longest.
@param ns The namespace whose prefixes may need to be provided.
@param node The EXPR of the provide call.
@param module The current module. | [
"Registers",
"ProvidedNames",
"for",
"prefix",
"namespaces",
"if",
"they",
"haven",
"t",
"already",
"been",
"defined",
".",
"The",
"prefix",
"namespaces",
"must",
"be",
"registered",
"in",
"order",
"from",
"shortest",
"to",
"longest",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ProcessClosureProvidesAndRequires.java#L587-L601 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/util/ARCCreator.java | ARCCreator.directoryToArc | public void directoryToArc(File srcDir, File tgtDir, String prefix)
throws IOException {
File target[] = {tgtDir};
ARCWriter writer = new ARCWriter(new AtomicInteger(),
getSettings(true,prefix,Arrays.asList(target)));
File sources[] = srcDir.listFiles();
LOGGER.info("Found " + sources.length + " files in " + srcDir);
for(int i = 0; i<sources.length; i++) {
addFile(sources[i]);
}
LOGGER.info("Associated " + sources.length + " files in " + srcDir);
// sort keys and write them all:
Object arr[] = components.keySet().toArray();
Arrays.sort(arr);
for(int i = 0; i < arr.length; i++) {
String key = (String) arr[i];
RecordComponents rc = components.get(key);
rc.writeRecord(writer,srcDir);
LOGGER.info("Wrote record keyed " + rc.key);
}
writer.close();
LOGGER.info("Closed arc file named " +
writer.getFile().getAbsolutePath());
} | java | public void directoryToArc(File srcDir, File tgtDir, String prefix)
throws IOException {
File target[] = {tgtDir};
ARCWriter writer = new ARCWriter(new AtomicInteger(),
getSettings(true,prefix,Arrays.asList(target)));
File sources[] = srcDir.listFiles();
LOGGER.info("Found " + sources.length + " files in " + srcDir);
for(int i = 0; i<sources.length; i++) {
addFile(sources[i]);
}
LOGGER.info("Associated " + sources.length + " files in " + srcDir);
// sort keys and write them all:
Object arr[] = components.keySet().toArray();
Arrays.sort(arr);
for(int i = 0; i < arr.length; i++) {
String key = (String) arr[i];
RecordComponents rc = components.get(key);
rc.writeRecord(writer,srcDir);
LOGGER.info("Wrote record keyed " + rc.key);
}
writer.close();
LOGGER.info("Closed arc file named " +
writer.getFile().getAbsolutePath());
} | [
"public",
"void",
"directoryToArc",
"(",
"File",
"srcDir",
",",
"File",
"tgtDir",
",",
"String",
"prefix",
")",
"throws",
"IOException",
"{",
"File",
"target",
"[",
"]",
"=",
"{",
"tgtDir",
"}",
";",
"ARCWriter",
"writer",
"=",
"new",
"ARCWriter",
"(",
"... | Reads all component files (.meta, .body, .sh) in srcDir, and writes
one or more ARC files in tgtDir with names beginning with prefix.
@param srcDir
@param tgtDir
@param prefix
@throws IOException | [
"Reads",
"all",
"component",
"files",
"(",
".",
"meta",
".",
"body",
".",
"sh",
")",
"in",
"srcDir",
"and",
"writes",
"one",
"or",
"more",
"ARC",
"files",
"in",
"tgtDir",
"with",
"names",
"beginning",
"with",
"prefix",
"."
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/util/ARCCreator.java#L99-L125 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java | FeatureOverlayQuery.queryFeatures | public FeatureIndexResults queryFeatures(BoundingBox boundingBox, Projection projection) {
if (projection == null) {
projection = ProjectionFactory.getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
}
// Query for features
FeatureIndexManager indexManager = featureTiles.getIndexManager();
if (indexManager == null) {
throw new GeoPackageException("Index Manager is not set on the Feature Tiles and is required to query indexed features");
}
FeatureIndexResults results = indexManager.query(boundingBox, projection);
return results;
} | java | public FeatureIndexResults queryFeatures(BoundingBox boundingBox, Projection projection) {
if (projection == null) {
projection = ProjectionFactory.getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
}
// Query for features
FeatureIndexManager indexManager = featureTiles.getIndexManager();
if (indexManager == null) {
throw new GeoPackageException("Index Manager is not set on the Feature Tiles and is required to query indexed features");
}
FeatureIndexResults results = indexManager.query(boundingBox, projection);
return results;
} | [
"public",
"FeatureIndexResults",
"queryFeatures",
"(",
"BoundingBox",
"boundingBox",
",",
"Projection",
"projection",
")",
"{",
"if",
"(",
"projection",
"==",
"null",
")",
"{",
"projection",
"=",
"ProjectionFactory",
".",
"getProjection",
"(",
"ProjectionConstants",
... | Query for features in the bounding box
@param boundingBox query bounding box
@param projection bounding box projection
@return feature index results, must be closed | [
"Query",
"for",
"features",
"in",
"the",
"bounding",
"box"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java#L299-L312 |
MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java | ReflectionUtils.convertToArray | public static Object convertToArray(final Class type, final List<?> values) {
final Object exampleArray = Array.newInstance(type, values.size());
try {
return values.toArray((Object[]) exampleArray);
} catch (ClassCastException e) {
for (int i = 0; i < values.size(); i++) {
Array.set(exampleArray, i, values.get(i));
}
return exampleArray;
}
} | java | public static Object convertToArray(final Class type, final List<?> values) {
final Object exampleArray = Array.newInstance(type, values.size());
try {
return values.toArray((Object[]) exampleArray);
} catch (ClassCastException e) {
for (int i = 0; i < values.size(); i++) {
Array.set(exampleArray, i, values.get(i));
}
return exampleArray;
}
} | [
"public",
"static",
"Object",
"convertToArray",
"(",
"final",
"Class",
"type",
",",
"final",
"List",
"<",
"?",
">",
"values",
")",
"{",
"final",
"Object",
"exampleArray",
"=",
"Array",
".",
"newInstance",
"(",
"type",
",",
"values",
".",
"size",
"(",
")"... | Converts a List to an array
@param type the Class type of the elements of the List
@param values the List to convert
@return the array | [
"Converts",
"a",
"List",
"to",
"an",
"array"
] | train | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/utils/ReflectionUtils.java#L699-L709 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java | FastAdapter.getPreItemCountByOrder | public int getPreItemCountByOrder(int order) {
//if we are empty just return 0 count
if (mGlobalSize == 0) {
return 0;
}
int size = 0;
//count the number of items before the adapter with the given order
for (int i = 0; i < Math.min(order, mAdapters.size()); i++) {
size = size + mAdapters.get(i).getAdapterItemCount();
}
//get the count of items which are before this order
return size;
} | java | public int getPreItemCountByOrder(int order) {
//if we are empty just return 0 count
if (mGlobalSize == 0) {
return 0;
}
int size = 0;
//count the number of items before the adapter with the given order
for (int i = 0; i < Math.min(order, mAdapters.size()); i++) {
size = size + mAdapters.get(i).getAdapterItemCount();
}
//get the count of items which are before this order
return size;
} | [
"public",
"int",
"getPreItemCountByOrder",
"(",
"int",
"order",
")",
"{",
"//if we are empty just return 0 count",
"if",
"(",
"mGlobalSize",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"int",
"size",
"=",
"0",
";",
"//count the number of items before the adapter w... | calculates the item count up to a given (excluding this) order number
@param order the number up to which the items are counted
@return the total count of items up to the adapter order | [
"calculates",
"the",
"item",
"count",
"up",
"to",
"a",
"given",
"(",
"excluding",
"this",
")",
"order",
"number"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L961-L976 |
JodaOrg/joda-time | src/main/java/org/joda/time/base/BaseInterval.java | BaseInterval.setInterval | protected void setInterval(long startInstant, long endInstant, Chronology chrono) {
checkInterval(startInstant, endInstant);
iStartMillis = startInstant;
iEndMillis = endInstant;
iChronology = DateTimeUtils.getChronology(chrono);
} | java | protected void setInterval(long startInstant, long endInstant, Chronology chrono) {
checkInterval(startInstant, endInstant);
iStartMillis = startInstant;
iEndMillis = endInstant;
iChronology = DateTimeUtils.getChronology(chrono);
} | [
"protected",
"void",
"setInterval",
"(",
"long",
"startInstant",
",",
"long",
"endInstant",
",",
"Chronology",
"chrono",
")",
"{",
"checkInterval",
"(",
"startInstant",
",",
"endInstant",
")",
";",
"iStartMillis",
"=",
"startInstant",
";",
"iEndMillis",
"=",
"en... | Sets this interval from two millisecond instants and a chronology.
@param startInstant the start of the time interval
@param endInstant the start of the time interval
@param chrono the chronology, not null
@throws IllegalArgumentException if the end is before the start | [
"Sets",
"this",
"interval",
"from",
"two",
"millisecond",
"instants",
"and",
"a",
"chronology",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BaseInterval.java#L247-L252 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/handler/file/FileHandlerUtil.java | FileHandlerUtil.generateOutputFilePath | public static String generateOutputFilePath(String path, String fileName) {
String tempPath = separatorsToSystem(path);
tempPath = tempPath + File.separatorChar + fileName;
return tempPath;
} | java | public static String generateOutputFilePath(String path, String fileName) {
String tempPath = separatorsToSystem(path);
tempPath = tempPath + File.separatorChar + fileName;
return tempPath;
} | [
"public",
"static",
"String",
"generateOutputFilePath",
"(",
"String",
"path",
",",
"String",
"fileName",
")",
"{",
"String",
"tempPath",
"=",
"separatorsToSystem",
"(",
"path",
")",
";",
"tempPath",
"=",
"tempPath",
"+",
"File",
".",
"separatorChar",
"+",
"fi... | Generate output file path.
@param path the path
@param fileName the file name
@return the string | [
"Generate",
"output",
"file",
"path",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/handler/file/FileHandlerUtil.java#L62-L66 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/CmsEditorBase.java | CmsEditorBase.renderInlineEntity | public void renderInlineEntity(String entityId, I_CmsInlineFormParent formParent) {
m_entity = m_entityBackend.getEntity(entityId);
if (m_entity != null) {
if (m_rootHandler == null) {
m_rootHandler = new CmsRootHandler();
} else {
m_rootHandler.clearHandlers();
}
m_validationHandler.setContentService(m_service);
m_validationHandler.registerEntity(m_entity);
m_validationHandler.setRootHandler(m_rootHandler);
CmsType type = m_entityBackend.getType(m_entity.getTypeName());
CmsButtonBarHandler.INSTANCE.setWidgetService(m_widgetService);
m_widgetService.getRendererForType(type).renderInline(m_entity, formParent, this, m_rootHandler, 0);
CmsUndoRedoHandler.getInstance().initialize(m_entity, this, m_rootHandler);
}
} | java | public void renderInlineEntity(String entityId, I_CmsInlineFormParent formParent) {
m_entity = m_entityBackend.getEntity(entityId);
if (m_entity != null) {
if (m_rootHandler == null) {
m_rootHandler = new CmsRootHandler();
} else {
m_rootHandler.clearHandlers();
}
m_validationHandler.setContentService(m_service);
m_validationHandler.registerEntity(m_entity);
m_validationHandler.setRootHandler(m_rootHandler);
CmsType type = m_entityBackend.getType(m_entity.getTypeName());
CmsButtonBarHandler.INSTANCE.setWidgetService(m_widgetService);
m_widgetService.getRendererForType(type).renderInline(m_entity, formParent, this, m_rootHandler, 0);
CmsUndoRedoHandler.getInstance().initialize(m_entity, this, m_rootHandler);
}
} | [
"public",
"void",
"renderInlineEntity",
"(",
"String",
"entityId",
",",
"I_CmsInlineFormParent",
"formParent",
")",
"{",
"m_entity",
"=",
"m_entityBackend",
".",
"getEntity",
"(",
"entityId",
")",
";",
"if",
"(",
"m_entity",
"!=",
"null",
")",
"{",
"if",
"(",
... | Renders the entity form within the given context.<p>
@param entityId the entity id
@param formParent the form parent widget | [
"Renders",
"the",
"entity",
"form",
"within",
"the",
"given",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsEditorBase.java#L456-L473 |
apache/incubator-heron | heron/packing/src/java/org/apache/heron/packing/utils/PackingUtils.java | PackingUtils.finalizePadding | public static Resource finalizePadding(
Resource containerResource, Resource padding, int paddingPercentage) {
double cpuPadding = Math.max(padding.getCpu(),
containerResource.getCpu() * paddingPercentage / 100);
ByteAmount ramPadding = ByteAmount.fromBytes(Math.max(padding.getRam().asBytes(),
containerResource.getRam().asBytes() * paddingPercentage / 100));
ByteAmount diskPadding = ByteAmount.fromBytes(Math.max(padding.getDisk().asBytes(),
containerResource.getDisk().asBytes() * paddingPercentage / 100));
return new Resource(cpuPadding, ramPadding, diskPadding);
} | java | public static Resource finalizePadding(
Resource containerResource, Resource padding, int paddingPercentage) {
double cpuPadding = Math.max(padding.getCpu(),
containerResource.getCpu() * paddingPercentage / 100);
ByteAmount ramPadding = ByteAmount.fromBytes(Math.max(padding.getRam().asBytes(),
containerResource.getRam().asBytes() * paddingPercentage / 100));
ByteAmount diskPadding = ByteAmount.fromBytes(Math.max(padding.getDisk().asBytes(),
containerResource.getDisk().asBytes() * paddingPercentage / 100));
return new Resource(cpuPadding, ramPadding, diskPadding);
} | [
"public",
"static",
"Resource",
"finalizePadding",
"(",
"Resource",
"containerResource",
",",
"Resource",
"padding",
",",
"int",
"paddingPercentage",
")",
"{",
"double",
"cpuPadding",
"=",
"Math",
".",
"max",
"(",
"padding",
".",
"getCpu",
"(",
")",
",",
"cont... | Finalize padding by taking Math.max(containerResource * paddingPercent, paddingValue)
@param containerResource max container resource
@param padding padding value
@param paddingPercentage padding percent
@return finalized padding amount | [
"Finalize",
"padding",
"by",
"taking",
"Math",
".",
"max",
"(",
"containerResource",
"*",
"paddingPercent",
"paddingValue",
")"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/packing/src/java/org/apache/heron/packing/utils/PackingUtils.java#L94-L104 |
molgenis/molgenis | molgenis-i18n/src/main/java/org/molgenis/i18n/LocalizationMessageSource.java | LocalizationMessageSource.resolveCode | @Override
public MessageFormat resolveCode(String code, Locale locale) {
String resolved = resolveCodeWithoutArguments(code, locale);
if (resolved == null) {
return null;
}
return createMessageFormat(resolved, locale);
} | java | @Override
public MessageFormat resolveCode(String code, Locale locale) {
String resolved = resolveCodeWithoutArguments(code, locale);
if (resolved == null) {
return null;
}
return createMessageFormat(resolved, locale);
} | [
"@",
"Override",
"public",
"MessageFormat",
"resolveCode",
"(",
"String",
"code",
",",
"Locale",
"locale",
")",
"{",
"String",
"resolved",
"=",
"resolveCodeWithoutArguments",
"(",
"code",
",",
"locale",
")",
";",
"if",
"(",
"resolved",
"==",
"null",
")",
"{"... | Looks up the {@link MessageFormat} for a code.
@param code the code to look up
@param locale the {@link Locale} for which the code should be looked up
@return newly created {@link MessageFormat} | [
"Looks",
"up",
"the",
"{",
"@link",
"MessageFormat",
"}",
"for",
"a",
"code",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-i18n/src/main/java/org/molgenis/i18n/LocalizationMessageSource.java#L61-L68 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseByteObj | @Nullable
public static Byte parseByteObj (@Nullable final String sStr)
{
return parseByteObj (sStr, DEFAULT_RADIX, null);
} | java | @Nullable
public static Byte parseByteObj (@Nullable final String sStr)
{
return parseByteObj (sStr, DEFAULT_RADIX, null);
} | [
"@",
"Nullable",
"public",
"static",
"Byte",
"parseByteObj",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
")",
"{",
"return",
"parseByteObj",
"(",
"sStr",
",",
"DEFAULT_RADIX",
",",
"null",
")",
";",
"}"
] | Parse the given {@link String} as {@link Byte} with radix
{@value #DEFAULT_RADIX}.
@param sStr
The String to parse. May be <code>null</code>.
@return <code>null</code> if the string does not represent a valid value. | [
"Parse",
"the",
"given",
"{",
"@link",
"String",
"}",
"as",
"{",
"@link",
"Byte",
"}",
"with",
"radix",
"{",
"@value",
"#DEFAULT_RADIX",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L396-L400 |
Stratio/stratio-connector-commons | connector-commons/src/main/java/com/stratio/connector/commons/engine/CommonsMetadataEngine.java | CommonsMetadataEngine.dropTable | @Override
public final void dropTable(ClusterName targetCluster, TableName name) throws UnsupportedException,
ExecutionException {
try {
connectionHandler.startJob(targetCluster.getName());
if (logger.isDebugEnabled()) {
logger.debug("Dropping table [" + name.getName() + "] in cluster [" + targetCluster.getName() + "]");
}
dropTable(name, connectionHandler.getConnection(targetCluster.getName()));
if (logger.isDebugEnabled()) {
logger.debug("Table [" + name.getName() + "] has been drepped successfully in cluster [" + targetCluster
.getName() + "]");
}
} finally {
connectionHandler.endJob(targetCluster.getName());
}
} | java | @Override
public final void dropTable(ClusterName targetCluster, TableName name) throws UnsupportedException,
ExecutionException {
try {
connectionHandler.startJob(targetCluster.getName());
if (logger.isDebugEnabled()) {
logger.debug("Dropping table [" + name.getName() + "] in cluster [" + targetCluster.getName() + "]");
}
dropTable(name, connectionHandler.getConnection(targetCluster.getName()));
if (logger.isDebugEnabled()) {
logger.debug("Table [" + name.getName() + "] has been drepped successfully in cluster [" + targetCluster
.getName() + "]");
}
} finally {
connectionHandler.endJob(targetCluster.getName());
}
} | [
"@",
"Override",
"public",
"final",
"void",
"dropTable",
"(",
"ClusterName",
"targetCluster",
",",
"TableName",
"name",
")",
"throws",
"UnsupportedException",
",",
"ExecutionException",
"{",
"try",
"{",
"connectionHandler",
".",
"startJob",
"(",
"targetCluster",
"."... | This method drop a table.
@param targetCluster the target cluster where the table will be dropped.
@param name the table name.
@throws UnsupportedException if an operation is not supported.
@throws ExecutionException if an error happens. | [
"This",
"method",
"drop",
"a",
"table",
"."
] | train | https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/engine/CommonsMetadataEngine.java#L174-L196 |
stapler/stapler | core/src/main/java/org/kohsuke/stapler/framework/io/LargeText.java | LargeText.writeLogTo | public long writeLogTo(long start, OutputStream out) throws IOException {
CountingOutputStream os = new CountingOutputStream(out);
Session f = source.open();
f.skip(start);
if(completed) {
// write everything till EOF
byte[] buf = new byte[1024];
int sz;
while((sz=f.read(buf))>=0)
os.write(buf,0,sz);
} else {
ByteBuf buf = new ByteBuf(null,f);
HeadMark head = new HeadMark(buf);
TailMark tail = new TailMark(buf);
buf = null;
int readLines = 0;
while(tail.moveToNextLine(f) && readLines++ < MAX_LINES_READ) {
head.moveTo(tail,os);
}
head.finish(os);
}
f.close();
os.flush();
return os.getByteCount()+start;
} | java | public long writeLogTo(long start, OutputStream out) throws IOException {
CountingOutputStream os = new CountingOutputStream(out);
Session f = source.open();
f.skip(start);
if(completed) {
// write everything till EOF
byte[] buf = new byte[1024];
int sz;
while((sz=f.read(buf))>=0)
os.write(buf,0,sz);
} else {
ByteBuf buf = new ByteBuf(null,f);
HeadMark head = new HeadMark(buf);
TailMark tail = new TailMark(buf);
buf = null;
int readLines = 0;
while(tail.moveToNextLine(f) && readLines++ < MAX_LINES_READ) {
head.moveTo(tail,os);
}
head.finish(os);
}
f.close();
os.flush();
return os.getByteCount()+start;
} | [
"public",
"long",
"writeLogTo",
"(",
"long",
"start",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"CountingOutputStream",
"os",
"=",
"new",
"CountingOutputStream",
"(",
"out",
")",
";",
"Session",
"f",
"=",
"source",
".",
"open",
"(",
")",... | Writes the tail portion of the file to the {@link OutputStream}.
@param start
The byte offset in the input file where the write operation starts.
@return
if the file is still being written, this method writes the file
until the last newline character and returns the offset to start
the next write operation.
@throws EOFException if the start position is larger than the file size | [
"Writes",
"the",
"tail",
"portion",
"of",
"the",
"file",
"to",
"the",
"{",
"@link",
"OutputStream",
"}",
"."
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/core/src/main/java/org/kohsuke/stapler/framework/io/LargeText.java#L209-L238 |
magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java | SessionIdFormat.createSessionId | @Nonnull
public String createSessionId(@Nonnull final String sessionId, @Nullable final String memcachedId) {
if ( LOG.isDebugEnabled() ) {
LOG.debug( "Creating new session id with orig id '" + sessionId + "' and memcached id '" + memcachedId + "'." );
}
if ( memcachedId == null ) {
return sessionId;
}
final int idx = sessionId.indexOf( '.' );
if ( idx < 0 ) {
return sessionId + "-" + memcachedId;
} else {
return sessionId.substring( 0, idx ) + "-" + memcachedId + sessionId.substring( idx );
}
} | java | @Nonnull
public String createSessionId(@Nonnull final String sessionId, @Nullable final String memcachedId) {
if ( LOG.isDebugEnabled() ) {
LOG.debug( "Creating new session id with orig id '" + sessionId + "' and memcached id '" + memcachedId + "'." );
}
if ( memcachedId == null ) {
return sessionId;
}
final int idx = sessionId.indexOf( '.' );
if ( idx < 0 ) {
return sessionId + "-" + memcachedId;
} else {
return sessionId.substring( 0, idx ) + "-" + memcachedId + sessionId.substring( idx );
}
} | [
"@",
"Nonnull",
"public",
"String",
"createSessionId",
"(",
"@",
"Nonnull",
"final",
"String",
"sessionId",
",",
"@",
"Nullable",
"final",
"String",
"memcachedId",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
... | Create a session id including the provided memcachedId.
@param sessionId
the original session id, it might contain the jvm route
@param memcachedId
the memcached id to encode in the session id, may be <code>null</code>.
@return the sessionId which now contains the memcachedId if one was provided, otherwise
the sessionId unmodified. | [
"Create",
"a",
"session",
"id",
"including",
"the",
"provided",
"memcachedId",
"."
] | train | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java#L71-L85 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_menu_menuId_entry_entryId_PUT | public void billingAccount_ovhPabx_serviceName_menu_menuId_entry_entryId_PUT(String billingAccount, String serviceName, Long menuId, Long entryId, OvhOvhPabxMenuEntry body) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/menu/{menuId}/entry/{entryId}";
StringBuilder sb = path(qPath, billingAccount, serviceName, menuId, entryId);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void billingAccount_ovhPabx_serviceName_menu_menuId_entry_entryId_PUT(String billingAccount, String serviceName, Long menuId, Long entryId, OvhOvhPabxMenuEntry body) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/menu/{menuId}/entry/{entryId}";
StringBuilder sb = path(qPath, billingAccount, serviceName, menuId, entryId);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"billingAccount_ovhPabx_serviceName_menu_menuId_entry_entryId_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"menuId",
",",
"Long",
"entryId",
",",
"OvhOvhPabxMenuEntry",
"body",
")",
"throws",
"IOException",
"{",
"Stri... | Alter this object properties
REST: PUT /telephony/{billingAccount}/ovhPabx/{serviceName}/menu/{menuId}/entry/{entryId}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param menuId [required]
@param entryId [required] | [
"Alter",
"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#L7509-L7513 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.getAutoGeneratedKeyAttributeValue | private AttributeValue getAutoGeneratedKeyAttributeValue(Method getter, Object getterResult) {
ArgumentMarshaller marshaller = reflector.getAutoGeneratedKeyArgumentMarshaller(getter);
return marshaller.marshall(getterResult);
} | java | private AttributeValue getAutoGeneratedKeyAttributeValue(Method getter, Object getterResult) {
ArgumentMarshaller marshaller = reflector.getAutoGeneratedKeyArgumentMarshaller(getter);
return marshaller.marshall(getterResult);
} | [
"private",
"AttributeValue",
"getAutoGeneratedKeyAttributeValue",
"(",
"Method",
"getter",
",",
"Object",
"getterResult",
")",
"{",
"ArgumentMarshaller",
"marshaller",
"=",
"reflector",
".",
"getAutoGeneratedKeyArgumentMarshaller",
"(",
"getter",
")",
";",
"return",
"mars... | Returns an attribute value corresponding to the key method and value given. | [
"Returns",
"an",
"attribute",
"value",
"corresponding",
"to",
"the",
"key",
"method",
"and",
"value",
"given",
"."
] | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L1028-L1031 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/HttpChannelUtils.java | HttpChannelUtils.parseName | static private String parseName(char[] ch, int start, int end) {
int len = 0;
char[] name = new char[end - start];
for (int i = start; i < end; i++) {
switch (ch[i]) {
case '+':
// translate plus symbols to spaces
name[len++] = ' ';
break;
case '%':
// translate "%xx" to appropriate character (i.e. %20 is space)
if ((i + 2) < end) {
int num1 = Character.digit(ch[++i], 16);
if (-1 == num1) {
throw new IllegalArgumentException("" + ch[i]);
}
int num2 = Character.digit(ch[++i], 16);
if (-1 == num2) {
throw new IllegalArgumentException("" + ch[i]);
}
name[len++] = (char) ((num1 << 4) | num2);
} else {
// allow '%' at end of value or second to last character
for (; i < end; i++) {
name[len++] = ch[i];
}
}
break;
default:
// regular character, just save it
name[len++] = ch[i];
break;
}
}
return new String(name, 0, len);
} | java | static private String parseName(char[] ch, int start, int end) {
int len = 0;
char[] name = new char[end - start];
for (int i = start; i < end; i++) {
switch (ch[i]) {
case '+':
// translate plus symbols to spaces
name[len++] = ' ';
break;
case '%':
// translate "%xx" to appropriate character (i.e. %20 is space)
if ((i + 2) < end) {
int num1 = Character.digit(ch[++i], 16);
if (-1 == num1) {
throw new IllegalArgumentException("" + ch[i]);
}
int num2 = Character.digit(ch[++i], 16);
if (-1 == num2) {
throw new IllegalArgumentException("" + ch[i]);
}
name[len++] = (char) ((num1 << 4) | num2);
} else {
// allow '%' at end of value or second to last character
for (; i < end; i++) {
name[len++] = ch[i];
}
}
break;
default:
// regular character, just save it
name[len++] = ch[i];
break;
}
}
return new String(name, 0, len);
} | [
"static",
"private",
"String",
"parseName",
"(",
"char",
"[",
"]",
"ch",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"len",
"=",
"0",
";",
"char",
"[",
"]",
"name",
"=",
"new",
"char",
"[",
"end",
"-",
"start",
"]",
";",
"for",
"("... | Parse a query parameter's name out of the input character array. This
will undo any URLEncoding in the data (%20 is a space for example) and
return the resulting string.
Input must be in ASCII encoding.
@param ch
@param start
@param end
@return String
@throws IllegalArgumentException | [
"Parse",
"a",
"query",
"parameter",
"s",
"name",
"out",
"of",
"the",
"input",
"character",
"array",
".",
"This",
"will",
"undo",
"any",
"URLEncoding",
"in",
"the",
"data",
"(",
"%20",
"is",
"a",
"space",
"for",
"example",
")",
"and",
"return",
"the",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/HttpChannelUtils.java#L241-L277 |
infinispan/infinispan | core/src/main/java/org/infinispan/persistence/support/SingletonCacheWriter.java | SingletonCacheWriter.doPushState | private void doPushState() throws PushStateException {
if (pushStateFuture == null || pushStateFuture.isDone()) {
Callable<?> task = createPushStateTask();
pushStateFuture = executor.submit(task);
try {
waitForTaskToFinish(pushStateFuture, singletonConfiguration.pushStateTimeout(), TimeUnit.MILLISECONDS);
} catch (Exception e) {
throw new PushStateException("unable to complete in memory state push to cache loader", e);
}
} else {
/* at the most, we wait for push state timeout value. if it push task finishes earlier, this call
* will stop when the push task finishes, otherwise a timeout exception will be reported */
awaitForPushToFinish(pushStateFuture, singletonConfiguration.pushStateTimeout(), TimeUnit.MILLISECONDS);
}
} | java | private void doPushState() throws PushStateException {
if (pushStateFuture == null || pushStateFuture.isDone()) {
Callable<?> task = createPushStateTask();
pushStateFuture = executor.submit(task);
try {
waitForTaskToFinish(pushStateFuture, singletonConfiguration.pushStateTimeout(), TimeUnit.MILLISECONDS);
} catch (Exception e) {
throw new PushStateException("unable to complete in memory state push to cache loader", e);
}
} else {
/* at the most, we wait for push state timeout value. if it push task finishes earlier, this call
* will stop when the push task finishes, otherwise a timeout exception will be reported */
awaitForPushToFinish(pushStateFuture, singletonConfiguration.pushStateTimeout(), TimeUnit.MILLISECONDS);
}
} | [
"private",
"void",
"doPushState",
"(",
")",
"throws",
"PushStateException",
"{",
"if",
"(",
"pushStateFuture",
"==",
"null",
"||",
"pushStateFuture",
".",
"isDone",
"(",
")",
")",
"{",
"Callable",
"<",
"?",
">",
"task",
"=",
"createPushStateTask",
"(",
")",
... | Called when the SingletonStore discovers that the cache has become the coordinator and push in memory state has
been enabled. It might not actually push the state if there's an ongoing push task running, in which case will
wait for the push task to finish. | [
"Called",
"when",
"the",
"SingletonStore",
"discovers",
"that",
"the",
"cache",
"has",
"become",
"the",
"coordinator",
"and",
"push",
"in",
"memory",
"state",
"has",
"been",
"enabled",
".",
"It",
"might",
"not",
"actually",
"push",
"the",
"state",
"if",
"the... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/persistence/support/SingletonCacheWriter.java#L193-L207 |
steveash/jopenfst | src/main/java/com/github/steveash/jopenfst/operations/Determinize.java | Determinize.groupByInputLabel | private Collection<DetArcWork> groupByInputLabel(final DetStateTuple detStateTuple) {
Map<Integer, DetArcWork> inputLabelToWork = Maps.newHashMap();
for (DetElement detElement : detStateTuple.getElements()) {
State inputState = getInputStateForId(detElement.getInputStateId());
for (Arc inputArc : inputState.getArcs()) {
UnionWeight<GallicWeight> inputArcAsUnion = UnionWeight.createSingle(
GallicWeight.createSingleLabel(inputArc.getOlabel(), inputArc.getWeight())
);
DetElement pendingElement = new DetElement(inputArc.getNextState().getId(),
this.unionSemiring.times(detElement.getResidual(), inputArcAsUnion));
DetArcWork work = inputLabelToWork.computeIfAbsent(inputArc.getIlabel(),
iLabel -> new DetArcWork(iLabel, this.unionSemiring.zero()));
work.pendingElements.add(pendingElement);
}
}
return inputLabelToWork.values();
} | java | private Collection<DetArcWork> groupByInputLabel(final DetStateTuple detStateTuple) {
Map<Integer, DetArcWork> inputLabelToWork = Maps.newHashMap();
for (DetElement detElement : detStateTuple.getElements()) {
State inputState = getInputStateForId(detElement.getInputStateId());
for (Arc inputArc : inputState.getArcs()) {
UnionWeight<GallicWeight> inputArcAsUnion = UnionWeight.createSingle(
GallicWeight.createSingleLabel(inputArc.getOlabel(), inputArc.getWeight())
);
DetElement pendingElement = new DetElement(inputArc.getNextState().getId(),
this.unionSemiring.times(detElement.getResidual(), inputArcAsUnion));
DetArcWork work = inputLabelToWork.computeIfAbsent(inputArc.getIlabel(),
iLabel -> new DetArcWork(iLabel, this.unionSemiring.zero()));
work.pendingElements.add(pendingElement);
}
}
return inputLabelToWork.values();
} | [
"private",
"Collection",
"<",
"DetArcWork",
">",
"groupByInputLabel",
"(",
"final",
"DetStateTuple",
"detStateTuple",
")",
"{",
"Map",
"<",
"Integer",
",",
"DetArcWork",
">",
"inputLabelToWork",
"=",
"Maps",
".",
"newHashMap",
"(",
")",
";",
"for",
"(",
"DetEl... | input states in the residset, and just create pending (possibly duplicate) input residuals for the target states | [
"input",
"states",
"in",
"the",
"residset",
"and",
"just",
"create",
"pending",
"(",
"possibly",
"duplicate",
")",
"input",
"residuals",
"for",
"the",
"target",
"states"
] | train | https://github.com/steveash/jopenfst/blob/4c675203015c1cfad2072556cb532b6edc73261d/src/main/java/com/github/steveash/jopenfst/operations/Determinize.java#L222-L240 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/dependency/EvidenceCollection.java | EvidenceCollection.addEvidence | public synchronized void addEvidence(EvidenceType type, Evidence e) {
if (null != type) {
switch (type) {
case VENDOR:
vendors.add(e);
break;
case PRODUCT:
products.add(e);
break;
case VERSION:
versions.add(e);
break;
default:
break;
}
}
} | java | public synchronized void addEvidence(EvidenceType type, Evidence e) {
if (null != type) {
switch (type) {
case VENDOR:
vendors.add(e);
break;
case PRODUCT:
products.add(e);
break;
case VERSION:
versions.add(e);
break;
default:
break;
}
}
} | [
"public",
"synchronized",
"void",
"addEvidence",
"(",
"EvidenceType",
"type",
",",
"Evidence",
"e",
")",
"{",
"if",
"(",
"null",
"!=",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"VENDOR",
":",
"vendors",
".",
"add",
"(",
"e",
")",
";"... | Adds evidence to the collection.
@param type the type of evidence (vendor, product, version)
@param e Evidence | [
"Adds",
"evidence",
"to",
"the",
"collection",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/EvidenceCollection.java#L148-L164 |
lastaflute/lastaflute | src/main/java/org/lastaflute/core/mail/LaTypicalPostcard.java | LaTypicalPostcard.pushLogging | public void pushLogging(String key, Object value) {
assertArgumentNotNull("key", key);
assertArgumentNotNull("value", value);
postcard.pushLogging(key, value);
} | java | public void pushLogging(String key, Object value) {
assertArgumentNotNull("key", key);
assertArgumentNotNull("value", value);
postcard.pushLogging(key, value);
} | [
"public",
"void",
"pushLogging",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"assertArgumentNotNull",
"(",
"\"key\"",
",",
"key",
")",
";",
"assertArgumentNotNull",
"(",
"\"value\"",
",",
"value",
")",
";",
"postcard",
".",
"pushLogging",
"(",
"k... | Push element of mail logging.
@param key The key of the element. (NotNull)
@param value The value of the element. (NotNull) | [
"Push",
"element",
"of",
"mail",
"logging",
"."
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/core/mail/LaTypicalPostcard.java#L272-L276 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/util/NodeUtils.java | NodeUtils.getFormFromPacket | public static ConfigureForm getFormFromPacket(Stanza packet, PubSubElementType elem) {
FormNode config = packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns());
Form formReply = config.getForm();
return new ConfigureForm(formReply);
} | java | public static ConfigureForm getFormFromPacket(Stanza packet, PubSubElementType elem) {
FormNode config = packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns());
Form formReply = config.getForm();
return new ConfigureForm(formReply);
} | [
"public",
"static",
"ConfigureForm",
"getFormFromPacket",
"(",
"Stanza",
"packet",
",",
"PubSubElementType",
"elem",
")",
"{",
"FormNode",
"config",
"=",
"packet",
".",
"getExtension",
"(",
"elem",
".",
"getElementName",
"(",
")",
",",
"elem",
".",
"getNamespace... | Get a {@link ConfigureForm} from a packet.
@param packet
@param elem
@return The configuration form | [
"Get",
"a",
"{",
"@link",
"ConfigureForm",
"}",
"from",
"a",
"packet",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/util/NodeUtils.java#L39-L43 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.setFeatureStyle | public static boolean setFeatureStyle(PolylineOptions polylineOptions, GeoPackage geoPackage, FeatureRow featureRow, float density) {
FeatureStyleExtension featureStyleExtension = new FeatureStyleExtension(geoPackage);
return setFeatureStyle(polylineOptions, featureStyleExtension, featureRow, density);
} | java | public static boolean setFeatureStyle(PolylineOptions polylineOptions, GeoPackage geoPackage, FeatureRow featureRow, float density) {
FeatureStyleExtension featureStyleExtension = new FeatureStyleExtension(geoPackage);
return setFeatureStyle(polylineOptions, featureStyleExtension, featureRow, density);
} | [
"public",
"static",
"boolean",
"setFeatureStyle",
"(",
"PolylineOptions",
"polylineOptions",
",",
"GeoPackage",
"geoPackage",
",",
"FeatureRow",
"featureRow",
",",
"float",
"density",
")",
"{",
"FeatureStyleExtension",
"featureStyleExtension",
"=",
"new",
"FeatureStyleExt... | Set the feature row style into the polyline options
@param polylineOptions polyline options
@param geoPackage GeoPackage
@param featureRow feature row
@param density display density: {@link android.util.DisplayMetrics#density}
@return true if style was set into the polyline options | [
"Set",
"the",
"feature",
"row",
"style",
"into",
"the",
"polyline",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L367-L372 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java | BasicAtomGenerator.generateCompactElement | public IRenderingElement generateCompactElement(IAtom atom, RendererModel model) {
Point2d point = atom.getPoint2d();
double radius = (Double) model.get(AtomRadius.class) / model.getParameter(Scale.class).getValue();
double distance = 2 * radius;
if (model.get(CompactShape.class) == Shape.SQUARE) {
return new RectangleElement(point.x - radius, point.y - radius, distance, distance, true, getAtomColor(
atom, model));
} else {
return new OvalElement(point.x, point.y, radius, true, getAtomColor(atom, model));
}
} | java | public IRenderingElement generateCompactElement(IAtom atom, RendererModel model) {
Point2d point = atom.getPoint2d();
double radius = (Double) model.get(AtomRadius.class) / model.getParameter(Scale.class).getValue();
double distance = 2 * radius;
if (model.get(CompactShape.class) == Shape.SQUARE) {
return new RectangleElement(point.x - radius, point.y - radius, distance, distance, true, getAtomColor(
atom, model));
} else {
return new OvalElement(point.x, point.y, radius, true, getAtomColor(atom, model));
}
} | [
"public",
"IRenderingElement",
"generateCompactElement",
"(",
"IAtom",
"atom",
",",
"RendererModel",
"model",
")",
"{",
"Point2d",
"point",
"=",
"atom",
".",
"getPoint2d",
"(",
")",
";",
"double",
"radius",
"=",
"(",
"Double",
")",
"model",
".",
"get",
"(",
... | Generate a compact element for an atom, such as a circle or a square,
rather than text element.
@param atom the atom to generate the compact element for
@param model the renderer model
@return a compact rendering element | [
"Generate",
"a",
"compact",
"element",
"for",
"an",
"atom",
"such",
"as",
"a",
"circle",
"or",
"a",
"square",
"rather",
"than",
"text",
"element",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java#L341-L351 |
tumblr/jumblr | src/main/java/com/tumblr/jumblr/JumblrClient.java | JumblrClient.blogAvatar | public String blogAvatar(String blogName, Integer size) {
String pathExt = size == null ? "" : "/" + size.toString();
return requestBuilder.getRedirectUrl(JumblrClient.blogPath(blogName, "/avatar" + pathExt));
} | java | public String blogAvatar(String blogName, Integer size) {
String pathExt = size == null ? "" : "/" + size.toString();
return requestBuilder.getRedirectUrl(JumblrClient.blogPath(blogName, "/avatar" + pathExt));
} | [
"public",
"String",
"blogAvatar",
"(",
"String",
"blogName",
",",
"Integer",
"size",
")",
"{",
"String",
"pathExt",
"=",
"size",
"==",
"null",
"?",
"\"\"",
":",
"\"/\"",
"+",
"size",
".",
"toString",
"(",
")",
";",
"return",
"requestBuilder",
".",
"getRe... | Get a specific size avatar for a given blog
@param blogName the avatar URL of the blog
@param size The size requested
@return a string representing the URL of the avatar | [
"Get",
"a",
"specific",
"size",
"avatar",
"for",
"a",
"given",
"blog"
] | train | https://github.com/tumblr/jumblr/blob/373629fd545defb016e227ea758f092507fbd624/src/main/java/com/tumblr/jumblr/JumblrClient.java#L272-L275 |
structurizr/java | structurizr-core/src/com/structurizr/view/ViewSet.java | ViewSet.createSystemContextView | public SystemContextView createSystemContextView(SoftwareSystem softwareSystem, String key, String description) {
assertThatTheSoftwareSystemIsNotNull(softwareSystem);
assertThatTheViewKeyIsSpecifiedAndUnique(key);
SystemContextView view = new SystemContextView(softwareSystem, key, description);
view.setViewSet(this);
systemContextViews.add(view);
return view;
} | java | public SystemContextView createSystemContextView(SoftwareSystem softwareSystem, String key, String description) {
assertThatTheSoftwareSystemIsNotNull(softwareSystem);
assertThatTheViewKeyIsSpecifiedAndUnique(key);
SystemContextView view = new SystemContextView(softwareSystem, key, description);
view.setViewSet(this);
systemContextViews.add(view);
return view;
} | [
"public",
"SystemContextView",
"createSystemContextView",
"(",
"SoftwareSystem",
"softwareSystem",
",",
"String",
"key",
",",
"String",
"description",
")",
"{",
"assertThatTheSoftwareSystemIsNotNull",
"(",
"softwareSystem",
")",
";",
"assertThatTheViewKeyIsSpecifiedAndUnique",
... | Creates a system context view, where the scope of the view is the specified software system.
@param softwareSystem the SoftwareSystem object representing the scope of the view
@param key the key for the view (must be unique)
@param description a description of the view
@return a SystemContextView object
@throws IllegalArgumentException if the software system is null or the key is not unique | [
"Creates",
"a",
"system",
"context",
"view",
"where",
"the",
"scope",
"of",
"the",
"view",
"is",
"the",
"specified",
"software",
"system",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/view/ViewSet.java#L71-L79 |
airlift/slice | src/main/java/io/airlift/slice/Slices.java | Slices.wrappedDoubleArray | public static Slice wrappedDoubleArray(double[] array, int offset, int length)
{
if (length == 0) {
return EMPTY_SLICE;
}
return new Slice(array, offset, length);
} | java | public static Slice wrappedDoubleArray(double[] array, int offset, int length)
{
if (length == 0) {
return EMPTY_SLICE;
}
return new Slice(array, offset, length);
} | [
"public",
"static",
"Slice",
"wrappedDoubleArray",
"(",
"double",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
"EMPTY_SLICE",
";",
"}",
"return",
"new",
"Slice",
"(",
"arra... | Creates a slice over the specified array range.
@param offset the array position at which the slice begins
@param length the number of array positions to include in the slice | [
"Creates",
"a",
"slice",
"over",
"the",
"specified",
"array",
"range",
"."
] | train | https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/Slices.java#L281-L287 |
stephanenicolas/toothpick | toothpick-runtime/src/main/java/toothpick/Toothpick.java | Toothpick.openScope | private static Scope openScope(Object name, boolean shouldCheckMultipleRootScopes) {
if (name == null) {
throw new IllegalArgumentException("null scope names are not allowed.");
}
Scope scope = MAP_KEY_TO_SCOPE.get(name);
if (scope != null) {
return scope;
}
scope = new ScopeImpl(name);
Scope previous = MAP_KEY_TO_SCOPE.putIfAbsent(name, scope);
if (previous != null) {
//if there was already a scope by this name, we return it
scope = previous;
} else if (shouldCheckMultipleRootScopes) {
ConfigurationHolder.configuration.checkMultipleRootScopes(scope);
}
return scope;
} | java | private static Scope openScope(Object name, boolean shouldCheckMultipleRootScopes) {
if (name == null) {
throw new IllegalArgumentException("null scope names are not allowed.");
}
Scope scope = MAP_KEY_TO_SCOPE.get(name);
if (scope != null) {
return scope;
}
scope = new ScopeImpl(name);
Scope previous = MAP_KEY_TO_SCOPE.putIfAbsent(name, scope);
if (previous != null) {
//if there was already a scope by this name, we return it
scope = previous;
} else if (shouldCheckMultipleRootScopes) {
ConfigurationHolder.configuration.checkMultipleRootScopes(scope);
}
return scope;
} | [
"private",
"static",
"Scope",
"openScope",
"(",
"Object",
"name",
",",
"boolean",
"shouldCheckMultipleRootScopes",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null scope names are not allowed.\"",
")",
";"... | Opens a scope without any parent.
If a scope by this {@code name} already exists, it is returned.
Otherwise a new scope is created.
@param name the name of the scope to open.
@param shouldCheckMultipleRootScopes whether or not to check that the return scope
is not introducing a second tree in TP forest of scopes. | [
"Opens",
"a",
"scope",
"without",
"any",
"parent",
".",
"If",
"a",
"scope",
"by",
"this",
"{",
"@code",
"name",
"}",
"already",
"exists",
"it",
"is",
"returned",
".",
"Otherwise",
"a",
"new",
"scope",
"is",
"created",
"."
] | train | https://github.com/stephanenicolas/toothpick/blob/54476ca9a5fa48809c15a46e43e38db9ed7e1a75/toothpick-runtime/src/main/java/toothpick/Toothpick.java#L93-L111 |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.fromHsl | public static RgbaColor fromHsl(float H, float S, float L) {
// convert to [0-1]
H /= 360f;
S /= 100f;
L /= 100f;
float R, G, B;
if (S == 0) {
// grey
R = G = B = L;
}
else {
float m2 = L <= 0.5 ? L * (S + 1f) : L + S - L * S;
float m1 = 2f * L - m2;
R = hue2rgb(m1, m2, H + 1 / 3f);
G = hue2rgb(m1, m2, H);
B = hue2rgb(m1, m2, H - 1 / 3f);
}
// convert [0-1] to [0-255]
int r = Math.round(R * 255f);
int g = Math.round(G * 255f);
int b = Math.round(B * 255f);
return new RgbaColor(r, g, b, 1);
} | java | public static RgbaColor fromHsl(float H, float S, float L) {
// convert to [0-1]
H /= 360f;
S /= 100f;
L /= 100f;
float R, G, B;
if (S == 0) {
// grey
R = G = B = L;
}
else {
float m2 = L <= 0.5 ? L * (S + 1f) : L + S - L * S;
float m1 = 2f * L - m2;
R = hue2rgb(m1, m2, H + 1 / 3f);
G = hue2rgb(m1, m2, H);
B = hue2rgb(m1, m2, H - 1 / 3f);
}
// convert [0-1] to [0-255]
int r = Math.round(R * 255f);
int g = Math.round(G * 255f);
int b = Math.round(B * 255f);
return new RgbaColor(r, g, b, 1);
} | [
"public",
"static",
"RgbaColor",
"fromHsl",
"(",
"float",
"H",
",",
"float",
"S",
",",
"float",
"L",
")",
"{",
"// convert to [0-1]",
"H",
"/=",
"360f",
";",
"S",
"/=",
"100f",
";",
"L",
"/=",
"100f",
";",
"float",
"R",
",",
"G",
",",
"B",
";",
"... | Creates a new RgbaColor from the specified HSL components.
<p>
<i>Implementation based on <a
href="http://en.wikipedia.org/wiki/HSL_and_HSV">wikipedia</a>
and <a
href="http://www.w3.org/TR/css3-color/#hsl-color">w3c</a></i>
@param H
Hue [0,360)
@param S
Saturation [0,100]
@param L
Lightness [0,100] | [
"Creates",
"a",
"new",
"RgbaColor",
"from",
"the",
"specified",
"HSL",
"components",
"."
] | train | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L673-L700 |
h2oai/h2o-3 | h2o-core/src/main/java/hex/ModelMetricsBinomial.java | ModelMetricsBinomial.make | static public ModelMetricsBinomial make(Vec targetClassProbs, Vec actualLabels) {
return make(targetClassProbs,actualLabels,actualLabels.domain());
} | java | static public ModelMetricsBinomial make(Vec targetClassProbs, Vec actualLabels) {
return make(targetClassProbs,actualLabels,actualLabels.domain());
} | [
"static",
"public",
"ModelMetricsBinomial",
"make",
"(",
"Vec",
"targetClassProbs",
",",
"Vec",
"actualLabels",
")",
"{",
"return",
"make",
"(",
"targetClassProbs",
",",
"actualLabels",
",",
"actualLabels",
".",
"domain",
"(",
")",
")",
";",
"}"
] | Build a Binomial ModelMetrics object from target-class probabilities, from actual labels, and a given domain for both labels (and domain[1] is the target class)
@param targetClassProbs A Vec containing target class probabilities
@param actualLabels A Vec containing the actual labels (can be for fewer labels than what's in domain, since the predictions can be for a small subset of the data)
@return ModelMetrics object | [
"Build",
"a",
"Binomial",
"ModelMetrics",
"object",
"from",
"target",
"-",
"class",
"probabilities",
"from",
"actual",
"labels",
"and",
"a",
"given",
"domain",
"for",
"both",
"labels",
"(",
"and",
"domain",
"[",
"1",
"]",
"is",
"the",
"target",
"class",
")... | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/hex/ModelMetricsBinomial.java#L78-L80 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/ParsedAddressGrouping.java | ParsedAddressGrouping.getSegmentPrefixLength | public static Integer getSegmentPrefixLength(int bitsPerSegment, Integer prefixLength, int segmentIndex) {
if(prefixLength != null) {
return getPrefixedSegmentPrefixLength(bitsPerSegment, prefixLength, segmentIndex);
}
return null;
} | java | public static Integer getSegmentPrefixLength(int bitsPerSegment, Integer prefixLength, int segmentIndex) {
if(prefixLength != null) {
return getPrefixedSegmentPrefixLength(bitsPerSegment, prefixLength, segmentIndex);
}
return null;
} | [
"public",
"static",
"Integer",
"getSegmentPrefixLength",
"(",
"int",
"bitsPerSegment",
",",
"Integer",
"prefixLength",
",",
"int",
"segmentIndex",
")",
"{",
"if",
"(",
"prefixLength",
"!=",
"null",
")",
"{",
"return",
"getPrefixedSegmentPrefixLength",
"(",
"bitsPerS... | Across an address prefixes are:
IPv6: (null):...:(null):(1 to 16):(0):...:(0)
or IPv4: ...(null).(1 to 8).(0)... | [
"Across",
"an",
"address",
"prefixes",
"are",
":",
"IPv6",
":",
"(",
"null",
")",
":",
"...",
":",
"(",
"null",
")",
":",
"(",
"1",
"to",
"16",
")",
":",
"(",
"0",
")",
":",
"...",
":",
"(",
"0",
")",
"or",
"IPv4",
":",
"...",
"(",
"null",
... | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/ParsedAddressGrouping.java#L67-L72 |
gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/ScheduleService.java | ScheduleService.rerunJobs | public Stage rerunJobs(final Stage stage, final List<String> jobNames, final HttpOperationResult result) {
final StageIdentifier identifier = stage.getIdentifier();
HealthStateType healthStateForStage = HealthStateType.general(HealthStateScope.forStage(identifier.getPipelineName(), identifier.getStageName()));
if (jobNames == null || jobNames.isEmpty()) {
String message = "No job was selected to re-run.";
result.badRequest(message, message, healthStateForStage);
return null;
}
try {
Stage resultStage = lockAndRerunStage(identifier.getPipelineName(), identifier.getPipelineCounter(), identifier.getStageName(), (pipelineName, stageName, context) -> {
StageConfig stageConfig = goConfigService.stageConfigNamed(identifier.getPipelineName(), identifier.getStageName());
String latestMd5 = goConfigService.getCurrentConfig().getMd5();
try {
return instanceFactory.createStageForRerunOfJobs(stage, jobNames, context, stageConfig, timeProvider, latestMd5);
} catch (CannotRerunJobException e) {
result.notFound(e.getMessage(), e.getMessage(), healthStateForStage);
throw e;
}
}, new ResultUpdatingErrorHandler(result));
result.accepted(String.format("Request to rerun jobs accepted", identifier), "", healthStateForStage);
return resultStage;
} catch (RuntimeException e) {
if (result.canContinue()) {
String message = String.format("Job rerun request for job(s) [%s] could not be completed because of unexpected failure. Cause: %s", StringUtils.join(jobNames.toArray(), ", "),
e.getMessage());
result.internalServerError(message, healthStateForStage);
LOGGER.error(message, e);
}
return null;
}
} | java | public Stage rerunJobs(final Stage stage, final List<String> jobNames, final HttpOperationResult result) {
final StageIdentifier identifier = stage.getIdentifier();
HealthStateType healthStateForStage = HealthStateType.general(HealthStateScope.forStage(identifier.getPipelineName(), identifier.getStageName()));
if (jobNames == null || jobNames.isEmpty()) {
String message = "No job was selected to re-run.";
result.badRequest(message, message, healthStateForStage);
return null;
}
try {
Stage resultStage = lockAndRerunStage(identifier.getPipelineName(), identifier.getPipelineCounter(), identifier.getStageName(), (pipelineName, stageName, context) -> {
StageConfig stageConfig = goConfigService.stageConfigNamed(identifier.getPipelineName(), identifier.getStageName());
String latestMd5 = goConfigService.getCurrentConfig().getMd5();
try {
return instanceFactory.createStageForRerunOfJobs(stage, jobNames, context, stageConfig, timeProvider, latestMd5);
} catch (CannotRerunJobException e) {
result.notFound(e.getMessage(), e.getMessage(), healthStateForStage);
throw e;
}
}, new ResultUpdatingErrorHandler(result));
result.accepted(String.format("Request to rerun jobs accepted", identifier), "", healthStateForStage);
return resultStage;
} catch (RuntimeException e) {
if (result.canContinue()) {
String message = String.format("Job rerun request for job(s) [%s] could not be completed because of unexpected failure. Cause: %s", StringUtils.join(jobNames.toArray(), ", "),
e.getMessage());
result.internalServerError(message, healthStateForStage);
LOGGER.error(message, e);
}
return null;
}
} | [
"public",
"Stage",
"rerunJobs",
"(",
"final",
"Stage",
"stage",
",",
"final",
"List",
"<",
"String",
">",
"jobNames",
",",
"final",
"HttpOperationResult",
"result",
")",
"{",
"final",
"StageIdentifier",
"identifier",
"=",
"stage",
".",
"getIdentifier",
"(",
")... | IMPORTANT: this method is only meant for TOP level usage(never use this within a transaction). It gobbles exception. | [
"IMPORTANT",
":",
"this",
"method",
"is",
"only",
"meant",
"for",
"TOP",
"level",
"usage",
"(",
"never",
"use",
"this",
"within",
"a",
"transaction",
")",
".",
"It",
"gobbles",
"exception",
"."
] | train | https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/server/src/main/java/com/thoughtworks/go/server/service/ScheduleService.java#L332-L364 |
jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java | ReflectionUtils.getFieldValue | public static Object getFieldValue(Object object, String fieldName) {
try {
return getDeclaredFieldInHierarchy(object.getClass(), fieldName).get(object);
} catch (IllegalArgumentException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
} | java | public static Object getFieldValue(Object object, String fieldName) {
try {
return getDeclaredFieldInHierarchy(object.getClass(), fieldName).get(object);
} catch (IllegalArgumentException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"Object",
"object",
",",
"String",
"fieldName",
")",
"{",
"try",
"{",
"return",
"getDeclaredFieldInHierarchy",
"(",
"object",
".",
"getClass",
"(",
")",
",",
"fieldName",
")",
".",
"get",
"(",
"object",
")"... | Convenience method for getting the value of a private object field,
without the stress of checked exceptions in the reflection API.
@param object
Object containing the field.
@param fieldName
Name of the field whose value to return. | [
"Convenience",
"method",
"for",
"getting",
"the",
"value",
"of",
"a",
"private",
"object",
"field",
"without",
"the",
"stress",
"of",
"checked",
"exceptions",
"in",
"the",
"reflection",
"API",
"."
] | train | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java#L85-L93 |
javalite/activeweb | javalite-async/src/main/java/org/javalite/async/Async.java | Async.moveMessages | public int moveMessages(String source, String target){
try {
return getQueueControl(source).moveMessages("", target);
} catch (Exception e) {
throw new AsyncException(e);
}
} | java | public int moveMessages(String source, String target){
try {
return getQueueControl(source).moveMessages("", target);
} catch (Exception e) {
throw new AsyncException(e);
}
} | [
"public",
"int",
"moveMessages",
"(",
"String",
"source",
",",
"String",
"target",
")",
"{",
"try",
"{",
"return",
"getQueueControl",
"(",
"source",
")",
".",
"moveMessages",
"(",
"\"\"",
",",
"target",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",... | Moves all messages from one queue to another
@param source name of source queue
@param target name of target queue
@return number of messages moved | [
"Moves",
"all",
"messages",
"from",
"one",
"queue",
"to",
"another"
] | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/javalite-async/src/main/java/org/javalite/async/Async.java#L730-L737 |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.removeValue | public void removeValue(T value, boolean reload) {
int idx = getIndex(value);
if (idx >= 0) {
removeItemInternal(idx, reload);
}
} | java | public void removeValue(T value, boolean reload) {
int idx = getIndex(value);
if (idx >= 0) {
removeItemInternal(idx, reload);
}
} | [
"public",
"void",
"removeValue",
"(",
"T",
"value",
",",
"boolean",
"reload",
")",
"{",
"int",
"idx",
"=",
"getIndex",
"(",
"value",
")",
";",
"if",
"(",
"idx",
">=",
"0",
")",
"{",
"removeItemInternal",
"(",
"idx",
",",
"reload",
")",
";",
"}",
"}... | Removes a value from the list box. Nothing is done if the value isn't on
the list box.
@param value the value to be removed from the list
@param reload perform a 'material select' reload to update the DOM. | [
"Removes",
"a",
"value",
"from",
"the",
"list",
"box",
".",
"Nothing",
"is",
"done",
"if",
"the",
"value",
"isn",
"t",
"on",
"the",
"list",
"box",
"."
] | train | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L507-L512 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/configuration/GlobalConfiguration.java | GlobalConfiguration.getLongInternal | private long getLongInternal(final String key, final long defaultValue) {
long retVal = defaultValue;
try {
synchronized (this.confData) {
if (this.confData.containsKey(key)) {
retVal = Long.parseLong(this.confData.get(key));
}
}
} catch (NumberFormatException e) {
if (LOG.isDebugEnabled()) {
LOG.debug(StringUtils.stringifyException(e));
}
}
return retVal;
} | java | private long getLongInternal(final String key, final long defaultValue) {
long retVal = defaultValue;
try {
synchronized (this.confData) {
if (this.confData.containsKey(key)) {
retVal = Long.parseLong(this.confData.get(key));
}
}
} catch (NumberFormatException e) {
if (LOG.isDebugEnabled()) {
LOG.debug(StringUtils.stringifyException(e));
}
}
return retVal;
} | [
"private",
"long",
"getLongInternal",
"(",
"final",
"String",
"key",
",",
"final",
"long",
"defaultValue",
")",
"{",
"long",
"retVal",
"=",
"defaultValue",
";",
"try",
"{",
"synchronized",
"(",
"this",
".",
"confData",
")",
"{",
"if",
"(",
"this",
".",
"... | Returns the value associated with the given key as a long integer.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default) value associated with the given key | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"key",
"as",
"a",
"long",
"integer",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/configuration/GlobalConfiguration.java#L147-L166 |
Nordstrom/JUnit-Foundation | src/main/java/com/nordstrom/automation/junit/RetryHandler.java | RetryHandler.getMaxRetry | static int getMaxRetry(Object runner, final FrameworkMethod method) {
int maxRetry = 0;
// determine if retry is disabled for this method
NoRetry noRetryOnMethod = method.getAnnotation(NoRetry.class);
// determine if retry is disabled for the class that declares this method
NoRetry noRetryOnClass = method.getDeclaringClass().getAnnotation(NoRetry.class);
// if method isn't ignored or excluded from retry attempts
if (Boolean.FALSE.equals(invoke(runner, "isIgnored", method)) && (noRetryOnMethod == null) && (noRetryOnClass == null)) {
// get configured maximum retry count
maxRetry = JUnitConfig.getConfig().getInteger(JUnitSettings.MAX_RETRY.key(), Integer.valueOf(0));
}
return maxRetry;
} | java | static int getMaxRetry(Object runner, final FrameworkMethod method) {
int maxRetry = 0;
// determine if retry is disabled for this method
NoRetry noRetryOnMethod = method.getAnnotation(NoRetry.class);
// determine if retry is disabled for the class that declares this method
NoRetry noRetryOnClass = method.getDeclaringClass().getAnnotation(NoRetry.class);
// if method isn't ignored or excluded from retry attempts
if (Boolean.FALSE.equals(invoke(runner, "isIgnored", method)) && (noRetryOnMethod == null) && (noRetryOnClass == null)) {
// get configured maximum retry count
maxRetry = JUnitConfig.getConfig().getInteger(JUnitSettings.MAX_RETRY.key(), Integer.valueOf(0));
}
return maxRetry;
} | [
"static",
"int",
"getMaxRetry",
"(",
"Object",
"runner",
",",
"final",
"FrameworkMethod",
"method",
")",
"{",
"int",
"maxRetry",
"=",
"0",
";",
"// determine if retry is disabled for this method\r",
"NoRetry",
"noRetryOnMethod",
"=",
"method",
".",
"getAnnotation",
"(... | Get the configured maximum retry count for failed tests ({@link JUnitSetting#MAX_RETRY MAX_RETRY}).
<p>
<b>NOTE</b>: If the specified method or the class that declares it are marked with the {@code @NoRetry}
annotation, this method returns zero (0).
@param runner JUnit test runner
@param method test method for which retry is being considered
@return maximum retry attempts that will be made if the specified method fails | [
"Get",
"the",
"configured",
"maximum",
"retry",
"count",
"for",
"failed",
"tests",
"(",
"{",
"@link",
"JUnitSetting#MAX_RETRY",
"MAX_RETRY",
"}",
")",
".",
"<p",
">",
"<b",
">",
"NOTE<",
"/",
"b",
">",
":",
"If",
"the",
"specified",
"method",
"or",
"the"... | train | https://github.com/Nordstrom/JUnit-Foundation/blob/f24d91f8677d262c27d18ef29ed633eaac717be5/src/main/java/com/nordstrom/automation/junit/RetryHandler.java#L105-L120 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/source/extractor/filebased/FileBasedSource.java | FileBasedSource.addLineageSourceInfo | protected void addLineageSourceInfo(WorkUnit workUnit, State state) {
if (!lineageInfo.isPresent()) {
log.info("Lineage is not enabled");
return;
}
String platform = state.getProp(ConfigurationKeys.SOURCE_FILEBASED_PLATFORM, DatasetConstants.PLATFORM_HDFS);
Path dataDir = new Path(state.getProp(ConfigurationKeys.SOURCE_FILEBASED_DATA_DIRECTORY));
String dataset = Path.getPathWithoutSchemeAndAuthority(dataDir).toString();
DatasetDescriptor source = new DatasetDescriptor(platform, dataset);
lineageInfo.get().setSource(source, workUnit);
} | java | protected void addLineageSourceInfo(WorkUnit workUnit, State state) {
if (!lineageInfo.isPresent()) {
log.info("Lineage is not enabled");
return;
}
String platform = state.getProp(ConfigurationKeys.SOURCE_FILEBASED_PLATFORM, DatasetConstants.PLATFORM_HDFS);
Path dataDir = new Path(state.getProp(ConfigurationKeys.SOURCE_FILEBASED_DATA_DIRECTORY));
String dataset = Path.getPathWithoutSchemeAndAuthority(dataDir).toString();
DatasetDescriptor source = new DatasetDescriptor(platform, dataset);
lineageInfo.get().setSource(source, workUnit);
} | [
"protected",
"void",
"addLineageSourceInfo",
"(",
"WorkUnit",
"workUnit",
",",
"State",
"state",
")",
"{",
"if",
"(",
"!",
"lineageInfo",
".",
"isPresent",
"(",
")",
")",
"{",
"log",
".",
"info",
"(",
"\"Lineage is not enabled\"",
")",
";",
"return",
";",
... | Add lineage source info to a single work unit
@param workUnit a single work unit, not an instance of {@link org.apache.gobblin.source.workunit.MultiWorkUnit}
@param state configurations | [
"Add",
"lineage",
"source",
"info",
"to",
"a",
"single",
"work",
"unit"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/filebased/FileBasedSource.java#L236-L247 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java | WebApplicationContext.setErrorPage | public void setErrorPage(String error, String uriInContext)
{
if (_errorPages == null)
_errorPages= new HashMap();
_errorPages.put(error, uriInContext);
} | java | public void setErrorPage(String error, String uriInContext)
{
if (_errorPages == null)
_errorPages= new HashMap();
_errorPages.put(error, uriInContext);
} | [
"public",
"void",
"setErrorPage",
"(",
"String",
"error",
",",
"String",
"uriInContext",
")",
"{",
"if",
"(",
"_errorPages",
"==",
"null",
")",
"_errorPages",
"=",
"new",
"HashMap",
"(",
")",
";",
"_errorPages",
".",
"put",
"(",
"error",
",",
"uriInContext... | set error page URI.
@param error A string representing an error code or a
exception classname
@param uriInContext | [
"set",
"error",
"page",
"URI",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java#L801-L806 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java | ExpressRouteCircuitAuthorizationsInner.listAsync | public Observable<Page<ExpressRouteCircuitAuthorizationInner>> listAsync(final String resourceGroupName, final String circuitName) {
return listWithServiceResponseAsync(resourceGroupName, circuitName)
.map(new Func1<ServiceResponse<Page<ExpressRouteCircuitAuthorizationInner>>, Page<ExpressRouteCircuitAuthorizationInner>>() {
@Override
public Page<ExpressRouteCircuitAuthorizationInner> call(ServiceResponse<Page<ExpressRouteCircuitAuthorizationInner>> response) {
return response.body();
}
});
} | java | public Observable<Page<ExpressRouteCircuitAuthorizationInner>> listAsync(final String resourceGroupName, final String circuitName) {
return listWithServiceResponseAsync(resourceGroupName, circuitName)
.map(new Func1<ServiceResponse<Page<ExpressRouteCircuitAuthorizationInner>>, Page<ExpressRouteCircuitAuthorizationInner>>() {
@Override
public Page<ExpressRouteCircuitAuthorizationInner> call(ServiceResponse<Page<ExpressRouteCircuitAuthorizationInner>> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"Page",
"<",
"ExpressRouteCircuitAuthorizationInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"circuitName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",... | Gets all authorizations in an express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the circuit.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object | [
"Gets",
"all",
"authorizations",
"in",
"an",
"express",
"route",
"circuit",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java#L581-L589 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/io/ModbusTransaction.java | ModbusTransaction.checkValidity | void checkValidity() throws ModbusException {
if (request != null && response != null) {
if (request.getUnitID() != response.getUnitID()) {
throw new ModbusIOException("Unit ID mismatch - Request [%s] Response [%s]", request.getHexMessage(), response.getHexMessage());
}
if (request.getFunctionCode() != response.getFunctionCode()) {
throw new ModbusIOException("Function code mismatch - Request [%s] Response [%s]", request.getHexMessage(), response.getHexMessage());
}
}
} | java | void checkValidity() throws ModbusException {
if (request != null && response != null) {
if (request.getUnitID() != response.getUnitID()) {
throw new ModbusIOException("Unit ID mismatch - Request [%s] Response [%s]", request.getHexMessage(), response.getHexMessage());
}
if (request.getFunctionCode() != response.getFunctionCode()) {
throw new ModbusIOException("Function code mismatch - Request [%s] Response [%s]", request.getHexMessage(), response.getHexMessage());
}
}
} | [
"void",
"checkValidity",
"(",
")",
"throws",
"ModbusException",
"{",
"if",
"(",
"request",
"!=",
"null",
"&&",
"response",
"!=",
"null",
")",
"{",
"if",
"(",
"request",
".",
"getUnitID",
"(",
")",
"!=",
"response",
".",
"getUnitID",
"(",
")",
")",
"{",... | Checks the validity of the transaction, by
checking if the values of the response correspond
to the values of the request.
@throws ModbusException if the transaction is not valid. | [
"Checks",
"the",
"validity",
"of",
"the",
"transaction",
"by",
"checking",
"if",
"the",
"values",
"of",
"the",
"response",
"correspond",
"to",
"the",
"values",
"of",
"the",
"request",
"."
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/io/ModbusTransaction.java#L165-L174 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java | AccountHeader.addProfile | public void addProfile(@NonNull IProfile profile, int position) {
if (mAccountHeaderBuilder.mProfiles == null) {
mAccountHeaderBuilder.mProfiles = new ArrayList<>();
}
mAccountHeaderBuilder.mProfiles.add(position, profile);
mAccountHeaderBuilder.updateHeaderAndList();
} | java | public void addProfile(@NonNull IProfile profile, int position) {
if (mAccountHeaderBuilder.mProfiles == null) {
mAccountHeaderBuilder.mProfiles = new ArrayList<>();
}
mAccountHeaderBuilder.mProfiles.add(position, profile);
mAccountHeaderBuilder.updateHeaderAndList();
} | [
"public",
"void",
"addProfile",
"(",
"@",
"NonNull",
"IProfile",
"profile",
",",
"int",
"position",
")",
"{",
"if",
"(",
"mAccountHeaderBuilder",
".",
"mProfiles",
"==",
"null",
")",
"{",
"mAccountHeaderBuilder",
".",
"mProfiles",
"=",
"new",
"ArrayList",
"<>"... | Add a new profile at a specific position to the list
@param profile
@param position | [
"Add",
"a",
"new",
"profile",
"at",
"a",
"specific",
"position",
"to",
"the",
"list"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java#L284-L291 |
openbase/jul | extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MultiLanguageTextProcessor.java | MultiLanguageTextProcessor.addMultiLanguageText | public static MultiLanguageText.Builder addMultiLanguageText(final MultiLanguageText.Builder multiLanguageTextBuilder, final String languageCode, final String multiLanguageText) {
for (int i = 0; i < multiLanguageTextBuilder.getEntryCount(); i++) {
// found multiLanguageTexts for the entry key
if (multiLanguageTextBuilder.getEntry(i).getKey().equals(languageCode)) {
// check if the new value is not already contained
if (multiLanguageTextBuilder.getEntryBuilder(i).getValue().equalsIgnoreCase(multiLanguageText)) {
// return because multiLanguageText is already in there
return multiLanguageTextBuilder;
}
// add new multiLanguageText
multiLanguageTextBuilder.getEntryBuilder(i).setValue(multiLanguageText);
return multiLanguageTextBuilder;
}
}
// language code not present yet
multiLanguageTextBuilder.addEntryBuilder().setKey(languageCode).setValue(multiLanguageText);
return multiLanguageTextBuilder;
} | java | public static MultiLanguageText.Builder addMultiLanguageText(final MultiLanguageText.Builder multiLanguageTextBuilder, final String languageCode, final String multiLanguageText) {
for (int i = 0; i < multiLanguageTextBuilder.getEntryCount(); i++) {
// found multiLanguageTexts for the entry key
if (multiLanguageTextBuilder.getEntry(i).getKey().equals(languageCode)) {
// check if the new value is not already contained
if (multiLanguageTextBuilder.getEntryBuilder(i).getValue().equalsIgnoreCase(multiLanguageText)) {
// return because multiLanguageText is already in there
return multiLanguageTextBuilder;
}
// add new multiLanguageText
multiLanguageTextBuilder.getEntryBuilder(i).setValue(multiLanguageText);
return multiLanguageTextBuilder;
}
}
// language code not present yet
multiLanguageTextBuilder.addEntryBuilder().setKey(languageCode).setValue(multiLanguageText);
return multiLanguageTextBuilder;
} | [
"public",
"static",
"MultiLanguageText",
".",
"Builder",
"addMultiLanguageText",
"(",
"final",
"MultiLanguageText",
".",
"Builder",
"multiLanguageTextBuilder",
",",
"final",
"String",
"languageCode",
",",
"final",
"String",
"multiLanguageText",
")",
"{",
"for",
"(",
"... | Add a multiLanguageText to a multiLanguageTextBuilder by languageCode. If the multiLanguageText is already contained for the
language code nothing will be done. If the languageCode already exists and the multiLanguageText is not contained
it will be added to the end of the multiLanguageText list by this language code. If no entry for the languageCode
exists a new entry will be added and the multiLanguageText added as its first value.
@param multiLanguageTextBuilder the multiLanguageText builder to be updated
@param languageCode the languageCode for which the multiLanguageText is added
@param multiLanguageText the multiLanguageText to be added
@return the updated multiLanguageText builder | [
"Add",
"a",
"multiLanguageText",
"to",
"a",
"multiLanguageTextBuilder",
"by",
"languageCode",
".",
"If",
"the",
"multiLanguageText",
"is",
"already",
"contained",
"for",
"the",
"language",
"code",
"nothing",
"will",
"be",
"done",
".",
"If",
"the",
"languageCode",
... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MultiLanguageTextProcessor.java#L136-L154 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java | DatabaseUtils.concatenateWhere | public static String concatenateWhere(String a, String b) {
if (TextUtils.isEmpty(a)) {
return b;
}
if (TextUtils.isEmpty(b)) {
return a;
}
return "(" + a + ") AND (" + b + ")";
} | java | public static String concatenateWhere(String a, String b) {
if (TextUtils.isEmpty(a)) {
return b;
}
if (TextUtils.isEmpty(b)) {
return a;
}
return "(" + a + ") AND (" + b + ")";
} | [
"public",
"static",
"String",
"concatenateWhere",
"(",
"String",
"a",
",",
"String",
"b",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"a",
")",
")",
"{",
"return",
"b",
";",
"}",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"b",
")",
")"... | Concatenates two SQL WHERE clauses, handling empty or null values. | [
"Concatenates",
"two",
"SQL",
"WHERE",
"clauses",
"handling",
"empty",
"or",
"null",
"values",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L391-L400 |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/model/NumericRefinement.java | NumericRefinement.getOperatorCode | public static int getOperatorCode(String operatorName) {
switch (operatorName) {
case "lt":
return OPERATOR_LT;
case "le":
return OPERATOR_LE;
case "eq":
return OPERATOR_EQ;
case "ne":
return OPERATOR_NE;
case "ge":
return OPERATOR_GE;
case "gt":
return OPERATOR_GT;
default:
throw new IllegalStateException(String.format(ERROR_INVALID_NAME, operatorName));
}
} | java | public static int getOperatorCode(String operatorName) {
switch (operatorName) {
case "lt":
return OPERATOR_LT;
case "le":
return OPERATOR_LE;
case "eq":
return OPERATOR_EQ;
case "ne":
return OPERATOR_NE;
case "ge":
return OPERATOR_GE;
case "gt":
return OPERATOR_GT;
default:
throw new IllegalStateException(String.format(ERROR_INVALID_NAME, operatorName));
}
} | [
"public",
"static",
"int",
"getOperatorCode",
"(",
"String",
"operatorName",
")",
"{",
"switch",
"(",
"operatorName",
")",
"{",
"case",
"\"lt\"",
":",
"return",
"OPERATOR_LT",
";",
"case",
"\"le\"",
":",
"return",
"OPERATOR_LE",
";",
"case",
"\"eq\"",
":",
"... | Gets the {@link NumericRefinement#OPERATOR_GT operator} matching the given short name.
@param operatorName the short name of an operator.
@return the integer representation of this operator.
@throws IllegalStateException if operatorName is not a known operator name. | [
"Gets",
"the",
"{",
"@link",
"NumericRefinement#OPERATOR_GT",
"operator",
"}",
"matching",
"the",
"given",
"short",
"name",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/model/NumericRefinement.java#L56-L73 |
alkacon/opencms-core | src/org/opencms/configuration/CmsParameterConfiguration.java | CmsParameterConfiguration.getInteger | public int getInteger(String key, int defaultValue) {
Object value = m_configurationObjects.get(key);
if (value instanceof Integer) {
return ((Integer)value).intValue();
} else if (value instanceof String) {
Integer i = new Integer((String)value);
m_configurationObjects.put(key, i);
return i.intValue();
} else {
return defaultValue;
}
} | java | public int getInteger(String key, int defaultValue) {
Object value = m_configurationObjects.get(key);
if (value instanceof Integer) {
return ((Integer)value).intValue();
} else if (value instanceof String) {
Integer i = new Integer((String)value);
m_configurationObjects.put(key, i);
return i.intValue();
} else {
return defaultValue;
}
} | [
"public",
"int",
"getInteger",
"(",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"Object",
"value",
"=",
"m_configurationObjects",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"instanceof",
"Integer",
")",
"{",
"return",
"(",
"(",
"Int... | Returns the integer associated with the given parameter,
or the default value in case there is no integer value for this parameter.<p>
@param key the parameter to look up the value for
@param defaultValue the default value
@return the integer associated with the given parameter,
or the default value in case there is no integer value for this parameter | [
"Returns",
"the",
"integer",
"associated",
"with",
"the",
"given",
"parameter",
"or",
"the",
"default",
"value",
"in",
"case",
"there",
"is",
"no",
"integer",
"value",
"for",
"this",
"parameter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/configuration/CmsParameterConfiguration.java#L548-L563 |
wkgcass/Style | src/main/java/net/cassite/style/aggregation/MapFuncSup.java | MapFuncSup.forEach | public <R> R forEach(RFunc2<R, K, V> func) {
return forEach(Style.$(func));
} | java | public <R> R forEach(RFunc2<R, K, V> func) {
return forEach(Style.$(func));
} | [
"public",
"<",
"R",
">",
"R",
"forEach",
"(",
"RFunc2",
"<",
"R",
",",
"K",
",",
"V",
">",
"func",
")",
"{",
"return",
"forEach",
"(",
"Style",
".",
"$",
"(",
"func",
")",
")",
";",
"}"
] | define a function to deal with each entry in the map
@param func a function takes in each entry from map and returns
'last loop value'
@return return 'last loop value'.<br>
check
<a href="https://github.com/wkgcass/Style/">tutorial</a> for
more info about 'last loop value' | [
"define",
"a",
"function",
"to",
"deal",
"with",
"each",
"entry",
"in",
"the",
"map"
] | train | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/aggregation/MapFuncSup.java#L67-L69 |
DDTH/ddth-kafka | src/main/java/com/github/ddth/kafka/internal/KafkaHelper.java | KafkaHelper.buildKafkaProducerProps | public static Properties buildKafkaProducerProps(ProducerType type, String bootstrapServers) {
return buildKafkaProducerProps(type, bootstrapServers, null);
} | java | public static Properties buildKafkaProducerProps(ProducerType type, String bootstrapServers) {
return buildKafkaProducerProps(type, bootstrapServers, null);
} | [
"public",
"static",
"Properties",
"buildKafkaProducerProps",
"(",
"ProducerType",
"type",
",",
"String",
"bootstrapServers",
")",
"{",
"return",
"buildKafkaProducerProps",
"(",
"type",
",",
"bootstrapServers",
",",
"null",
")",
";",
"}"
] | Builds default producer's properties.
@param type
@param bootstrapServers
@return
@since 1.3.2 | [
"Builds",
"default",
"producer",
"s",
"properties",
"."
] | train | https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaHelper.java#L176-L178 |
borball/weixin-sdk | weixin-qydev/src/main/java/com/riversoft/weixin/qy/media/Materials.java | Materials.addMpNewsImage | public String addMpNewsImage(InputStream inputStream, String fileName) {
String url = WxEndpoint.get("url.mpnews.image.upload");
String response = wxClient.post(url, inputStream, fileName);
Map<String, Object> result = JsonMapper.defaultMapper().json2Map(response);
if (result.containsKey("url")) {
return result.get("url").toString();
} else {
logger.warn("mpnews image upload failed: {}", response);
throw new WxRuntimeException(999, response);
}
} | java | public String addMpNewsImage(InputStream inputStream, String fileName) {
String url = WxEndpoint.get("url.mpnews.image.upload");
String response = wxClient.post(url, inputStream, fileName);
Map<String, Object> result = JsonMapper.defaultMapper().json2Map(response);
if (result.containsKey("url")) {
return result.get("url").toString();
} else {
logger.warn("mpnews image upload failed: {}", response);
throw new WxRuntimeException(999, response);
}
} | [
"public",
"String",
"addMpNewsImage",
"(",
"InputStream",
"inputStream",
",",
"String",
"fileName",
")",
"{",
"String",
"url",
"=",
"WxEndpoint",
".",
"get",
"(",
"\"url.mpnews.image.upload\"",
")",
";",
"String",
"response",
"=",
"wxClient",
".",
"post",
"(",
... | 图文消息的content里面如果有图片,该图片需要使用本方法上传,图片仅支持jpg/png格式,大小必须在2MB以下,每天最多200张
@param inputStream 图片流
@param fileName 文件名
@return 图片的url, 可以在图文消息的content里面使用 | [
"图文消息的content里面如果有图片,该图片需要使用本方法上传,图片仅支持jpg",
"/",
"png格式,大小必须在2MB以下,每天最多200张"
] | train | https://github.com/borball/weixin-sdk/blob/32bf5e45cdd8d0d28074e83954e1ec62dcf25cb7/weixin-qydev/src/main/java/com/riversoft/weixin/qy/media/Materials.java#L126-L137 |
ben-manes/caffeine | jcache/src/main/java/com/github/benmanes/caffeine/jcache/management/JmxRegistration.java | JmxRegistration.unregisterMXBean | public static void unregisterMXBean(CacheProxy<?, ?> cache, MBeanType type) {
ObjectName objectName = getObjectName(cache, type);
unregister(objectName);
} | java | public static void unregisterMXBean(CacheProxy<?, ?> cache, MBeanType type) {
ObjectName objectName = getObjectName(cache, type);
unregister(objectName);
} | [
"public",
"static",
"void",
"unregisterMXBean",
"(",
"CacheProxy",
"<",
"?",
",",
"?",
">",
"cache",
",",
"MBeanType",
"type",
")",
"{",
"ObjectName",
"objectName",
"=",
"getObjectName",
"(",
"cache",
",",
"type",
")",
";",
"unregister",
"(",
"objectName",
... | Unregisters the JMX management bean for the cache.
@param cache the cache to unregister
@param type the mxbean type | [
"Unregisters",
"the",
"JMX",
"management",
"bean",
"for",
"the",
"cache",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/jcache/src/main/java/com/github/benmanes/caffeine/jcache/management/JmxRegistration.java#L60-L63 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/grid/GridList.java | GridList.addElement | public void addElement(int iTargetPosition, Object bookmark)
{
if (iTargetPosition >= m_iRecordListMax)
this.growAccessList(iTargetPosition);
if (iTargetPosition >= m_iRecordListEnd)
m_iRecordListEnd = iTargetPosition + 1; // New logical end
if (!this.validRecordIndex(iTargetPosition))
return; // This one doesn't belong in this list
int iArrayIndex = this.listToArrayIndex(iTargetPosition);
m_aRecords[iArrayIndex] = bookmark;
} | java | public void addElement(int iTargetPosition, Object bookmark)
{
if (iTargetPosition >= m_iRecordListMax)
this.growAccessList(iTargetPosition);
if (iTargetPosition >= m_iRecordListEnd)
m_iRecordListEnd = iTargetPosition + 1; // New logical end
if (!this.validRecordIndex(iTargetPosition))
return; // This one doesn't belong in this list
int iArrayIndex = this.listToArrayIndex(iTargetPosition);
m_aRecords[iArrayIndex] = bookmark;
} | [
"public",
"void",
"addElement",
"(",
"int",
"iTargetPosition",
",",
"Object",
"bookmark",
")",
"{",
"if",
"(",
"iTargetPosition",
">=",
"m_iRecordListMax",
")",
"this",
".",
"growAccessList",
"(",
"iTargetPosition",
")",
";",
"if",
"(",
"iTargetPosition",
">=",
... | Add this record's unique info to this recordset (If it falls into this list).
@param iTargetPosition The position to add the element at.
@param bookmark The bookmark to add. | [
"Add",
"this",
"record",
"s",
"unique",
"info",
"to",
"this",
"recordset",
"(",
"If",
"it",
"falls",
"into",
"this",
"list",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/grid/GridList.java#L49-L60 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.wrapIfMissing | public static String wrapIfMissing(final String str, final char wrapWith) {
if (isEmpty(str) || wrapWith == CharUtils.NUL) {
return str;
}
final StringBuilder builder = new StringBuilder(str.length() + 2);
if (str.charAt(0) != wrapWith) {
builder.append(wrapWith);
}
builder.append(str);
if (str.charAt(str.length() - 1) != wrapWith) {
builder.append(wrapWith);
}
return builder.toString();
} | java | public static String wrapIfMissing(final String str, final char wrapWith) {
if (isEmpty(str) || wrapWith == CharUtils.NUL) {
return str;
}
final StringBuilder builder = new StringBuilder(str.length() + 2);
if (str.charAt(0) != wrapWith) {
builder.append(wrapWith);
}
builder.append(str);
if (str.charAt(str.length() - 1) != wrapWith) {
builder.append(wrapWith);
}
return builder.toString();
} | [
"public",
"static",
"String",
"wrapIfMissing",
"(",
"final",
"String",
"str",
",",
"final",
"char",
"wrapWith",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"str",
")",
"||",
"wrapWith",
"==",
"CharUtils",
".",
"NUL",
")",
"{",
"return",
"str",
";",
"}",
"fina... | <p>
Wraps a string with a char if that char is missing from the start or end of the given string.
</p>
<pre>
StringUtils.wrap(null, *) = null
StringUtils.wrap("", *) = ""
StringUtils.wrap("ab", '\0') = "ab"
StringUtils.wrap("ab", 'x') = "xabx"
StringUtils.wrap("ab", '\'') = "'ab'"
StringUtils.wrap("\"ab\"", '\"') = "\"ab\""
StringUtils.wrap("/", '/') = "/"
StringUtils.wrap("a/b/c", '/') = "/a/b/c/"
StringUtils.wrap("/a/b/c", '/') = "/a/b/c/"
StringUtils.wrap("a/b/c/", '/') = "/a/b/c/"
</pre>
@param str
the string to be wrapped, may be {@code null}
@param wrapWith
the char that will wrap {@code str}
@return the wrapped string, or {@code null} if {@code str==null}
@since 3.5 | [
"<p",
">",
"Wraps",
"a",
"string",
"with",
"a",
"char",
"if",
"that",
"char",
"is",
"missing",
"from",
"the",
"start",
"or",
"end",
"of",
"the",
"given",
"string",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L9089-L9102 |
gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JesqueUtils.java | JesqueUtils.createKey | public static String createKey(final String namespace, final String... parts) {
return createKey(namespace, Arrays.asList(parts));
} | java | public static String createKey(final String namespace, final String... parts) {
return createKey(namespace, Arrays.asList(parts));
} | [
"public",
"static",
"String",
"createKey",
"(",
"final",
"String",
"namespace",
",",
"final",
"String",
"...",
"parts",
")",
"{",
"return",
"createKey",
"(",
"namespace",
",",
"Arrays",
".",
"asList",
"(",
"parts",
")",
")",
";",
"}"
] | Builds a namespaced Redis key with the given arguments.
@param namespace
the namespace to use
@param parts
the key parts to be joined
@return an assembled String key | [
"Builds",
"a",
"namespaced",
"Redis",
"key",
"with",
"the",
"given",
"arguments",
"."
] | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JesqueUtils.java#L94-L96 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/cache/impl/merge/policy/CacheMergePolicyProvider.java | CacheMergePolicyProvider.getMergePolicy | public Object getMergePolicy(String className) {
if (className == null) {
throw new InvalidConfigurationException("Class name is mandatory!");
}
try {
return policyProvider.getMergePolicy(className);
} catch (InvalidConfigurationException e) {
return getOrPutIfAbsent(mergePolicyMap, className, policyConstructorFunction);
}
} | java | public Object getMergePolicy(String className) {
if (className == null) {
throw new InvalidConfigurationException("Class name is mandatory!");
}
try {
return policyProvider.getMergePolicy(className);
} catch (InvalidConfigurationException e) {
return getOrPutIfAbsent(mergePolicyMap, className, policyConstructorFunction);
}
} | [
"public",
"Object",
"getMergePolicy",
"(",
"String",
"className",
")",
"{",
"if",
"(",
"className",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidConfigurationException",
"(",
"\"Class name is mandatory!\"",
")",
";",
"}",
"try",
"{",
"return",
"policyProvider",... | Returns an instance of a merge policy by its classname.
<p>
First tries to resolve the classname as {@link SplitBrainMergePolicy},
then as {@link com.hazelcast.cache.CacheMergePolicy}.
<p>
If no merge policy matches an {@link InvalidConfigurationException} is thrown.
@param className the classname of the given merge policy
@return an instance of the merge policy class
@throws InvalidConfigurationException if no matching merge policy class was found | [
"Returns",
"an",
"instance",
"of",
"a",
"merge",
"policy",
"by",
"its",
"classname",
".",
"<p",
">",
"First",
"tries",
"to",
"resolve",
"the",
"classname",
"as",
"{",
"@link",
"SplitBrainMergePolicy",
"}",
"then",
"as",
"{",
"@link",
"com",
".",
"hazelcast... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cache/impl/merge/policy/CacheMergePolicyProvider.java#L84-L93 |
groupby/api-java | src/main/java/com/groupbyinc/api/Query.java | Query.addBias | public Query addBias(String name, String content, Bias.Strength strength) {
biasing.getBiases().add(new Bias().setName(name).setContent(content).setStrength(strength));
return this;
} | java | public Query addBias(String name, String content, Bias.Strength strength) {
biasing.getBiases().add(new Bias().setName(name).setContent(content).setStrength(strength));
return this;
} | [
"public",
"Query",
"addBias",
"(",
"String",
"name",
",",
"String",
"content",
",",
"Bias",
".",
"Strength",
"strength",
")",
"{",
"biasing",
".",
"getBiases",
"(",
")",
".",
"add",
"(",
"new",
"Bias",
"(",
")",
".",
"setName",
"(",
"name",
")",
".",... | <code>
See {@link Query#setBiasing(Biasing)}. This is a convenience method to add an individual bias.
</code>
@param name
The name of the field to bias on
@param content
The value to bias
@param strength
The strength of the bias. Legal values are: "Absolute_Increase", "Strong_Increase", "Medium_Increase",
"Weak_Increase", "Leave_Unchanged", "Weak_Decrease", "Medium_Decrease", "Strong_Decrease", "Absolute_Decrease". | [
"<code",
">"
] | train | https://github.com/groupby/api-java/blob/257c4ed0777221e5e4ade3b29b9921300fac4e2e/src/main/java/com/groupbyinc/api/Query.java#L1434-L1437 |
mockito/mockito | src/main/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilter.java | StackTraceFilter.findSourceFile | public String findSourceFile(StackTraceElement[] target, String defaultValue) {
for (StackTraceElement e : target) {
if (CLEANER.isIn(e)) {
return e.getFileName();
}
}
return defaultValue;
} | java | public String findSourceFile(StackTraceElement[] target, String defaultValue) {
for (StackTraceElement e : target) {
if (CLEANER.isIn(e)) {
return e.getFileName();
}
}
return defaultValue;
} | [
"public",
"String",
"findSourceFile",
"(",
"StackTraceElement",
"[",
"]",
"target",
",",
"String",
"defaultValue",
")",
"{",
"for",
"(",
"StackTraceElement",
"e",
":",
"target",
")",
"{",
"if",
"(",
"CLEANER",
".",
"isIn",
"(",
"e",
")",
")",
"{",
"retur... | Finds the source file of the target stack trace.
Returns the default value if source file cannot be found. | [
"Finds",
"the",
"source",
"file",
"of",
"the",
"target",
"stack",
"trace",
".",
"Returns",
"the",
"default",
"value",
"if",
"source",
"file",
"cannot",
"be",
"found",
"."
] | train | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilter.java#L125-L132 |
attribyte/acp | src/main/java/org/attribyte/sql/pool/TypesafeConfig.java | TypesafeConfig.segmentFromConfig | static final ConnectionPoolSegment.Initializer segmentFromConfig(String poolName,
String segmentName,
final Config config,
ConnectionPoolSegment.Initializer initializer,
Map<String, JDBConnection> connectionMap) throws InitializationException {
initializer.setName(poolName + "." + segmentName);
initializer.setSize(getInt(config, "size", 1));
initializer.setCloseConcurrency(getInt(config, "closeConcurrency", 0));
initializer.setTestOnLogicalOpen(getString(config, "testOnLogicalOpen", "false").equalsIgnoreCase("true"));
initializer.setTestOnLogicalClose(getString(config, "testOnLogicalClose", "false").equalsIgnoreCase("true"));
String incompleteTransactionPolicy = getString(config, "incompleteTransactionPolicy");
initializer.setIncompleteTransactionOnClosePolicy(
ConnectionPoolConnection.IncompleteTransactionPolicy.fromString(incompleteTransactionPolicy, ConnectionPoolConnection.IncompleteTransactionPolicy.REPORT)
);
String openStatementPolicy = getString(config, "openStatementPolicy");
initializer.setOpenStatementOnClosePolicy(
ConnectionPoolConnection.OpenStatementPolicy.fromString(openStatementPolicy, ConnectionPoolConnection.OpenStatementPolicy.SILENT)
);
String forceRealClosePolicy = getString(config, "forceRealClosePolicy");
initializer.setForceRealClosePolicy(
ConnectionPoolConnection.ForceRealClosePolicy.fromString(forceRealClosePolicy, ConnectionPoolConnection.ForceRealClosePolicy.CONNECTION)
);
String activityTimeoutPolicy = getString(config, "activityTimeoutPolicy");
initializer.setActivityTimeoutPolicy(
ConnectionPoolConnection.ActivityTimeoutPolicy.fromString(activityTimeoutPolicy, ConnectionPoolConnection.ActivityTimeoutPolicy.LOG)
);
initializer.setCloseTimeLimitMillis(getMilliseconds(config, "closeTimeLimit"));
String connectionName = getString(config, "connectionName", "");
JDBConnection conn = null;
if(connectionName.length() > 0) {
conn = connectionMap.get(connectionName);
if(conn == null) {
throw new InitializationException("No connection defined with name '" + connectionName + "'");
}
}
if(conn == null && !initializer.hasConnection()) {
throw new InitializationException("A 'connectionName' must be specified for segment, '" + segmentName + "'");
} else if(conn != null) {
initializer.setConnection(conn);
}
initializer.setAcquireTimeout(getMilliseconds(config, "acquireTimeout"), TimeUnit.MILLISECONDS);
initializer.setActiveTimeout(getMilliseconds(config, "activeTimeout"), TimeUnit.MILLISECONDS);
initializer.setConnectionLifetime(getMilliseconds(config, "connectionLifetime"), TimeUnit.MILLISECONDS);
initializer.setIdleTimeBeforeShutdown(getMilliseconds(config, "idleTimeBeforeShutdown"), TimeUnit.MILLISECONDS);
initializer.setMinActiveTime(getMilliseconds(config, "minActiveTime"), TimeUnit.MILLISECONDS);
initializer.setMaxConcurrentReconnects(getInt(config, "reconnectConcurrency", 0));
initializer.setMaxReconnectDelay(getMilliseconds(config, "reconnectMaxWaitTime"), TimeUnit.MILLISECONDS);
initializer.setActiveTimeoutMonitorFrequency(getMilliseconds(config, "activeTimeoutMonitorFrequency"), TimeUnit.MILLISECONDS);
return initializer;
} | java | static final ConnectionPoolSegment.Initializer segmentFromConfig(String poolName,
String segmentName,
final Config config,
ConnectionPoolSegment.Initializer initializer,
Map<String, JDBConnection> connectionMap) throws InitializationException {
initializer.setName(poolName + "." + segmentName);
initializer.setSize(getInt(config, "size", 1));
initializer.setCloseConcurrency(getInt(config, "closeConcurrency", 0));
initializer.setTestOnLogicalOpen(getString(config, "testOnLogicalOpen", "false").equalsIgnoreCase("true"));
initializer.setTestOnLogicalClose(getString(config, "testOnLogicalClose", "false").equalsIgnoreCase("true"));
String incompleteTransactionPolicy = getString(config, "incompleteTransactionPolicy");
initializer.setIncompleteTransactionOnClosePolicy(
ConnectionPoolConnection.IncompleteTransactionPolicy.fromString(incompleteTransactionPolicy, ConnectionPoolConnection.IncompleteTransactionPolicy.REPORT)
);
String openStatementPolicy = getString(config, "openStatementPolicy");
initializer.setOpenStatementOnClosePolicy(
ConnectionPoolConnection.OpenStatementPolicy.fromString(openStatementPolicy, ConnectionPoolConnection.OpenStatementPolicy.SILENT)
);
String forceRealClosePolicy = getString(config, "forceRealClosePolicy");
initializer.setForceRealClosePolicy(
ConnectionPoolConnection.ForceRealClosePolicy.fromString(forceRealClosePolicy, ConnectionPoolConnection.ForceRealClosePolicy.CONNECTION)
);
String activityTimeoutPolicy = getString(config, "activityTimeoutPolicy");
initializer.setActivityTimeoutPolicy(
ConnectionPoolConnection.ActivityTimeoutPolicy.fromString(activityTimeoutPolicy, ConnectionPoolConnection.ActivityTimeoutPolicy.LOG)
);
initializer.setCloseTimeLimitMillis(getMilliseconds(config, "closeTimeLimit"));
String connectionName = getString(config, "connectionName", "");
JDBConnection conn = null;
if(connectionName.length() > 0) {
conn = connectionMap.get(connectionName);
if(conn == null) {
throw new InitializationException("No connection defined with name '" + connectionName + "'");
}
}
if(conn == null && !initializer.hasConnection()) {
throw new InitializationException("A 'connectionName' must be specified for segment, '" + segmentName + "'");
} else if(conn != null) {
initializer.setConnection(conn);
}
initializer.setAcquireTimeout(getMilliseconds(config, "acquireTimeout"), TimeUnit.MILLISECONDS);
initializer.setActiveTimeout(getMilliseconds(config, "activeTimeout"), TimeUnit.MILLISECONDS);
initializer.setConnectionLifetime(getMilliseconds(config, "connectionLifetime"), TimeUnit.MILLISECONDS);
initializer.setIdleTimeBeforeShutdown(getMilliseconds(config, "idleTimeBeforeShutdown"), TimeUnit.MILLISECONDS);
initializer.setMinActiveTime(getMilliseconds(config, "minActiveTime"), TimeUnit.MILLISECONDS);
initializer.setMaxConcurrentReconnects(getInt(config, "reconnectConcurrency", 0));
initializer.setMaxReconnectDelay(getMilliseconds(config, "reconnectMaxWaitTime"), TimeUnit.MILLISECONDS);
initializer.setActiveTimeoutMonitorFrequency(getMilliseconds(config, "activeTimeoutMonitorFrequency"), TimeUnit.MILLISECONDS);
return initializer;
} | [
"static",
"final",
"ConnectionPoolSegment",
".",
"Initializer",
"segmentFromConfig",
"(",
"String",
"poolName",
",",
"String",
"segmentName",
",",
"final",
"Config",
"config",
",",
"ConnectionPoolSegment",
".",
"Initializer",
"initializer",
",",
"Map",
"<",
"String",
... | Sets initializer properties from properties.
@param poolName The pool name.
@param segmentName The segment name.
@param config The config.
@param initializer An initializer.
@param connectionMap A map of connection vs. name.
@return The segment initializer.
@throws InitializationException if configuration is invalid. | [
"Sets",
"initializer",
"properties",
"from",
"properties",
"."
] | train | https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/TypesafeConfig.java#L244-L302 |
igniterealtime/Smack | smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java | OmemoService.hasSession | private boolean hasSession(OmemoDevice userDevice, OmemoDevice contactsDevice) {
return getOmemoStoreBackend().loadRawSession(userDevice, contactsDevice) != null;
} | java | private boolean hasSession(OmemoDevice userDevice, OmemoDevice contactsDevice) {
return getOmemoStoreBackend().loadRawSession(userDevice, contactsDevice) != null;
} | [
"private",
"boolean",
"hasSession",
"(",
"OmemoDevice",
"userDevice",
",",
"OmemoDevice",
"contactsDevice",
")",
"{",
"return",
"getOmemoStoreBackend",
"(",
")",
".",
"loadRawSession",
"(",
"userDevice",
",",
"contactsDevice",
")",
"!=",
"null",
";",
"}"
] | Return true, if the OmemoManager of userDevice has a session with the contactsDevice.
@param userDevice our OmemoDevice.
@param contactsDevice OmemoDevice of the contact.
@return true if userDevice has session with contactsDevice. | [
"Return",
"true",
"if",
"the",
"OmemoManager",
"of",
"userDevice",
"has",
"a",
"session",
"with",
"the",
"contactsDevice",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java#L868-L870 |
jbundle/jbundle | model/base/src/main/java/org/jbundle/model/util/DataConverters.java | DataConverters.convertObjectToDatatype | public static Object convertObjectToDatatype(Object objData, Class<?> classData, Object objDefault)
throws Exception
{
return DataConverters.convertObjectToDatatype(objData, classData, objDefault, -1);
} | java | public static Object convertObjectToDatatype(Object objData, Class<?> classData, Object objDefault)
throws Exception
{
return DataConverters.convertObjectToDatatype(objData, classData, objDefault, -1);
} | [
"public",
"static",
"Object",
"convertObjectToDatatype",
"(",
"Object",
"objData",
",",
"Class",
"<",
"?",
">",
"classData",
",",
"Object",
"objDefault",
")",
"throws",
"Exception",
"{",
"return",
"DataConverters",
".",
"convertObjectToDatatype",
"(",
"objData",
"... | Get this property from the map and convert it to the target class.
@param properties The map object to get the property from.
@param strKey The key of the property.
@param classData The target class to convert the property to.
@param objDefault The default value.
@return The data in the correct class. | [
"Get",
"this",
"property",
"from",
"the",
"map",
"and",
"convert",
"it",
"to",
"the",
"target",
"class",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/model/base/src/main/java/org/jbundle/model/util/DataConverters.java#L148-L152 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsADECacheSettings.java | CmsADECacheSettings.getIntValue | private int getIntValue(String str, int defaultValue) {
try {
int intValue = Integer.parseInt(str);
return (intValue > 0) ? intValue : defaultValue;
} catch (NumberFormatException e) {
// intentionally left blank
}
return defaultValue;
} | java | private int getIntValue(String str, int defaultValue) {
try {
int intValue = Integer.parseInt(str);
return (intValue > 0) ? intValue : defaultValue;
} catch (NumberFormatException e) {
// intentionally left blank
}
return defaultValue;
} | [
"private",
"int",
"getIntValue",
"(",
"String",
"str",
",",
"int",
"defaultValue",
")",
"{",
"try",
"{",
"int",
"intValue",
"=",
"Integer",
".",
"parseInt",
"(",
"str",
")",
";",
"return",
"(",
"intValue",
">",
"0",
")",
"?",
"intValue",
":",
"defaultV... | Turns a string into an int.<p>
@param str the string to be converted
@param defaultValue a default value to be returned in case the string could not be parsed or the parsed int value is <= 0
@return the int value of the string | [
"Turns",
"a",
"string",
"into",
"an",
"int",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsADECacheSettings.java#L162-L171 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagInclude.java | CmsJspTagInclude.addParameter | public static void addParameter(Map<String, String[]> parameters, String name, String value, boolean overwrite) {
// No null values allowed in parameters
if ((parameters == null) || (name == null) || (value == null)) {
return;
}
// Check if the parameter name (key) exists
if (parameters.containsKey(name) && (!overwrite)) {
// Yes: Check name values if value exists, if so do nothing, else add new value
String[] values = parameters.get(name);
String[] newValues = new String[values.length + 1];
System.arraycopy(values, 0, newValues, 0, values.length);
newValues[values.length] = value;
parameters.put(name, newValues);
} else {
// No: Add new parameter name / value pair
String[] values = new String[] {value};
parameters.put(name, values);
}
} | java | public static void addParameter(Map<String, String[]> parameters, String name, String value, boolean overwrite) {
// No null values allowed in parameters
if ((parameters == null) || (name == null) || (value == null)) {
return;
}
// Check if the parameter name (key) exists
if (parameters.containsKey(name) && (!overwrite)) {
// Yes: Check name values if value exists, if so do nothing, else add new value
String[] values = parameters.get(name);
String[] newValues = new String[values.length + 1];
System.arraycopy(values, 0, newValues, 0, values.length);
newValues[values.length] = value;
parameters.put(name, newValues);
} else {
// No: Add new parameter name / value pair
String[] values = new String[] {value};
parameters.put(name, values);
}
} | [
"public",
"static",
"void",
"addParameter",
"(",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"parameters",
",",
"String",
"name",
",",
"String",
"value",
",",
"boolean",
"overwrite",
")",
"{",
"// No null values allowed in parameters",
"if",
"(",
"(",
... | Adds parameters to a parameter Map that can be used for a http request.<p>
@param parameters the Map to add the parameters to
@param name the name to add
@param value the value to add
@param overwrite if <code>true</code>, a parameter in the map will be overwritten by
a parameter with the same name, otherwise the request will have multiple parameters
with the same name (which is possible in http requests) | [
"Adds",
"parameters",
"to",
"a",
"parameter",
"Map",
"that",
"can",
"be",
"used",
"for",
"a",
"http",
"request",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagInclude.java#L118-L138 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/publish/JmxMetricPoller.java | JmxMetricPoller.extractValues | private void extractValues(String path, Map<String, Object> values, CompositeData obj) {
for (String key : obj.getCompositeType().keySet()) {
String newPath = (path == null) ? key : path + "." + key;
Object value = obj.get(key);
if (value instanceof CompositeData) {
extractValues(newPath, values, (CompositeData) value);
} else if (value != null) {
values.put(newPath, value);
}
}
} | java | private void extractValues(String path, Map<String, Object> values, CompositeData obj) {
for (String key : obj.getCompositeType().keySet()) {
String newPath = (path == null) ? key : path + "." + key;
Object value = obj.get(key);
if (value instanceof CompositeData) {
extractValues(newPath, values, (CompositeData) value);
} else if (value != null) {
values.put(newPath, value);
}
}
} | [
"private",
"void",
"extractValues",
"(",
"String",
"path",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
",",
"CompositeData",
"obj",
")",
"{",
"for",
"(",
"String",
"key",
":",
"obj",
".",
"getCompositeType",
"(",
")",
".",
"keySet",
"(",
"... | Recursively extracts simple numeric values from composite data objects.
The map {@code values} will be populated with a path to the value as
the key and the simple object as the value. | [
"Recursively",
"extracts",
"simple",
"numeric",
"values",
"from",
"composite",
"data",
"objects",
".",
"The",
"map",
"{"
] | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/publish/JmxMetricPoller.java#L170-L180 |
h2oai/h2o-2 | src/main/java/hex/drf/TreeMeasuresCollector.java | TreeMeasuresCollector.collectVotes | public static TreeVotes collectVotes(CompressedTree[/*nclass || 1 for regression*/] tree, int nclasses, Frame f, int ncols, float rate, int variable) {
return new TreeMeasuresCollector(new CompressedTree[][] {tree}, nclasses, ncols, rate, variable).doAll(f).resultVotes();
} | java | public static TreeVotes collectVotes(CompressedTree[/*nclass || 1 for regression*/] tree, int nclasses, Frame f, int ncols, float rate, int variable) {
return new TreeMeasuresCollector(new CompressedTree[][] {tree}, nclasses, ncols, rate, variable).doAll(f).resultVotes();
} | [
"public",
"static",
"TreeVotes",
"collectVotes",
"(",
"CompressedTree",
"[",
"/*nclass || 1 for regression*/",
"]",
"tree",
",",
"int",
"nclasses",
",",
"Frame",
"f",
",",
"int",
"ncols",
",",
"float",
"rate",
",",
"int",
"variable",
")",
"{",
"return",
"new",... | /* For bulk scoring
public static TreeVotes collect(TreeModel tmodel, Frame f, int ncols, float rate, int variable) {
CompressedTree[][] trees = new CompressedTree[tmodel.ntrees()][];
for (int tidx = 0; tidx < tmodel.ntrees(); tidx++) trees[tidx] = tmodel.ctree(tidx);
return new TreeVotesCollector(trees, tmodel.nclasses(), ncols, rate, variable).doAll(f).result();
} | [
"/",
"*",
"For",
"bulk",
"scoring",
"public",
"static",
"TreeVotes",
"collect",
"(",
"TreeModel",
"tmodel",
"Frame",
"f",
"int",
"ncols",
"float",
"rate",
"int",
"variable",
")",
"{",
"CompressedTree",
"[]",
"[]",
"trees",
"=",
"new",
"CompressedTree",
"[",
... | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/drf/TreeMeasuresCollector.java#L126-L128 |
OpenHFT/Chronicle-Map | src/main/java/net/openhft/chronicle/set/ChronicleSetBuilder.java | ChronicleSetBuilder.entryOperations | public ChronicleSetBuilder<K> entryOperations(SetEntryOperations<K, ?> entryOperations) {
chronicleMapBuilder.entryOperations(new MapEntryOperations<K, DummyValue, Object>() {
@Override
public Object remove(@NotNull MapEntry<K, DummyValue> entry) {
//noinspection unchecked
return entryOperations.remove((SetEntry<K>) entry);
}
@Override
public Object insert(
@NotNull MapAbsentEntry<K, DummyValue> absentEntry, Data<DummyValue> value) {
//noinspection unchecked
return entryOperations.insert((SetAbsentEntry<K>) absentEntry);
}
});
return this;
} | java | public ChronicleSetBuilder<K> entryOperations(SetEntryOperations<K, ?> entryOperations) {
chronicleMapBuilder.entryOperations(new MapEntryOperations<K, DummyValue, Object>() {
@Override
public Object remove(@NotNull MapEntry<K, DummyValue> entry) {
//noinspection unchecked
return entryOperations.remove((SetEntry<K>) entry);
}
@Override
public Object insert(
@NotNull MapAbsentEntry<K, DummyValue> absentEntry, Data<DummyValue> value) {
//noinspection unchecked
return entryOperations.insert((SetAbsentEntry<K>) absentEntry);
}
});
return this;
} | [
"public",
"ChronicleSetBuilder",
"<",
"K",
">",
"entryOperations",
"(",
"SetEntryOperations",
"<",
"K",
",",
"?",
">",
"entryOperations",
")",
"{",
"chronicleMapBuilder",
".",
"entryOperations",
"(",
"new",
"MapEntryOperations",
"<",
"K",
",",
"DummyValue",
",",
... | Inject your SPI code around basic {@code ChronicleSet}'s operations with entries:
removing entries and inserting new entries.
<p>
<p>This affects behaviour of ordinary set.add(), set.remove(), calls, as well as removes
<i>during iterations</i>, updates during <i>remote calls</i> and
<i>internal replication operations</i>. | [
"Inject",
"your",
"SPI",
"code",
"around",
"basic",
"{"
] | train | https://github.com/OpenHFT/Chronicle-Map/blob/0b09733cc96302f96be4394a261699eeb021fe37/src/main/java/net/openhft/chronicle/set/ChronicleSetBuilder.java#L288-L304 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.