repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.buildGetPropertyExpression | public static MethodCallExpression buildGetPropertyExpression(final Expression objectExpression, final String propertyName, final ClassNode targetClassNode, final boolean useBooleanGetter) {
"""
Build static direct call to getter of a property
@param objectExpression
@param propertyName
@param targetClassNode... | java | public static MethodCallExpression buildGetPropertyExpression(final Expression objectExpression, final String propertyName, final ClassNode targetClassNode, final boolean useBooleanGetter) {
String methodName = (useBooleanGetter ? "is" : "get") + MetaClassHelper.capitalize(propertyName);
MethodCallExpre... | [
"public",
"static",
"MethodCallExpression",
"buildGetPropertyExpression",
"(",
"final",
"Expression",
"objectExpression",
",",
"final",
"String",
"propertyName",
",",
"final",
"ClassNode",
"targetClassNode",
",",
"final",
"boolean",
"useBooleanGetter",
")",
"{",
"String",... | Build static direct call to getter of a property
@param objectExpression
@param propertyName
@param targetClassNode
@param useBooleanGetter
@return The method call expression | [
"Build",
"static",
"direct",
"call",
"to",
"getter",
"of",
"a",
"property"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L1314-L1322 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/util/concurrent/Monitor.java | Monitor.waitFor | public boolean waitFor(Guard guard, long time, TimeUnit unit) throws InterruptedException {
"""
Waits for the guard to be satisfied. Waits at most the given time, and may be interrupted. May
be called only by a thread currently occupying this monitor.
@return whether the guard is now satisfied
@throws Interru... | java | public boolean waitFor(Guard guard, long time, TimeUnit unit) throws InterruptedException {
final long timeoutNanos = toSafeNanos(time, unit);
if (!((guard.monitor == this) & lock.isHeldByCurrentThread())) {
throw new IllegalMonitorStateException();
}
if (guard.isSatisfied()) {
return true;
... | [
"public",
"boolean",
"waitFor",
"(",
"Guard",
"guard",
",",
"long",
"time",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"final",
"long",
"timeoutNanos",
"=",
"toSafeNanos",
"(",
"time",
",",
"unit",
")",
";",
"if",
"(",
"!",
"(",
... | Waits for the guard to be satisfied. Waits at most the given time, and may be interrupted. May
be called only by a thread currently occupying this monitor.
@return whether the guard is now satisfied
@throws InterruptedException if interrupted while waiting | [
"Waits",
"for",
"the",
"guard",
"to",
"be",
"satisfied",
".",
"Waits",
"at",
"most",
"the",
"given",
"time",
"and",
"may",
"be",
"interrupted",
".",
"May",
"be",
"called",
"only",
"by",
"a",
"thread",
"currently",
"occupying",
"this",
"monitor",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/util/concurrent/Monitor.java#L762-L774 |
inkstand-io/scribble | scribble-jcr/src/main/java/io/inkstand/scribble/jcr/JCRAssert.java | JCRAssert.assertStringPropertyEquals | public static void assertStringPropertyEquals(final Node node, final String propertyName, final String actualValue)
throws RepositoryException {
"""
Asserts the equality of a property value of a node with an expected value
@param node
the node containing the property to be verified
@param property... | java | public static void assertStringPropertyEquals(final Node node, final String propertyName, final String actualValue)
throws RepositoryException {
assertTrue("Node " + node.getPath() + " has no property " + propertyName, node.hasProperty(propertyName));
final Property prop = node.getProperty(p... | [
"public",
"static",
"void",
"assertStringPropertyEquals",
"(",
"final",
"Node",
"node",
",",
"final",
"String",
"propertyName",
",",
"final",
"String",
"actualValue",
")",
"throws",
"RepositoryException",
"{",
"assertTrue",
"(",
"\"Node \"",
"+",
"node",
".",
"get... | Asserts the equality of a property value of a node with an expected value
@param node
the node containing the property to be verified
@param propertyName
the property name to be verified
@param actualValue
the actual value that should be compared to the propert node
@throws RepositoryException | [
"Asserts",
"the",
"equality",
"of",
"a",
"property",
"value",
"of",
"a",
"node",
"with",
"an",
"expected",
"value"
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/JCRAssert.java#L62-L68 |
ModeShape/modeshape | web/modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/model/RestRepositories.java | RestRepositories.addRepository | public Repository addRepository( String name,
HttpServletRequest request ) {
"""
Adds a repository to the list.
@param name a {@code non-null} string, the name of the repository.
@param request a {@link HttpServletRequest} instance
@return a {@link Repository} instance.
... | java | public Repository addRepository( String name,
HttpServletRequest request ) {
Repository repository = new Repository(name, request);
repositories.add(repository);
return repository;
} | [
"public",
"Repository",
"addRepository",
"(",
"String",
"name",
",",
"HttpServletRequest",
"request",
")",
"{",
"Repository",
"repository",
"=",
"new",
"Repository",
"(",
"name",
",",
"request",
")",
";",
"repositories",
".",
"add",
"(",
"repository",
")",
";"... | Adds a repository to the list.
@param name a {@code non-null} string, the name of the repository.
@param request a {@link HttpServletRequest} instance
@return a {@link Repository} instance. | [
"Adds",
"a",
"repository",
"to",
"the",
"list",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/model/RestRepositories.java#L52-L57 |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/SpiderSession.java | SpiderSession.deleteObject | public ObjectResult deleteObject(String tableName, String objID) {
"""
Delete the object with the given ID from the given table. This is a convenience
method that creates a {@link DBObjectBatch} consisting of a single {@link DBObject}
with the given ID and then calls {@link #deleteBatch(String, DBObjectBatch)}. ... | java | public ObjectResult deleteObject(String tableName, String objID) {
Utils.require(!Utils.isEmpty(tableName), "tableName");
Utils.require(!Utils.isEmpty(objID), "objID");
TableDefinition tableDef = m_appDef.getTableDef(tableName);
Utils.require(tableDef != null,
... | [
"public",
"ObjectResult",
"deleteObject",
"(",
"String",
"tableName",
",",
"String",
"objID",
")",
"{",
"Utils",
".",
"require",
"(",
"!",
"Utils",
".",
"isEmpty",
"(",
"tableName",
")",
",",
"\"tableName\"",
")",
";",
"Utils",
".",
"require",
"(",
"!",
... | Delete the object with the given ID from the given table. This is a convenience
method that creates a {@link DBObjectBatch} consisting of a single {@link DBObject}
with the given ID and then calls {@link #deleteBatch(String, DBObjectBatch)}. The
{@link ObjectResult} for the object ID is then returned. It is not an erro... | [
"Delete",
"the",
"object",
"with",
"the",
"given",
"ID",
"from",
"the",
"given",
"table",
".",
"This",
"is",
"a",
"convenience",
"method",
"that",
"creates",
"a",
"{",
"@link",
"DBObjectBatch",
"}",
"consisting",
"of",
"a",
"single",
"{",
"@link",
"DBObjec... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/SpiderSession.java#L188-L201 |
craftercms/deployer | src/main/java/org/craftercms/deployer/utils/ConfigUtils.java | ConfigUtils.getConfigurationsAt | @SuppressWarnings("unchecked")
public static List<HierarchicalConfiguration> getConfigurationsAt(HierarchicalConfiguration config,
String key) throws
DeployerConfigurationException {
"""
Returns the sub-configuration tree whose root ... | java | @SuppressWarnings("unchecked")
public static List<HierarchicalConfiguration> getConfigurationsAt(HierarchicalConfiguration config,
String key) throws
DeployerConfigurationException {
try {
return config.configurationsA... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"HierarchicalConfiguration",
">",
"getConfigurationsAt",
"(",
"HierarchicalConfiguration",
"config",
",",
"String",
"key",
")",
"throws",
"DeployerConfigurationException",
"{",
"try",
"... | Returns the sub-configuration tree whose root is the specified key.
@param config the configuration
@param key the key of the configuration tree
@return the sub-configuration tree, or null if not found
@throws DeployerConfigurationException if an error occurs | [
"Returns",
"the",
"sub",
"-",
"configuration",
"tree",
"whose",
"root",
"is",
"the",
"specified",
"key",
"."
] | train | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/ConfigUtils.java#L270-L279 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.restoreKeyAsync | public Observable<KeyBundle> restoreKeyAsync(String vaultBaseUrl, byte[] keyBundleBackup) {
"""
Restores a backed up key to a vault.
Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a... | java | public Observable<KeyBundle> restoreKeyAsync(String vaultBaseUrl, byte[] keyBundleBackup) {
return restoreKeyWithServiceResponseAsync(vaultBaseUrl, keyBundleBackup).map(new Func1<ServiceResponse<KeyBundle>, KeyBundle>() {
@Override
public KeyBundle call(ServiceResponse<KeyBundle> respons... | [
"public",
"Observable",
"<",
"KeyBundle",
">",
"restoreKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"byte",
"[",
"]",
"keyBundleBackup",
")",
"{",
"return",
"restoreKeyWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"keyBundleBackup",
")",
".",
"map",
"(",
... | Restores a backed up key to a vault.
Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its... | [
"Restores",
"a",
"backed",
"up",
"key",
"to",
"a",
"vault",
".",
"Imports",
"a",
"previously",
"backed",
"up",
"key",
"into",
"Azure",
"Key",
"Vault",
"restoring",
"the",
"key",
"its",
"key",
"identifier",
"attributes",
"and",
"access",
"control",
"policies"... | 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#L2080-L2087 |
GCRC/nunaliit | nunaliit2-multimedia/src/main/java/ca/carleton/gcrc/olkit/multimedia/apachePDFBox/imageio/ImageIOUtil.java | ImageIOUtil.getOrCreateChildNode | private static IIOMetadataNode getOrCreateChildNode(IIOMetadataNode parentNode, String name) {
"""
Gets the named child node, or creates and attaches it.
@param parentNode the parent node
@param name name of the child node
@return the existing or just created child node
"""
NodeList nodeList = p... | java | private static IIOMetadataNode getOrCreateChildNode(IIOMetadataNode parentNode, String name)
{
NodeList nodeList = parentNode.getElementsByTagName(name);
if (nodeList.getLength() > 0)
{
return (IIOMetadataNode) nodeList.item(0);
}
IIOMetadataNode childNode = new I... | [
"private",
"static",
"IIOMetadataNode",
"getOrCreateChildNode",
"(",
"IIOMetadataNode",
"parentNode",
",",
"String",
"name",
")",
"{",
"NodeList",
"nodeList",
"=",
"parentNode",
".",
"getElementsByTagName",
"(",
"name",
")",
";",
"if",
"(",
"nodeList",
".",
"getLe... | Gets the named child node, or creates and attaches it.
@param parentNode the parent node
@param name name of the child node
@return the existing or just created child node | [
"Gets",
"the",
"named",
"child",
"node",
"or",
"creates",
"and",
"attaches",
"it",
"."
] | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-multimedia/src/main/java/ca/carleton/gcrc/olkit/multimedia/apachePDFBox/imageio/ImageIOUtil.java#L336-L346 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java | SARLProjectConfigurator.addSarlNatures | public static IStatus addSarlNatures(IProject project, IProgressMonitor monitor) {
"""
Add the SARL natures to the given project.
@param project the project.
@param monitor the monitor.
@return the status if the operation.
"""
return addNatures(project, monitor, getSarlNatures());
} | java | public static IStatus addSarlNatures(IProject project, IProgressMonitor monitor) {
return addNatures(project, monitor, getSarlNatures());
} | [
"public",
"static",
"IStatus",
"addSarlNatures",
"(",
"IProject",
"project",
",",
"IProgressMonitor",
"monitor",
")",
"{",
"return",
"addNatures",
"(",
"project",
",",
"monitor",
",",
"getSarlNatures",
"(",
")",
")",
";",
"}"
] | Add the SARL natures to the given project.
@param project the project.
@param monitor the monitor.
@return the status if the operation. | [
"Add",
"the",
"SARL",
"natures",
"to",
"the",
"given",
"project",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java#L760-L762 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.hasAnnotation | public static <T extends Tree> Matcher<T> hasAnnotation(
final Class<? extends Annotation> inputClass) {
"""
Determines whether an expression has an annotation of the given class. This includes
annotations inherited from superclasses due to @Inherited.
@param inputClass The class of the annotation to loo... | java | public static <T extends Tree> Matcher<T> hasAnnotation(
final Class<? extends Annotation> inputClass) {
return new Matcher<T>() {
@Override
public boolean matches(T tree, VisitorState state) {
return ASTHelpers.hasAnnotation(ASTHelpers.getDeclaredSymbol(tree), inputClass, state);
}
... | [
"public",
"static",
"<",
"T",
"extends",
"Tree",
">",
"Matcher",
"<",
"T",
">",
"hasAnnotation",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"inputClass",
")",
"{",
"return",
"new",
"Matcher",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Ov... | Determines whether an expression has an annotation of the given class. This includes
annotations inherited from superclasses due to @Inherited.
@param inputClass The class of the annotation to look for (e.g, Produces.class). | [
"Determines",
"whether",
"an",
"expression",
"has",
"an",
"annotation",
"of",
"the",
"given",
"class",
".",
"This",
"includes",
"annotations",
"inherited",
"from",
"superclasses",
"due",
"to",
"@Inherited",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L826-L834 |
hawkular/hawkular-agent | hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/inventory/ConnectionData.java | ConnectionData.createUri | private static URI createUri(String protocol, String host, int port) {
"""
A convenience method to create a new {@link URI} out of a protocol, host and port, hiding the
{@link URISyntaxException} behind a {@link RuntimeException}.
@param protocol the protocol such as http
@param host hostname or IP address
@... | java | private static URI createUri(String protocol, String host, int port) {
try {
return new URI(protocol, null, host, port, null, null, null);
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
} | [
"private",
"static",
"URI",
"createUri",
"(",
"String",
"protocol",
",",
"String",
"host",
",",
"int",
"port",
")",
"{",
"try",
"{",
"return",
"new",
"URI",
"(",
"protocol",
",",
"null",
",",
"host",
",",
"port",
",",
"null",
",",
"null",
",",
"null"... | A convenience method to create a new {@link URI} out of a protocol, host and port, hiding the
{@link URISyntaxException} behind a {@link RuntimeException}.
@param protocol the protocol such as http
@param host hostname or IP address
@param port port number
@return a new {@link URI} | [
"A",
"convenience",
"method",
"to",
"create",
"a",
"new",
"{",
"@link",
"URI",
"}",
"out",
"of",
"a",
"protocol",
"host",
"and",
"port",
"hiding",
"the",
"{",
"@link",
"URISyntaxException",
"}",
"behind",
"a",
"{",
"@link",
"RuntimeException",
"}",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/inventory/ConnectionData.java#L39-L45 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.updateAsync | public Observable<VirtualMachineScaleSetInner> updateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) {
"""
Update a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set to create or update.
@pa... | java | public Observable<VirtualMachineScaleSetInner> updateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) {
return updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, parameters).map(new Func1<ServiceResponse<VirtualMachineScaleSetInner>, VirtualMachineSc... | [
"public",
"Observable",
"<",
"VirtualMachineScaleSetInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"VirtualMachineScaleSetUpdate",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupNam... | Update a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set to create or update.
@param parameters The scale set object.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Update",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L404-L411 |
h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/algos/deeplearning/DeeplearningMojoModel.java | DeeplearningMojoModel.score0 | @Override
public final double[] score0(double[] dataRow, double offset, double[] preds) {
"""
*
This method will be derived from the scoring/prediction function of deeplearning model itself. However,
we followed closely what is being done in deepwater mojo. The variable offset is not used.
@param dataRow
@... | java | @Override
public final double[] score0(double[] dataRow, double offset, double[] preds) {
assert(dataRow != null) : "doubles are null"; // check to make sure data is not null
double[] neuronsInput = new double[_units[0]]; // store inputs into the neural network
double[] neuronsOutput; // save output from... | [
"@",
"Override",
"public",
"final",
"double",
"[",
"]",
"score0",
"(",
"double",
"[",
"]",
"dataRow",
",",
"double",
"offset",
",",
"double",
"[",
"]",
"preds",
")",
"{",
"assert",
"(",
"dataRow",
"!=",
"null",
")",
":",
"\"doubles are null\"",
";",
"/... | *
This method will be derived from the scoring/prediction function of deeplearning model itself. However,
we followed closely what is being done in deepwater mojo. The variable offset is not used.
@param dataRow
@param offset
@param preds
@return | [
"*",
"This",
"method",
"will",
"be",
"derived",
"from",
"the",
"scoring",
"/",
"prediction",
"function",
"of",
"deeplearning",
"model",
"itself",
".",
"However",
"we",
"followed",
"closely",
"what",
"is",
"being",
"done",
"in",
"deepwater",
"mojo",
".",
"The... | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/algos/deeplearning/DeeplearningMojoModel.java#L60-L80 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Document.java | Document.addProducer | public boolean addProducer() {
"""
Adds the producer to a Document.
@return <CODE>true</CODE> if successful, <CODE>false</CODE> otherwise
"""
try {
return add(new Meta(Element.PRODUCER, getVersion()));
} catch (DocumentException de) {
throw new ExceptionConverter(de);
... | java | public boolean addProducer() {
try {
return add(new Meta(Element.PRODUCER, getVersion()));
} catch (DocumentException de) {
throw new ExceptionConverter(de);
}
} | [
"public",
"boolean",
"addProducer",
"(",
")",
"{",
"try",
"{",
"return",
"add",
"(",
"new",
"Meta",
"(",
"Element",
".",
"PRODUCER",
",",
"getVersion",
"(",
")",
")",
")",
";",
"}",
"catch",
"(",
"DocumentException",
"de",
")",
"{",
"throw",
"new",
"... | Adds the producer to a Document.
@return <CODE>true</CODE> if successful, <CODE>false</CODE> otherwise | [
"Adds",
"the",
"producer",
"to",
"a",
"Document",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Document.java#L606-L612 |
leancloud/java-sdk-all | core/src/main/java/cn/leancloud/AVACL.java | AVACL.setReadAccess | public void setReadAccess(String userId, boolean allowed) {
"""
Set whether the given user id is allowed to read this object.
"""
if (StringUtil.isEmpty(userId)) {
throw new IllegalArgumentException("cannot setRead/WriteAccess for null userId");
}
boolean writePermission = getWriteAccess(user... | java | public void setReadAccess(String userId, boolean allowed) {
if (StringUtil.isEmpty(userId)) {
throw new IllegalArgumentException("cannot setRead/WriteAccess for null userId");
}
boolean writePermission = getWriteAccess(userId);
setPermissionsIfNonEmpty(userId, allowed, writePermission);
} | [
"public",
"void",
"setReadAccess",
"(",
"String",
"userId",
",",
"boolean",
"allowed",
")",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"userId",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"cannot setRead/WriteAccess for null userId\"",... | Set whether the given user id is allowed to read this object. | [
"Set",
"whether",
"the",
"given",
"user",
"id",
"is",
"allowed",
"to",
"read",
"this",
"object",
"."
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/core/src/main/java/cn/leancloud/AVACL.java#L169-L175 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/interestrate/products/components/ExposureEstimator.java | ExposureEstimator.getValue | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
"""
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value c... | java | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
final RandomVariable one = model.getRandomVariableForConstant(1.0);
final RandomVariable zero = model.getRandomVariableForConstant(0.0);
RandomVariable values = underlying.ge... | [
"@",
"Override",
"public",
"RandomVariable",
"getValue",
"(",
"double",
"evaluationTime",
",",
"LIBORModelMonteCarloSimulationModel",
"model",
")",
"throws",
"CalculationException",
"{",
"final",
"RandomVariable",
"one",
"=",
"model",
".",
"getRandomVariableForConstant",
... | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
Cashflows prior evaluationTime... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/products/components/ExposureEstimator.java#L77-L117 |
bazaarvoice/emodb | common/zookeeper/src/main/java/com/bazaarvoice/emodb/common/zookeeper/Sync.java | Sync.synchronousSync | public static boolean synchronousSync(CuratorFramework curator, Duration timeout) {
"""
Performs a blocking sync operation. Returns true if the sync completed normally, false if it timed out or
was interrupted.
"""
try {
// Curator sync() is always a background operation. Use a latch to ... | java | public static boolean synchronousSync(CuratorFramework curator, Duration timeout) {
try {
// Curator sync() is always a background operation. Use a latch to block until it finishes.
final CountDownLatch latch = new CountDownLatch(1);
curator.sync().inBackground(new Backgroun... | [
"public",
"static",
"boolean",
"synchronousSync",
"(",
"CuratorFramework",
"curator",
",",
"Duration",
"timeout",
")",
"{",
"try",
"{",
"// Curator sync() is always a background operation. Use a latch to block until it finishes.",
"final",
"CountDownLatch",
"latch",
"=",
"new"... | Performs a blocking sync operation. Returns true if the sync completed normally, false if it timed out or
was interrupted. | [
"Performs",
"a",
"blocking",
"sync",
"operation",
".",
"Returns",
"true",
"if",
"the",
"sync",
"completed",
"normally",
"false",
"if",
"it",
"timed",
"out",
"or",
"was",
"interrupted",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/zookeeper/src/main/java/com/bazaarvoice/emodb/common/zookeeper/Sync.java#L18-L38 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java | XsdAsmInterfaces.addAttributeGroup | private void addAttributeGroup(XsdAttributeGroup attributeGroup) {
"""
Adds information about the attribute group interface to the attributeGroupInterfaces variable.
@param attributeGroup The attributeGroup to add.
"""
String interfaceName = firstToUpper(attributeGroup.getName());
if (!attrib... | java | private void addAttributeGroup(XsdAttributeGroup attributeGroup) {
String interfaceName = firstToUpper(attributeGroup.getName());
if (!attributeGroupInterfaces.containsKey(interfaceName)){
List<XsdAttribute> ownElements = attributeGroup.getXsdElements()
.filter(attribute... | [
"private",
"void",
"addAttributeGroup",
"(",
"XsdAttributeGroup",
"attributeGroup",
")",
"{",
"String",
"interfaceName",
"=",
"firstToUpper",
"(",
"attributeGroup",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"!",
"attributeGroupInterfaces",
".",
"containsKey",
... | Adds information about the attribute group interface to the attributeGroupInterfaces variable.
@param attributeGroup The attributeGroup to add. | [
"Adds",
"information",
"about",
"the",
"attribute",
"group",
"interface",
"to",
"the",
"attributeGroupInterfaces",
"variable",
"."
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java#L275-L291 |
apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/CompileStack.java | CompileStack.defineTemporaryVariable | public int defineTemporaryVariable(String name, ClassNode node, boolean store) {
"""
creates a temporary variable.
@param name defines the name
@param node defines the node
@param store defines if the top-level argument of the stack should be stored
@return the index used for this temporary variable
"""
... | java | public int defineTemporaryVariable(String name, ClassNode node, boolean store) {
BytecodeVariable answer = defineVar(name, node, false, false);
temporaryVariables.addFirst(answer); // TRICK: we add at the beginning so when we find for remove or get we always have the last one
usedVariables.remov... | [
"public",
"int",
"defineTemporaryVariable",
"(",
"String",
"name",
",",
"ClassNode",
"node",
",",
"boolean",
"store",
")",
"{",
"BytecodeVariable",
"answer",
"=",
"defineVar",
"(",
"name",
",",
"node",
",",
"false",
",",
"false",
")",
";",
"temporaryVariables"... | creates a temporary variable.
@param name defines the name
@param node defines the node
@param store defines if the top-level argument of the stack should be stored
@return the index used for this temporary variable | [
"creates",
"a",
"temporary",
"variable",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/CompileStack.java#L316-L324 |
eurekaclinical/eurekaclinical-standard-apis | src/main/java/org/eurekaclinical/standardapis/props/EurekaClinicalProperties.java | EurekaClinicalProperties.getValue | protected final String getValue(final String propertyName, String defaultValue) {
"""
Returns the String value of the given property name, or the given default
if the given property name does not exist.
@param propertyName The name of the property to fetch a value for.
@param defaultValue The default value to... | java | protected final String getValue(final String propertyName, String defaultValue) {
String value = getValue(propertyName);
if (value == null) {
if (defaultValue == null) {
LOGGER.warn(
"Property '{}' is not specified in "
+ getCla... | [
"protected",
"final",
"String",
"getValue",
"(",
"final",
"String",
"propertyName",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getValue",
"(",
"propertyName",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"if",
"(",
"defaultV... | Returns the String value of the given property name, or the given default
if the given property name does not exist.
@param propertyName The name of the property to fetch a value for.
@param defaultValue The default value to return if the property name does
not exist.
@return A string containing either the value of th... | [
"Returns",
"the",
"String",
"value",
"of",
"the",
"given",
"property",
"name",
"or",
"the",
"given",
"default",
"if",
"the",
"given",
"property",
"name",
"does",
"not",
"exist",
"."
] | train | https://github.com/eurekaclinical/eurekaclinical-standard-apis/blob/690036dde82a4f2c2106d32403cdf1c713429377/src/main/java/org/eurekaclinical/standardapis/props/EurekaClinicalProperties.java#L164-L176 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_availableFarmProbes_GET | public ArrayList<OvhFarmAvailableProbe> serviceName_availableFarmProbes_GET(String serviceName) throws IOException {
"""
Available farm probes for health checks
REST: GET /ipLoadbalancing/{serviceName}/availableFarmProbes
@param serviceName [required] The internal name of your IP load balancing
"""
Strin... | java | public ArrayList<OvhFarmAvailableProbe> serviceName_availableFarmProbes_GET(String serviceName) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/availableFarmProbes";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t5)... | [
"public",
"ArrayList",
"<",
"OvhFarmAvailableProbe",
">",
"serviceName_availableFarmProbes_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/availableFarmProbes\"",
";",
"StringBuilder",
"sb",
"=",... | Available farm probes for health checks
REST: GET /ipLoadbalancing/{serviceName}/availableFarmProbes
@param serviceName [required] The internal name of your IP load balancing | [
"Available",
"farm",
"probes",
"for",
"health",
"checks"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L710-L715 |
betfair/cougar | baseline/baseline-app/src/main/java/com/betfair/cougar/baseline/BaselineServiceImpl.java | BaselineServiceImpl.subscribeToTimeTick | @Override
public void subscribeToTimeTick(ExecutionContext ctx, Object[] args, ExecutionObserver executionObserver) {
"""
Please note that this Service method is called by the Execution Venue to establish a communication
channel from the transport to the Application to publish events. In essence, the transpo... | java | @Override
public void subscribeToTimeTick(ExecutionContext ctx, Object[] args, ExecutionObserver executionObserver) {
if (getEventTransportIdentity(ctx).getPrincipal().getName().equals(SONIC_TRANSPORT_INSTANCE_ONE)) {
this.timeTickPublishingObserver = executionObserver;
}
} | [
"@",
"Override",
"public",
"void",
"subscribeToTimeTick",
"(",
"ExecutionContext",
"ctx",
",",
"Object",
"[",
"]",
"args",
",",
"ExecutionObserver",
"executionObserver",
")",
"{",
"if",
"(",
"getEventTransportIdentity",
"(",
"ctx",
")",
".",
"getPrincipal",
"(",
... | Please note that this Service method is called by the Execution Venue to establish a communication
channel from the transport to the Application to publish events. In essence, the transport subscribes
to the app, so this method is called once for each publisher. The application should hold onto the
passed in observer... | [
"Please",
"note",
"that",
"this",
"Service",
"method",
"is",
"called",
"by",
"the",
"Execution",
"Venue",
"to",
"establish",
"a",
"communication",
"channel",
"from",
"the",
"transport",
"to",
"the",
"Application",
"to",
"publish",
"events",
".",
"In",
"essence... | train | https://github.com/betfair/cougar/blob/08d1fe338fbd0e8572a9c2305bb5796402d5b1f5/baseline/baseline-app/src/main/java/com/betfair/cougar/baseline/BaselineServiceImpl.java#L1913-L1918 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.readGroup | public CmsGroup readGroup(CmsRequestContext context, CmsUUID groupId) throws CmsException {
"""
Reads a group based on its id.<p>
@param context the current request context
@param groupId the id of the group that is to be read
@return the requested group
@throws CmsException if operation was not successf... | java | public CmsGroup readGroup(CmsRequestContext context, CmsUUID groupId) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
CmsGroup result = null;
try {
result = m_driverManager.readGroup(dbc, groupId);
} catch (Exception e) {
dbc.re... | [
"public",
"CmsGroup",
"readGroup",
"(",
"CmsRequestContext",
"context",
",",
"CmsUUID",
"groupId",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"CmsGroup",
"result",
"=",
"null... | Reads a group based on its id.<p>
@param context the current request context
@param groupId the id of the group that is to be read
@return the requested group
@throws CmsException if operation was not successful | [
"Reads",
"a",
"group",
"based",
"on",
"its",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L4350-L4362 |
i-net-software/jlessc | src/com/inet/lib/less/CssMediaOutput.java | CssMediaOutput.startBlock | void startBlock( String[] selectors , StringBuilder output ) {
"""
Start a block inside the media
@param selectors
the selectors
@param output
a buffer for the content of the rule.
"""
this.results.add( new CssRuleOutput( selectors, output, isReference ) );
} | java | void startBlock( String[] selectors , StringBuilder output ) {
this.results.add( new CssRuleOutput( selectors, output, isReference ) );
} | [
"void",
"startBlock",
"(",
"String",
"[",
"]",
"selectors",
",",
"StringBuilder",
"output",
")",
"{",
"this",
".",
"results",
".",
"add",
"(",
"new",
"CssRuleOutput",
"(",
"selectors",
",",
"output",
",",
"isReference",
")",
")",
";",
"}"
] | Start a block inside the media
@param selectors
the selectors
@param output
a buffer for the content of the rule. | [
"Start",
"a",
"block",
"inside",
"the",
"media"
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/CssMediaOutput.java#L107-L109 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.getBuildVariable | public GitlabBuildVariable getBuildVariable(GitlabProject project, String key)
throws IOException {
"""
Gets build variable associated with a project and key.
@param project The project associated with the variable.
@return A variable.
@throws IOException on gitlab api call error
"""
r... | java | public GitlabBuildVariable getBuildVariable(GitlabProject project, String key)
throws IOException {
return getBuildVariable(project.getId(), key);
} | [
"public",
"GitlabBuildVariable",
"getBuildVariable",
"(",
"GitlabProject",
"project",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"return",
"getBuildVariable",
"(",
"project",
".",
"getId",
"(",
")",
",",
"key",
")",
";",
"}"
] | Gets build variable associated with a project and key.
@param project The project associated with the variable.
@return A variable.
@throws IOException on gitlab api call error | [
"Gets",
"build",
"variable",
"associated",
"with",
"a",
"project",
"and",
"key",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3661-L3664 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CfCodeGen.java | CfCodeGen.writeConnection | private void writeConnection(Definition def, Writer out, int indent) throws IOException {
"""
Output Connection method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException
"""
writeWithIndent(out, indent, "/** \n");
writeWithIndent(out, inde... | java | private void writeConnection(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/** \n");
writeWithIndent(out, indent, " * Get connection from factory\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent,
" * @return " + de... | [
"private",
"void",
"writeConnection",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/** \\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"in... | Output Connection method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"Connection",
"method"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CfCodeGen.java#L131-L151 |
infinispan/infinispan | core/src/main/java/org/infinispan/xsite/BackupReceiverRepositoryImpl.java | BackupReceiverRepositoryImpl.getBackupReceiver | @Override
public BackupReceiver getBackupReceiver(String remoteSite, String remoteCache) {
"""
Returns the local cache defined as backup for the provided remote (site, cache) combo, or throws an
exception if no such site is defined.
<p/>
Also starts the cache if not already started; that is because the cache... | java | @Override
public BackupReceiver getBackupReceiver(String remoteSite, String remoteCache) {
SiteCachePair toLookFor = new SiteCachePair(remoteCache, remoteSite);
BackupReceiver backupManager = backupReceivers.get(toLookFor);
if (backupManager != null) return backupManager;
//check the default... | [
"@",
"Override",
"public",
"BackupReceiver",
"getBackupReceiver",
"(",
"String",
"remoteSite",
",",
"String",
"remoteCache",
")",
"{",
"SiteCachePair",
"toLookFor",
"=",
"new",
"SiteCachePair",
"(",
"remoteCache",
",",
"remoteSite",
")",
";",
"BackupReceiver",
"back... | Returns the local cache defined as backup for the provided remote (site, cache) combo, or throws an
exception if no such site is defined.
<p/>
Also starts the cache if not already started; that is because the cache is needed for update after this method
is invoked. | [
"Returns",
"the",
"local",
"cache",
"defined",
"as",
"backup",
"for",
"the",
"provided",
"remote",
"(",
"site",
"cache",
")",
"combo",
"or",
"throws",
"an",
"exception",
"if",
"no",
"such",
"site",
"is",
"defined",
".",
"<p",
"/",
">",
"Also",
"starts",
... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/xsite/BackupReceiverRepositoryImpl.java#L63-L95 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.getAll | public <C extends Model> LazyList<C> getAll(Class<C> clazz) {
"""
This methods supports one to many, many to many relationships as well as polymorphic associations.
<p></p>
In case of one to many, the <code>clazz</code> must be a class of a child model, and it will return a
collection of all children.
<p></p>... | java | public <C extends Model> LazyList<C> getAll(Class<C> clazz) {
List<Model> children = cachedChildren.get(clazz);
if(children != null){
return (LazyList<C>) children;
}
// String tableName = Registry.instance().getTableName(clazz);
// if(tableName == null) throw new Ille... | [
"public",
"<",
"C",
"extends",
"Model",
">",
"LazyList",
"<",
"C",
">",
"getAll",
"(",
"Class",
"<",
"C",
">",
"clazz",
")",
"{",
"List",
"<",
"Model",
">",
"children",
"=",
"cachedChildren",
".",
"get",
"(",
"clazz",
")",
";",
"if",
"(",
"children... | This methods supports one to many, many to many relationships as well as polymorphic associations.
<p></p>
In case of one to many, the <code>clazz</code> must be a class of a child model, and it will return a
collection of all children.
<p></p>
In case of many to many, the <code>clazz</code> must be a class of a anot... | [
"This",
"methods",
"supports",
"one",
"to",
"many",
"many",
"to",
"many",
"relationships",
"as",
"well",
"as",
"polymorphic",
"associations",
".",
"<p",
">",
"<",
"/",
"p",
">",
"In",
"case",
"of",
"one",
"to",
"many",
"the",
"<code",
">",
"clazz<",
"/... | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L1872-L1882 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java | PatternBox.bindsTo | public static Pattern bindsTo() {
"""
Finds two Protein that appear together in a Complex.
@return the pattern
"""
Pattern p = new Pattern(ProteinReference.class, "first PR");
p.add(erToPE(), "first PR", "first simple PE");
p.add(linkToComplex(), "first simple PE", "Complex");
p.add(new Type(Complex.c... | java | public static Pattern bindsTo()
{
Pattern p = new Pattern(ProteinReference.class, "first PR");
p.add(erToPE(), "first PR", "first simple PE");
p.add(linkToComplex(), "first simple PE", "Complex");
p.add(new Type(Complex.class), "Complex");
p.add(linkToSpecific(), "Complex", "second simple PE");
p.add(peToE... | [
"public",
"static",
"Pattern",
"bindsTo",
"(",
")",
"{",
"Pattern",
"p",
"=",
"new",
"Pattern",
"(",
"ProteinReference",
".",
"class",
",",
"\"first PR\"",
")",
";",
"p",
".",
"add",
"(",
"erToPE",
"(",
")",
",",
"\"first PR\"",
",",
"\"first simple PE\"",... | Finds two Protein that appear together in a Complex.
@return the pattern | [
"Finds",
"two",
"Protein",
"that",
"appear",
"together",
"in",
"a",
"Complex",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L861-L871 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java | XMLEmitter.onText | public void onText (@Nonnull final char [] aText,
@Nonnegative final int nOfs,
@Nonnegative final int nLen,
final boolean bEscape) {
"""
Text node.
@param aText
The contained text array
@param nOfs
Offset into the array where to start
@param ... | java | public void onText (@Nonnull final char [] aText,
@Nonnegative final int nOfs,
@Nonnegative final int nLen,
final boolean bEscape)
{
if (bEscape)
_appendMasked (EXMLCharMode.TEXT, aText, nOfs, nLen);
else
_append (aText, nOfs, nLen)... | [
"public",
"void",
"onText",
"(",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aText",
",",
"@",
"Nonnegative",
"final",
"int",
"nOfs",
",",
"@",
"Nonnegative",
"final",
"int",
"nLen",
",",
"final",
"boolean",
"bEscape",
")",
"{",
"if",
"(",
"bEscape",
"... | Text node.
@param aText
The contained text array
@param nOfs
Offset into the array where to start
@param nLen
Number of chars to use, starting from the provided offset.
@param bEscape
If <code>true</code> the text should be XML masked (the default),
<code>false</code> if not. The <code>false</code> case is especially
... | [
"Text",
"node",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java#L500-L509 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.unmarshallRoleMembership | public static RoleMembershipBean unmarshallRoleMembership(Map<String, Object> source) {
"""
Unmarshals the given map source into a bean.
@param source the source
@return the role membership
"""
if (source == null) {
return null;
}
RoleMembershipBean bean = new RoleMembersh... | java | public static RoleMembershipBean unmarshallRoleMembership(Map<String, Object> source) {
if (source == null) {
return null;
}
RoleMembershipBean bean = new RoleMembershipBean();
bean.setId(asLong(source.get("id")));
bean.setOrganizationId(asString(source.get("organizat... | [
"public",
"static",
"RoleMembershipBean",
"unmarshallRoleMembership",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"RoleMembershipBean",
"bean",
"=",
"new",
"RoleM... | Unmarshals the given map source into a bean.
@param source the source
@return the role membership | [
"Unmarshals",
"the",
"given",
"map",
"source",
"into",
"a",
"bean",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L1190-L1202 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java | Settings.getStringArray | public String[] getStringArray(String key) {
"""
Value is split by comma and trimmed. Never returns null.
<br>
Examples :
<ul>
<li>"one,two,three " -> ["one", "two", "three"]</li>
<li>" one, two, three " -> ["one", "two", "three"]</li>
<li>"one, , three" -> ["one", "", "three"]</li>
</ul>
"""
... | java | public String[] getStringArray(String key) {
String effectiveKey = definitions.validKey(key);
Optional<PropertyDefinition> def = getDefinition(effectiveKey);
if ((def.isPresent()) && (def.get().multiValues())) {
String value = getString(key);
if (value == null) {
return ArrayUtils.EMPTY_... | [
"public",
"String",
"[",
"]",
"getStringArray",
"(",
"String",
"key",
")",
"{",
"String",
"effectiveKey",
"=",
"definitions",
".",
"validKey",
"(",
"key",
")",
";",
"Optional",
"<",
"PropertyDefinition",
">",
"def",
"=",
"getDefinition",
"(",
"effectiveKey",
... | Value is split by comma and trimmed. Never returns null.
<br>
Examples :
<ul>
<li>"one,two,three " -> ["one", "two", "three"]</li>
<li>" one, two, three " -> ["one", "two", "three"]</li>
<li>"one, , three" -> ["one", "", "three"]</li>
</ul> | [
"Value",
"is",
"split",
"by",
"comma",
"and",
"trimmed",
".",
"Never",
"returns",
"null",
".",
"<br",
">",
"Examples",
":",
"<ul",
">",
"<li",
">",
"one",
"two",
"three",
"-",
">",
";",
"[",
"one",
"two",
"three",
"]",
"<",
"/",
"li",
">",
"<li... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java#L272-L289 |
JavaMoney/jsr354-api | src/main/java/javax/money/format/MonetaryFormats.java | MonetaryFormats.getAmountFormat | public static MonetaryAmountFormat getAmountFormat(Locale locale, String... providers) {
"""
Access the default {@link MonetaryAmountFormat} given a {@link Locale}.
@param locale the target {@link Locale}, not {@code null}.
@param providers The providers to be queried, if not set the providers as defined by... | java | public static MonetaryAmountFormat getAmountFormat(Locale locale, String... providers) {
return getAmountFormat(AmountFormatQueryBuilder.of(locale).setProviderNames(providers).setLocale(locale).build());
} | [
"public",
"static",
"MonetaryAmountFormat",
"getAmountFormat",
"(",
"Locale",
"locale",
",",
"String",
"...",
"providers",
")",
"{",
"return",
"getAmountFormat",
"(",
"AmountFormatQueryBuilder",
".",
"of",
"(",
"locale",
")",
".",
"setProviderNames",
"(",
"providers... | Access the default {@link MonetaryAmountFormat} given a {@link Locale}.
@param locale the target {@link Locale}, not {@code null}.
@param providers The providers to be queried, if not set the providers as defined by #getDefaultCurrencyProviderChain()
are queried.
@return the matching {@link MonetaryAmountFormat}
@t... | [
"Access",
"the",
"default",
"{",
"@link",
"MonetaryAmountFormat",
"}",
"given",
"a",
"{",
"@link",
"Locale",
"}",
"."
] | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/format/MonetaryFormats.java#L89-L91 |
flow/commons | src/main/java/com/flowpowered/commons/map/impl/TTripleInt21ObjectHashMap.java | TTripleInt21ObjectHashMap.put | @Override
public T put(int x, int y, int z, T value) {
"""
Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value.
(A map m is said to contain a mapping for a key k if and o... | java | @Override
public T put(int x, int y, int z, T value) {
long key = Int21TripleHashed.key(x, y, z);
return map.put(key, value);
} | [
"@",
"Override",
"public",
"T",
"put",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"z",
",",
"T",
"value",
")",
"{",
"long",
"key",
"=",
"Int21TripleHashed",
".",
"key",
"(",
"x",
",",
"y",
",",
"z",
")",
";",
"return",
"map",
".",
"put",
"... | Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value.
(A map m is said to contain a mapping for a key k if and only if {@see #containsKey(int, int, int) m.containsKey(k)} would retu... | [
"Associates",
"the",
"specified",
"value",
"with",
"the",
"specified",
"key",
"in",
"this",
"map",
"(",
"optional",
"operation",
")",
".",
"If",
"the",
"map",
"previously",
"contained",
"a",
"mapping",
"for",
"the",
"key",
"the",
"old",
"value",
"is",
"rep... | train | https://github.com/flow/commons/blob/0690efdac06fd728fcd7e9cf10f2b1319379c45b/src/main/java/com/flowpowered/commons/map/impl/TTripleInt21ObjectHashMap.java#L82-L86 |
BlueBrain/bluima | utils/blue_commons/src/main/java/ch/epfl/bbp/ResourceHelper.java | ResourceHelper.getFile | public static File getFile(String resourceOrFile)
throws FileNotFoundException {
"""
Use getInputStream instead, because Files are trouble, when in (maven)
JARs
"""
try {
File file = new File(resourceOrFile);
if (file.exists()) {
return file;
... | java | public static File getFile(String resourceOrFile)
throws FileNotFoundException {
try {
File file = new File(resourceOrFile);
if (file.exists()) {
return file;
}
} catch (Exception e) {// nope
}
return getFile(resourceOrFil... | [
"public",
"static",
"File",
"getFile",
"(",
"String",
"resourceOrFile",
")",
"throws",
"FileNotFoundException",
"{",
"try",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"resourceOrFile",
")",
";",
"if",
"(",
"file",
".",
"exists",
"(",
")",
")",
"{",
"r... | Use getInputStream instead, because Files are trouble, when in (maven)
JARs | [
"Use",
"getInputStream",
"instead",
"because",
"Files",
"are",
"trouble",
"when",
"in",
"(",
"maven",
")",
"JARs"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/utils/blue_commons/src/main/java/ch/epfl/bbp/ResourceHelper.java#L31-L43 |
networknt/json-schema-validator | src/main/java/com/networknt/schema/url/URLFactory.java | URLFactory.toURL | public static URL toURL(final String pURL) throws MalformedURLException {
"""
Creates an {@link URL} based on the provided string
@param pURL the url
@return a {@link URL}
@throws MalformedURLException if the url is not a proper URL
"""
return new URL(null, pURL, sClasspathURLStreamHandler.supports(pURL... | java | public static URL toURL(final String pURL) throws MalformedURLException {
return new URL(null, pURL, sClasspathURLStreamHandler.supports(pURL) ? sClasspathURLStreamHandler : null);
} | [
"public",
"static",
"URL",
"toURL",
"(",
"final",
"String",
"pURL",
")",
"throws",
"MalformedURLException",
"{",
"return",
"new",
"URL",
"(",
"null",
",",
"pURL",
",",
"sClasspathURLStreamHandler",
".",
"supports",
"(",
"pURL",
")",
"?",
"sClasspathURLStreamHand... | Creates an {@link URL} based on the provided string
@param pURL the url
@return a {@link URL}
@throws MalformedURLException if the url is not a proper URL | [
"Creates",
"an",
"{"
] | train | https://github.com/networknt/json-schema-validator/blob/d2a3a8d2085e72eb5c25c2fd8c8c9e641a62376d/src/main/java/com/networknt/schema/url/URLFactory.java#L41-L43 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java | CacheProviderWrapper.addToTimeLimitDaemon | @Override
public void addToTimeLimitDaemon(Object id, long expirationTime, int inactivity) {
"""
This method is used only by default cache provider (cache.java). Do nothing.
"""
final String methodName = "addToTimeLimitDaemon()";
if (tc.isDebugEnabled()) {
Tr.debug(tc, methodNam... | java | @Override
public void addToTimeLimitDaemon(Object id, long expirationTime, int inactivity) {
final String methodName = "addToTimeLimitDaemon()";
if (tc.isDebugEnabled()) {
Tr.debug(tc, methodName + " cacheName=" + cacheName + " ERROR because it should not be called");
}
} | [
"@",
"Override",
"public",
"void",
"addToTimeLimitDaemon",
"(",
"Object",
"id",
",",
"long",
"expirationTime",
",",
"int",
"inactivity",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"addToTimeLimitDaemon()\"",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(... | This method is used only by default cache provider (cache.java). Do nothing. | [
"This",
"method",
"is",
"used",
"only",
"by",
"default",
"cache",
"provider",
"(",
"cache",
".",
"java",
")",
".",
"Do",
"nothing",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java#L1528-L1534 |
amzn/ion-java | src/com/amazon/ion/impl/bin/WriteBuffer.java | WriteBuffer.writeTo | public void writeTo(final OutputStream out, long position, long length) throws IOException {
"""
Write a specific segment of data from the buffer to a stream.
"""
while (length > 0)
{
final int index = index(position);
final int offset = offset(position);
fin... | java | public void writeTo(final OutputStream out, long position, long length) throws IOException
{
while (length > 0)
{
final int index = index(position);
final int offset = offset(position);
final Block block = blocks.get(index);
final int amount = (int) Ma... | [
"public",
"void",
"writeTo",
"(",
"final",
"OutputStream",
"out",
",",
"long",
"position",
",",
"long",
"length",
")",
"throws",
"IOException",
"{",
"while",
"(",
"length",
">",
"0",
")",
"{",
"final",
"int",
"index",
"=",
"index",
"(",
"position",
")",
... | Write a specific segment of data from the buffer to a stream. | [
"Write",
"a",
"specific",
"segment",
"of",
"data",
"from",
"the",
"buffer",
"to",
"a",
"stream",
"."
] | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/WriteBuffer.java#L1083-L1096 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/org/semanticweb/owlapi/model/IRI_CustomFieldSerializer.java | IRI_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, IRI instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.S... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, IRI instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"IRI",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user.clie... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/org/semanticweb/owlapi/model/IRI_CustomFieldSerializer.java#L82-L85 |
lz4/lz4-java | src/java/net/jpountz/xxhash/StreamingXXHash64.java | StreamingXXHash64.asChecksum | public final Checksum asChecksum() {
"""
Returns a {@link Checksum} view of this instance. Modifications to the view
will modify this instance too and vice-versa.
@return the {@link Checksum} object representing this instance
"""
return new Checksum() {
@Override
public long getValue() {
... | java | public final Checksum asChecksum() {
return new Checksum() {
@Override
public long getValue() {
return StreamingXXHash64.this.getValue();
}
@Override
public void reset() {
StreamingXXHash64.this.reset();
}
@Override
public void update(int b) {
... | [
"public",
"final",
"Checksum",
"asChecksum",
"(",
")",
"{",
"return",
"new",
"Checksum",
"(",
")",
"{",
"@",
"Override",
"public",
"long",
"getValue",
"(",
")",
"{",
"return",
"StreamingXXHash64",
".",
"this",
".",
"getValue",
"(",
")",
";",
"}",
"@",
... | Returns a {@link Checksum} view of this instance. Modifications to the view
will modify this instance too and vice-versa.
@return the {@link Checksum} object representing this instance | [
"Returns",
"a",
"{",
"@link",
"Checksum",
"}",
"view",
"of",
"this",
"instance",
".",
"Modifications",
"to",
"the",
"view",
"will",
"modify",
"this",
"instance",
"too",
"and",
"vice",
"-",
"versa",
"."
] | train | https://github.com/lz4/lz4-java/blob/c5ae694a3aa8b33ef87fd0486727a7d1e8f71367/src/java/net/jpountz/xxhash/StreamingXXHash64.java#L88-L117 |
alkacon/opencms-core | src/org/opencms/db/CmsAliasManager.java | CmsAliasManager.checkPermissionsForMassEdit | private void checkPermissionsForMassEdit(CmsObject cms, String siteRoot) throws CmsException {
"""
Checks that the user has permissions for a mass edit operation in a given site.<p>
@param cms the current CMS context
@param siteRoot the site for which the permissions should be checked
@throws CmsException i... | java | private void checkPermissionsForMassEdit(CmsObject cms, String siteRoot) throws CmsException {
String originalSiteRoot = cms.getRequestContext().getSiteRoot();
try {
cms.getRequestContext().setSiteRoot(siteRoot);
checkPermissionsForMassEdit(cms);
} finally {
... | [
"private",
"void",
"checkPermissionsForMassEdit",
"(",
"CmsObject",
"cms",
",",
"String",
"siteRoot",
")",
"throws",
"CmsException",
"{",
"String",
"originalSiteRoot",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getSiteRoot",
"(",
")",
";",
"try",
"{",... | Checks that the user has permissions for a mass edit operation in a given site.<p>
@param cms the current CMS context
@param siteRoot the site for which the permissions should be checked
@throws CmsException if something goes wrong | [
"Checks",
"that",
"the",
"user",
"has",
"permissions",
"for",
"a",
"mass",
"edit",
"operation",
"in",
"a",
"given",
"site",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsAliasManager.java#L512-L521 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/adt/Either.java | Either.orThrow | public final <T extends Throwable> R orThrow(Function<? super L, ? extends T> throwableFn) throws T {
"""
Return the wrapped value if this is a right; otherwise, map the wrapped left value to a <code>T</code> and throw
it.
@param throwableFn a function from L to T
@param <T> the left parameter type (t... | java | public final <T extends Throwable> R orThrow(Function<? super L, ? extends T> throwableFn) throws T {
return match((CheckedFn1<T, L, R>) l -> {
throw throwableFn.apply(l);
}, id());
} | [
"public",
"final",
"<",
"T",
"extends",
"Throwable",
">",
"R",
"orThrow",
"(",
"Function",
"<",
"?",
"super",
"L",
",",
"?",
"extends",
"T",
">",
"throwableFn",
")",
"throws",
"T",
"{",
"return",
"match",
"(",
"(",
"CheckedFn1",
"<",
"T",
",",
"L",
... | Return the wrapped value if this is a right; otherwise, map the wrapped left value to a <code>T</code> and throw
it.
@param throwableFn a function from L to T
@param <T> the left parameter type (the throwable type)
@return the wrapped value if this is a right
@throws T the result of applying the wrapped left v... | [
"Return",
"the",
"wrapped",
"value",
"if",
"this",
"is",
"a",
"right",
";",
"otherwise",
"map",
"the",
"wrapped",
"left",
"value",
"to",
"a",
"<code",
">",
"T<",
"/",
"code",
">",
"and",
"throw",
"it",
"."
] | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/Either.java#L85-L89 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java | ID3v2Tag.setURLFrame | public void setURLFrame(String id, String data) {
"""
Set the data contained in a URL frame. This includes all frames with
an id that starts with 'W' but excludes "WXXX". If an improper id is
passed, then nothing will happen.
@param id the id of the frame to set the data for
@param data the data for the fr... | java | public void setURLFrame(String id, String data)
{
if ((id.charAt(0) == 'W') && !id.equals(ID3v2Frames.USER_DEFINED_URL))
{
updateFrameData(id, data.getBytes());
}
} | [
"public",
"void",
"setURLFrame",
"(",
"String",
"id",
",",
"String",
"data",
")",
"{",
"if",
"(",
"(",
"id",
".",
"charAt",
"(",
"0",
")",
"==",
"'",
"'",
")",
"&&",
"!",
"id",
".",
"equals",
"(",
"ID3v2Frames",
".",
"USER_DEFINED_URL",
")",
")",
... | Set the data contained in a URL frame. This includes all frames with
an id that starts with 'W' but excludes "WXXX". If an improper id is
passed, then nothing will happen.
@param id the id of the frame to set the data for
@param data the data for the frame | [
"Set",
"the",
"data",
"contained",
"in",
"a",
"URL",
"frame",
".",
"This",
"includes",
"all",
"frames",
"with",
"an",
"id",
"that",
"starts",
"with",
"W",
"but",
"excludes",
"WXXX",
".",
"If",
"an",
"improper",
"id",
"is",
"passed",
"then",
"nothing",
... | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java#L327-L333 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkBreak | private Environment checkBreak(Stmt.Break stmt, Environment environment, EnclosingScope scope) {
"""
Type check a break statement. This requires propagating the current
environment to the block destination, to ensure that the actual types of all
variables at that point are precise.
@param stmt
Statement to t... | java | private Environment checkBreak(Stmt.Break stmt, Environment environment, EnclosingScope scope) {
// FIXME: need to check environment to the break destination
return FlowTypeUtils.BOTTOM;
} | [
"private",
"Environment",
"checkBreak",
"(",
"Stmt",
".",
"Break",
"stmt",
",",
"Environment",
"environment",
",",
"EnclosingScope",
"scope",
")",
"{",
"// FIXME: need to check environment to the break destination",
"return",
"FlowTypeUtils",
".",
"BOTTOM",
";",
"}"
] | Type check a break statement. This requires propagating the current
environment to the block destination, to ensure that the actual types of all
variables at that point are precise.
@param stmt
Statement to type check
@param environment
Determines the type of all variables immediately going into this
block
@return | [
"Type",
"check",
"a",
"break",
"statement",
".",
"This",
"requires",
"propagating",
"the",
"current",
"environment",
"to",
"the",
"block",
"destination",
"to",
"ensure",
"that",
"the",
"actual",
"types",
"of",
"all",
"variables",
"at",
"that",
"point",
"are",
... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L464-L467 |
mongodb/stitch-android-sdk | core/sdk/src/main/java/com/mongodb/stitch/core/auth/internal/CoreStitchAuth.java | CoreStitchAuth.doAuthenticatedRequest | public <T> T doAuthenticatedRequest(
final StitchAuthRequest stitchReq,
final Class<T> resultClass,
final CodecRegistry codecRegistry
) {
"""
Performs a request against Stitch using the provided {@link StitchAuthRequest} object, and
decodes the JSON body of the response into a T value as speci... | java | public <T> T doAuthenticatedRequest(
final StitchAuthRequest stitchReq,
final Class<T> resultClass,
final CodecRegistry codecRegistry
) {
final Response response = doAuthenticatedRequest(stitchReq);
try {
final String bodyStr = IoUtils.readAllToString(response.getBody());
final ... | [
"public",
"<",
"T",
">",
"T",
"doAuthenticatedRequest",
"(",
"final",
"StitchAuthRequest",
"stitchReq",
",",
"final",
"Class",
"<",
"T",
">",
"resultClass",
",",
"final",
"CodecRegistry",
"codecRegistry",
")",
"{",
"final",
"Response",
"response",
"=",
"doAuthen... | Performs a request against Stitch using the provided {@link StitchAuthRequest} object, and
decodes the JSON body of the response into a T value as specified by the provided class type.
The type will be decoded using the codec found for T in the codec registry given.
If the provided type is not supported by the codec re... | [
"Performs",
"a",
"request",
"against",
"Stitch",
"using",
"the",
"provided",
"{",
"@link",
"StitchAuthRequest",
"}",
"object",
"and",
"decodes",
"the",
"JSON",
"body",
"of",
"the",
"response",
"into",
"a",
"T",
"value",
"as",
"specified",
"by",
"the",
"provi... | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/sdk/src/main/java/com/mongodb/stitch/core/auth/internal/CoreStitchAuth.java#L282-L304 |
dvasilen/Hive-XML-SerDe | src/main/java/com/ibm/spss/hive/serde2/xml/processor/XmlNode.java | XmlNode.addAttribute | public void addAttribute(final String _name, final String _value) {
"""
Adds the attribute
@param _name
the attribute name
@param _value
the attribute name
"""
this.attributes.put(_name, new XmlNode() {
{
this.name = _name;
this.value = _value;
... | java | public void addAttribute(final String _name, final String _value) {
this.attributes.put(_name, new XmlNode() {
{
this.name = _name;
this.value = _value;
this.valid = true;
this.type = XmlNode.ATTRIBUTE_NODE;
}
});
... | [
"public",
"void",
"addAttribute",
"(",
"final",
"String",
"_name",
",",
"final",
"String",
"_value",
")",
"{",
"this",
".",
"attributes",
".",
"put",
"(",
"_name",
",",
"new",
"XmlNode",
"(",
")",
"{",
"{",
"this",
".",
"name",
"=",
"_name",
";",
"th... | Adds the attribute
@param _name
the attribute name
@param _value
the attribute name | [
"Adds",
"the",
"attribute"
] | train | https://github.com/dvasilen/Hive-XML-SerDe/blob/2a7a184b2cfaeb63008529a9851cd72edb8025d9/src/main/java/com/ibm/spss/hive/serde2/xml/processor/XmlNode.java#L155-L164 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/CouchClient.java | CouchClient.getDocRevisions | public DocumentRevs getDocRevisions(String id, String rev) {
"""
Get document along with its revision history, and the result is converted to a
<code>DocumentRevs</code> object.
@see <code>DocumentRevs</code>
"""
return getDocRevisions(id, rev,
new CouchClientTypeReference<DocumentR... | java | public DocumentRevs getDocRevisions(String id, String rev) {
return getDocRevisions(id, rev,
new CouchClientTypeReference<DocumentRevs>(DocumentRevs.class));
} | [
"public",
"DocumentRevs",
"getDocRevisions",
"(",
"String",
"id",
",",
"String",
"rev",
")",
"{",
"return",
"getDocRevisions",
"(",
"id",
",",
"rev",
",",
"new",
"CouchClientTypeReference",
"<",
"DocumentRevs",
">",
"(",
"DocumentRevs",
".",
"class",
")",
")",... | Get document along with its revision history, and the result is converted to a
<code>DocumentRevs</code> object.
@see <code>DocumentRevs</code> | [
"Get",
"document",
"along",
"with",
"its",
"revision",
"history",
"and",
"the",
"result",
"is",
"converted",
"to",
"a",
"<code",
">",
"DocumentRevs<",
"/",
"code",
">",
"object",
"."
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/CouchClient.java#L721-L724 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/kebab/KebabRenderer.java | KebabRenderer.encodeBegin | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
"""
/*
<div class="dropdown dropdown-kebab dropdown-kebab-pf">
<button class="btn btn-link dropdown-toggle" type="button" id="dropdownKebab" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<spa... | java | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
Kebab kebab = (Kebab) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = kebab.getClientId();
// Kebabs are a restyled ver... | [
"@",
"Override",
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"Kebab",
"kebab",
... | /*
<div class="dropdown dropdown-kebab dropdown-kebab-pf">
<button class="btn btn-link dropdown-toggle" type="button" id="dropdownKebab" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span class="fa fa-ellipsis-v"></span>
</button>
<ul class="dropdown-menu " aria-labelledby="dropdownKebab">
<li><a h... | [
"/",
"*",
"<div",
"class",
"=",
"dropdown",
"dropdown",
"-",
"kebab",
"dropdown",
"-",
"kebab",
"-",
"pf",
">",
"<button",
"class",
"=",
"btn",
"btn",
"-",
"link",
"dropdown",
"-",
"toggle",
"type",
"=",
"button",
"id",
"=",
"dropdownKebab",
"data",
"-... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/kebab/KebabRenderer.java#L58-L108 |
JOML-CI/JOML | src/org/joml/Matrix3f.java | Matrix3f.rotateYXZ | public Matrix3f rotateYXZ(Vector3f angles) {
"""
Apply rotation of <code>angles.y</code> radians about the Y axis, followed by a rotation of <code>angles.x</code> radians about the X axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate s... | java | public Matrix3f rotateYXZ(Vector3f angles) {
return rotateYXZ(angles.y, angles.x, angles.z);
} | [
"public",
"Matrix3f",
"rotateYXZ",
"(",
"Vector3f",
"angles",
")",
"{",
"return",
"rotateYXZ",
"(",
"angles",
".",
"y",
",",
"angles",
".",
"x",
",",
"angles",
".",
"z",
")",
";",
"}"
] | Apply rotation of <code>angles.y</code> radians about the Y axis, followed by a rotation of <code>angles.x</code> radians about the X axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter... | [
"Apply",
"rotation",
"of",
"<code",
">",
"angles",
".",
"y<",
"/",
"code",
">",
"radians",
"about",
"the",
"Y",
"axis",
"followed",
"by",
"a",
"rotation",
"of",
"<code",
">",
"angles",
".",
"x<",
"/",
"code",
">",
"radians",
"about",
"the",
"X",
"axi... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3f.java#L2195-L2197 |
febit/wit | wit-core/src/main/java/org/febit/wit_shaded/asm/ClassWriter.java | ClassWriter.newFloat | private Item newFloat(final float value) {
"""
Adds a float to the constant pool of the class being build. Does nothing if the constant pool already contains a
similar item.
@param value the float value.
@return a new or already existing float item.
"""
Item result = get(key.set(FLOAT, value));
... | java | private Item newFloat(final float value) {
Item result = get(key.set(FLOAT, value));
if (result == null) {
pool.putByte(FLOAT).putInt(Float.floatToIntBits(value));
result = new Item(poolIndex++, key);
put(result);
}
return result;
} | [
"private",
"Item",
"newFloat",
"(",
"final",
"float",
"value",
")",
"{",
"Item",
"result",
"=",
"get",
"(",
"key",
".",
"set",
"(",
"FLOAT",
",",
"value",
")",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"pool",
".",
"putByte",
"(",
"F... | Adds a float to the constant pool of the class being build. Does nothing if the constant pool already contains a
similar item.
@param value the float value.
@return a new or already existing float item. | [
"Adds",
"a",
"float",
"to",
"the",
"constant",
"pool",
"of",
"the",
"class",
"being",
"build",
".",
"Does",
"nothing",
"if",
"the",
"constant",
"pool",
"already",
"contains",
"a",
"similar",
"item",
"."
] | train | https://github.com/febit/wit/blob/89ee29efbc5633b79c30c3c7b953c9f4130575af/wit-core/src/main/java/org/febit/wit_shaded/asm/ClassWriter.java#L631-L639 |
RKumsher/utils | src/main/java/com/github/rkumsher/date/RandomDateUtils.java | RandomDateUtils.randomInstantAfter | public static Instant randomInstantAfter(Instant after) {
"""
Returns a random {@link Instant} that is after the given {@link Instant}.
@param after the value that returned {@link Instant} must be after
@return the random {@link Instant}
@throws IllegalArgumentException if after is null or if after is equal t... | java | public static Instant randomInstantAfter(Instant after) {
checkArgument(after != null, "After must be non-null");
checkArgument(after.isBefore(MAX_INSTANT), "Cannot produce date after %s", MAX_INSTANT);
return randomInstant(after.plus(1, MILLIS), MAX_INSTANT);
} | [
"public",
"static",
"Instant",
"randomInstantAfter",
"(",
"Instant",
"after",
")",
"{",
"checkArgument",
"(",
"after",
"!=",
"null",
",",
"\"After must be non-null\"",
")",
";",
"checkArgument",
"(",
"after",
".",
"isBefore",
"(",
"MAX_INSTANT",
")",
",",
"\"Can... | Returns a random {@link Instant} that is after the given {@link Instant}.
@param after the value that returned {@link Instant} must be after
@return the random {@link Instant}
@throws IllegalArgumentException if after is null or if after is equal to or after {@link
RandomDateUtils#MAX_INSTANT} | [
"Returns",
"a",
"random",
"{",
"@link",
"Instant",
"}",
"that",
"is",
"after",
"the",
"given",
"{",
"@link",
"Instant",
"}",
"."
] | train | https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/date/RandomDateUtils.java#L487-L491 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XNodeSet.java | XNodeSet.lessThanOrEqual | public boolean lessThanOrEqual(XObject obj2) throws javax.xml.transform.TransformerException {
"""
Tell if one object is less than or equal to the other.
@param obj2 object to compare this nodeset to
@return see this.compare(...)
@throws javax.xml.transform.TransformerException
"""
return compare(... | java | public boolean lessThanOrEqual(XObject obj2) throws javax.xml.transform.TransformerException
{
return compare(obj2, S_LTE);
} | [
"public",
"boolean",
"lessThanOrEqual",
"(",
"XObject",
"obj2",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"return",
"compare",
"(",
"obj2",
",",
"S_LTE",
")",
";",
"}"
] | Tell if one object is less than or equal to the other.
@param obj2 object to compare this nodeset to
@return see this.compare(...)
@throws javax.xml.transform.TransformerException | [
"Tell",
"if",
"one",
"object",
"is",
"less",
"than",
"or",
"equal",
"to",
"the",
"other",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XNodeSet.java#L658-L661 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/ConsumerSessionProxy.java | ConsumerSessionProxy._deleteSet | private void _deleteSet(SIMessageHandle[] msgHandles, SITransaction tran)
throws SISessionUnavailableException, SISessionDroppedException,
SIConnectionUnavailableException, SIConnectionDroppedException,
SIResourceException, SIConnectionLostException, SILimitExceededException,
... | java | private void _deleteSet(SIMessageHandle[] msgHandles, SITransaction tran)
throws SISessionUnavailableException, SISessionDroppedException,
SIConnectionUnavailableException, SIConnectionDroppedException,
SIResourceException, SIConnectionLostException, SILimitExceededException,
... | [
"private",
"void",
"_deleteSet",
"(",
"SIMessageHandle",
"[",
"]",
"msgHandles",
",",
"SITransaction",
"tran",
")",
"throws",
"SISessionUnavailableException",
",",
"SISessionDroppedException",
",",
"SIConnectionUnavailableException",
",",
"SIConnectionDroppedException",
",",
... | Used to delete a set of messages.
@param msgHandles
@param tran | [
"Used",
"to",
"delete",
"a",
"set",
"of",
"messages",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/ConsumerSessionProxy.java#L1581-L1631 |
tvesalainen/util | util/src/main/java/org/vesalainen/navi/Navis.java | Navis.addLongitude | public static final double addLongitude(double longitude, double delta) {
"""
Adds delta to longitude. Positive delta is to east
@param longitude
@param delta
@return
"""
double gha = longitudeToGHA(longitude);
gha -= delta;
return ghaToLongitude(normalizeAngle(gha));
} | java | public static final double addLongitude(double longitude, double delta)
{
double gha = longitudeToGHA(longitude);
gha -= delta;
return ghaToLongitude(normalizeAngle(gha));
} | [
"public",
"static",
"final",
"double",
"addLongitude",
"(",
"double",
"longitude",
",",
"double",
"delta",
")",
"{",
"double",
"gha",
"=",
"longitudeToGHA",
"(",
"longitude",
")",
";",
"gha",
"-=",
"delta",
";",
"return",
"ghaToLongitude",
"(",
"normalizeAngle... | Adds delta to longitude. Positive delta is to east
@param longitude
@param delta
@return | [
"Adds",
"delta",
"to",
"longitude",
".",
"Positive",
"delta",
"is",
"to",
"east"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/navi/Navis.java#L232-L237 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/index/IndexManager.java | IndexManager.write | public final void write(EntityMetadata metadata, Object entity) {
"""
Indexes an object.
@param metadata
the metadata
@param entity
the entity
"""
if (indexer != null)
{
MetamodelImpl metamodel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
... | java | public final void write(EntityMetadata metadata, Object entity)
{
if (indexer != null)
{
MetamodelImpl metamodel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
metadata.getPersistenceUnit());
((com.impetus.kundera.index.lucene.Ind... | [
"public",
"final",
"void",
"write",
"(",
"EntityMetadata",
"metadata",
",",
"Object",
"entity",
")",
"{",
"if",
"(",
"indexer",
"!=",
"null",
")",
"{",
"MetamodelImpl",
"metamodel",
"=",
"(",
"MetamodelImpl",
")",
"kunderaMetadata",
".",
"getApplicationMetadata"... | Indexes an object.
@param metadata
the metadata
@param entity
the entity | [
"Indexes",
"an",
"object",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/index/IndexManager.java#L233-L241 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/script/ExtensionScript.java | ExtensionScript.invokeTargetedScript | public void invokeTargetedScript(ScriptWrapper script, HttpMessage msg) {
"""
Invokes the given {@code script}, synchronously, as a {@link TargetedScript}, handling any {@code Exception} thrown
during the invocation.
<p>
The context class loader of caller thread is replaced with the class loader {@code AddOnLoa... | java | public void invokeTargetedScript(ScriptWrapper script, HttpMessage msg) {
validateScriptType(script, TYPE_TARGETED);
Writer writer = getWriters(script);
try {
// Dont need to check if enabled as it can only be invoked manually
TargetedScript s = this.getInterface(script, TargetedScript.class);
... | [
"public",
"void",
"invokeTargetedScript",
"(",
"ScriptWrapper",
"script",
",",
"HttpMessage",
"msg",
")",
"{",
"validateScriptType",
"(",
"script",
",",
"TYPE_TARGETED",
")",
";",
"Writer",
"writer",
"=",
"getWriters",
"(",
"script",
")",
";",
"try",
"{",
"// ... | Invokes the given {@code script}, synchronously, as a {@link TargetedScript}, handling any {@code Exception} thrown
during the invocation.
<p>
The context class loader of caller thread is replaced with the class loader {@code AddOnLoader} to allow the script to
access classes of add-ons.
@param script the script to in... | [
"Invokes",
"the",
"given",
"{",
"@code",
"script",
"}",
"synchronously",
"as",
"a",
"{",
"@link",
"TargetedScript",
"}",
"handling",
"any",
"{",
"@code",
"Exception",
"}",
"thrown",
"during",
"the",
"invocation",
".",
"<p",
">",
"The",
"context",
"class",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ExtensionScript.java#L1390-L1408 |
OpenLiberty/open-liberty | dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/ThreadPool.java | ThreadPool.executeOnDaemon | public void executeOnDaemon(Runnable command) {
"""
Dispatch work on a daemon thread. This thread is not accounted
for in the pool. There are no corresponding
ThreadPoolListener events. There is no MonitorPlugin support.
"""
int id = 0;
final Runnable commandToRun = command;
synchro... | java | public void executeOnDaemon(Runnable command) {
int id = 0;
final Runnable commandToRun = command;
synchronized (this) {
this.daemonId++;
id = this.daemonId;
}
final String runId = name + " : DMN" + id; // d185137.2
Thread t = (Thread) AccessCo... | [
"public",
"void",
"executeOnDaemon",
"(",
"Runnable",
"command",
")",
"{",
"int",
"id",
"=",
"0",
";",
"final",
"Runnable",
"commandToRun",
"=",
"command",
";",
"synchronized",
"(",
"this",
")",
"{",
"this",
".",
"daemonId",
"++",
";",
"id",
"=",
"this",... | Dispatch work on a daemon thread. This thread is not accounted
for in the pool. There are no corresponding
ThreadPoolListener events. There is no MonitorPlugin support. | [
"Dispatch",
"work",
"on",
"a",
"daemon",
"thread",
".",
"This",
"thread",
"is",
"not",
"accounted",
"for",
"in",
"the",
"pool",
".",
"There",
"are",
"no",
"corresponding",
"ThreadPoolListener",
"events",
".",
"There",
"is",
"no",
"MonitorPlugin",
"support",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/ThreadPool.java#L1066-L1089 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/config/CommandButtonLabelInfo.java | CommandButtonLabelInfo.configureAccelerator | protected void configureAccelerator(AbstractButton button, KeyStroke keystrokeAccelerator) {
"""
Sets the given keystroke accelerator on the given button.
@param button The button. May be null.
@param keystrokeAccelerator The accelerator. May be null.
"""
if ((button instanceof JMenuItem) && !(butt... | java | protected void configureAccelerator(AbstractButton button, KeyStroke keystrokeAccelerator) {
if ((button instanceof JMenuItem) && !(button instanceof JMenu)) {
((JMenuItem)button).setAccelerator(keystrokeAccelerator);
}
} | [
"protected",
"void",
"configureAccelerator",
"(",
"AbstractButton",
"button",
",",
"KeyStroke",
"keystrokeAccelerator",
")",
"{",
"if",
"(",
"(",
"button",
"instanceof",
"JMenuItem",
")",
"&&",
"!",
"(",
"button",
"instanceof",
"JMenu",
")",
")",
"{",
"(",
"("... | Sets the given keystroke accelerator on the given button.
@param button The button. May be null.
@param keystrokeAccelerator The accelerator. May be null. | [
"Sets",
"the",
"given",
"keystroke",
"accelerator",
"on",
"the",
"given",
"button",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/config/CommandButtonLabelInfo.java#L264-L268 |
bingoohuang/excel2javabeans | src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java | PoiUtil.findCell | public static Cell findCell(Sheet sheet, String cellRefValue) {
"""
根据单元格索引,找到单元格。
@param sheet EXCEL表单。
@param cellRefValue 单元格索引,例如A1, AB12等。
@return 单元格。
"""
val cellRef = new CellReference(cellRefValue);
val row = sheet.getRow(cellRef.getRow());
if (row == null) {
... | java | public static Cell findCell(Sheet sheet, String cellRefValue) {
val cellRef = new CellReference(cellRefValue);
val row = sheet.getRow(cellRef.getRow());
if (row == null) {
log.warn("unable to find row for " + cellRefValue);
return null;
}
val cell = row.g... | [
"public",
"static",
"Cell",
"findCell",
"(",
"Sheet",
"sheet",
",",
"String",
"cellRefValue",
")",
"{",
"val",
"cellRef",
"=",
"new",
"CellReference",
"(",
"cellRefValue",
")",
";",
"val",
"row",
"=",
"sheet",
".",
"getRow",
"(",
"cellRef",
".",
"getRow",
... | 根据单元格索引,找到单元格。
@param sheet EXCEL表单。
@param cellRefValue 单元格索引,例如A1, AB12等。
@return 单元格。 | [
"根据单元格索引,找到单元格。"
] | train | https://github.com/bingoohuang/excel2javabeans/blob/db136d460b93b649814366c0d84a982698b96dc3/src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java#L212-L226 |
hibernate/hibernate-ogm | infinispan-remote/src/main/java/org/hibernate/ogm/datastore/infinispanremote/configuration/impl/InfinispanRemoteConfiguration.java | InfinispanRemoteConfiguration.initConfiguration | public void initConfiguration(Map<?, ?> configurationMap, ServiceRegistryImplementor serviceRegistry) {
"""
Initialize the internal values from the given {@link Map}.
@param configurationMap
The values to use as configuration
@param serviceRegistry
"""
ClassLoaderService classLoaderService = serviceRegi... | java | public void initConfiguration(Map<?, ?> configurationMap, ServiceRegistryImplementor serviceRegistry) {
ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationMap, classLoaderService )... | [
"public",
"void",
"initConfiguration",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"configurationMap",
",",
"ServiceRegistryImplementor",
"serviceRegistry",
")",
"{",
"ClassLoaderService",
"classLoaderService",
"=",
"serviceRegistry",
".",
"getService",
"(",
"ClassLoaderServic... | Initialize the internal values from the given {@link Map}.
@param configurationMap
The values to use as configuration
@param serviceRegistry | [
"Initialize",
"the",
"internal",
"values",
"from",
"the",
"given",
"{",
"@link",
"Map",
"}",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-remote/src/main/java/org/hibernate/ogm/datastore/infinispanremote/configuration/impl/InfinispanRemoteConfiguration.java#L186-L240 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java | GlobalUsersInner.getOperationStatusAsync | public Observable<OperationStatusResponseInner> getOperationStatusAsync(String userName, String operationUrl) {
"""
Gets the status of long running operation.
@param userName The name of the user.
@param operationUrl The operation url of long running operation
@throws IllegalArgumentException thrown if parame... | java | public Observable<OperationStatusResponseInner> getOperationStatusAsync(String userName, String operationUrl) {
return getOperationStatusWithServiceResponseAsync(userName, operationUrl).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override
... | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"getOperationStatusAsync",
"(",
"String",
"userName",
",",
"String",
"operationUrl",
")",
"{",
"return",
"getOperationStatusWithServiceResponseAsync",
"(",
"userName",
",",
"operationUrl",
")",
".",
"map",
... | Gets the status of long running operation.
@param userName The name of the user.
@param operationUrl The operation url of long running operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatusResponseInner object | [
"Gets",
"the",
"status",
"of",
"long",
"running",
"operation",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java#L407-L414 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendText | public static <T> void sendText(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context, long timeoutmillis) {
"""
Sends a complete text message, invoking the callback when complete
Automatically frees the pooled byte buffer when done.
@param pooledDa... | java | public static <T> void sendText(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context, long timeoutmillis) {
sendInternal(pooledData, WebSocketFrameType.TEXT, wsChannel, callback, context, timeoutmillis);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"sendText",
"(",
"final",
"PooledByteBuffer",
"pooledData",
",",
"final",
"WebSocketChannel",
"wsChannel",
",",
"final",
"WebSocketCallback",
"<",
"T",
">",
"callback",
",",
"T",
"context",
",",
"long",
"timeoutmillis",... | Sends a complete text message, invoking the callback when complete
Automatically frees the pooled byte buffer when done.
@param pooledData The data to send, it will be freed when done
@param wsChannel The web socket channel
@param callback The callback to invoke on completion
@param context The context object that wil... | [
"Sends",
"a",
"complete",
"text",
"message",
"invoking",
"the",
"callback",
"when",
"complete",
"Automatically",
"frees",
"the",
"pooled",
"byte",
"buffer",
"when",
"done",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L188-L190 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesInner.java | PublicIPPrefixesInner.getByResourceGroupAsync | public Observable<PublicIPPrefixInner> getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName) {
"""
Gets the specified public IP prefix in a specified resource group.
@param resourceGroupName The name of the resource group.
@param publicIpPrefixName The name of the PublicIPPrefx.
@throws... | java | public Observable<PublicIPPrefixInner> getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).map(new Func1<ServiceResponse<PublicIPPrefixInner>, PublicIPPrefixInner>() {
@Override
... | [
"public",
"Observable",
"<",
"PublicIPPrefixInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"publicIpPrefixName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"publicIpPrefixName",
... | Gets the specified public IP prefix in a specified resource group.
@param resourceGroupName The name of the resource group.
@param publicIpPrefixName The name of the PublicIPPrefx.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PublicIPPrefixInner object | [
"Gets",
"the",
"specified",
"public",
"IP",
"prefix",
"in",
"a",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesInner.java#L302-L309 |
mfornos/humanize | humanize-icu/src/main/java/humanize/ICUHumanize.java | ICUHumanize.withinLocale | private static <T> T withinLocale(final Callable<T> operation, final Locale locale) {
"""
<p>
Wraps the given operation on a context with the specified locale.
</p>
@param operation
Operation to be performed
@param locale
Target locale
@return Result of the operation
"""
DefaultICUContext ctx ... | java | private static <T> T withinLocale(final Callable<T> operation, final Locale locale)
{
DefaultICUContext ctx = context.get();
Locale oldLocale = ctx.getLocale();
try
{
ctx.setLocale(locale);
return operation.call();
} catch (Exception e)
{
... | [
"private",
"static",
"<",
"T",
">",
"T",
"withinLocale",
"(",
"final",
"Callable",
"<",
"T",
">",
"operation",
",",
"final",
"Locale",
"locale",
")",
"{",
"DefaultICUContext",
"ctx",
"=",
"context",
".",
"get",
"(",
")",
";",
"Locale",
"oldLocale",
"=",
... | <p>
Wraps the given operation on a context with the specified locale.
</p>
@param operation
Operation to be performed
@param locale
Target locale
@return Result of the operation | [
"<p",
">",
"Wraps",
"the",
"given",
"operation",
"on",
"a",
"context",
"with",
"the",
"specified",
"locale",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-icu/src/main/java/humanize/ICUHumanize.java#L1777-L1794 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.putOrUpdateShapeForVarName | @Deprecated
public void putOrUpdateShapeForVarName(String varName, long[] shape, boolean clearArrayOnShapeMismatch) {
"""
Put or update the shape for the given variable name. Optionally supports clearing the specified variable's
INDArray if it's shape does not match the new shape
@param varName ... | java | @Deprecated
public void putOrUpdateShapeForVarName(String varName, long[] shape, boolean clearArrayOnShapeMismatch){
Preconditions.checkNotNull(shape, "Cannot put null shape for variable: %s", varName);
if(variableNameToShape.containsKey(varName)){
// updateShapeForVarName(varName, shape,... | [
"@",
"Deprecated",
"public",
"void",
"putOrUpdateShapeForVarName",
"(",
"String",
"varName",
",",
"long",
"[",
"]",
"shape",
",",
"boolean",
"clearArrayOnShapeMismatch",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"shape",
",",
"\"Cannot put null shape for va... | Put or update the shape for the given variable name. Optionally supports clearing the specified variable's
INDArray if it's shape does not match the new shape
@param varName Variable name
@param shape Shape to put
@param clearArrayOnShapeMismatch If false: no change to arrays. If t... | [
"Put",
"or",
"update",
"the",
"shape",
"for",
"the",
"given",
"variable",
"name",
".",
"Optionally",
"supports",
"clearing",
"the",
"specified",
"variable",
"s",
"INDArray",
"if",
"it",
"s",
"shape",
"does",
"not",
"match",
"the",
"new",
"shape"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L690-L699 |
sirensolutions/siren-join | src/main/java/solutions/siren/join/action/terms/collector/NumericTermStream.java | NumericTermStream.get | public static NumericTermStream get(IndexReader reader, IndexFieldData indexFieldData) {
"""
Instantiates a new reusable {@link NumericTermStream} based on the field type.
"""
if (indexFieldData instanceof IndexNumericFieldData) {
IndexNumericFieldData numFieldData = (IndexNumericFieldData) indexFiel... | java | public static NumericTermStream get(IndexReader reader, IndexFieldData indexFieldData) {
if (indexFieldData instanceof IndexNumericFieldData) {
IndexNumericFieldData numFieldData = (IndexNumericFieldData) indexFieldData;
if (!numFieldData.getNumericType().isFloatingPoint()) {
return new LongTerm... | [
"public",
"static",
"NumericTermStream",
"get",
"(",
"IndexReader",
"reader",
",",
"IndexFieldData",
"indexFieldData",
")",
"{",
"if",
"(",
"indexFieldData",
"instanceof",
"IndexNumericFieldData",
")",
"{",
"IndexNumericFieldData",
"numFieldData",
"=",
"(",
"IndexNumeri... | Instantiates a new reusable {@link NumericTermStream} based on the field type. | [
"Instantiates",
"a",
"new",
"reusable",
"{"
] | train | https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/terms/collector/NumericTermStream.java#L38-L51 |
google/closure-compiler | src/com/google/javascript/jscomp/CollapseProperties.java | CollapseProperties.flattenSimpleStubDeclaration | private void flattenSimpleStubDeclaration(Name name, String alias) {
"""
Flattens a stub declaration.
This is mostly a hack to support legacy users.
"""
Ref ref = Iterables.getOnlyElement(name.getRefs());
Node nameNode = NodeUtil.newName(compiler, alias, ref.getNode(), name.getFullName());
Node va... | java | private void flattenSimpleStubDeclaration(Name name, String alias) {
Ref ref = Iterables.getOnlyElement(name.getRefs());
Node nameNode = NodeUtil.newName(compiler, alias, ref.getNode(), name.getFullName());
Node varNode = IR.var(nameNode).useSourceInfoIfMissingFrom(nameNode);
checkState(ref.getNode().g... | [
"private",
"void",
"flattenSimpleStubDeclaration",
"(",
"Name",
"name",
",",
"String",
"alias",
")",
"{",
"Ref",
"ref",
"=",
"Iterables",
".",
"getOnlyElement",
"(",
"name",
".",
"getRefs",
"(",
")",
")",
";",
"Node",
"nameNode",
"=",
"NodeUtil",
".",
"new... | Flattens a stub declaration.
This is mostly a hack to support legacy users. | [
"Flattens",
"a",
"stub",
"declaration",
".",
"This",
"is",
"mostly",
"a",
"hack",
"to",
"support",
"legacy",
"users",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CollapseProperties.java#L274-L284 |
facebook/fresco | drawee/src/main/java/com/facebook/drawee/generic/GenericDraweeHierarchy.java | GenericDraweeHierarchy.setFailureImage | public void setFailureImage(int resourceId, ScalingUtils.ScaleType scaleType) {
"""
Sets a new failure drawable with scale type.
@param resourceId an identifier of an Android drawable or color resource.
@param ScalingUtils.ScaleType a new scale type.
"""
setFailureImage(mResources.getDrawable(resourceI... | java | public void setFailureImage(int resourceId, ScalingUtils.ScaleType scaleType) {
setFailureImage(mResources.getDrawable(resourceId), scaleType);
} | [
"public",
"void",
"setFailureImage",
"(",
"int",
"resourceId",
",",
"ScalingUtils",
".",
"ScaleType",
"scaleType",
")",
"{",
"setFailureImage",
"(",
"mResources",
".",
"getDrawable",
"(",
"resourceId",
")",
",",
"scaleType",
")",
";",
"}"
] | Sets a new failure drawable with scale type.
@param resourceId an identifier of an Android drawable or color resource.
@param ScalingUtils.ScaleType a new scale type. | [
"Sets",
"a",
"new",
"failure",
"drawable",
"with",
"scale",
"type",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/drawee/src/main/java/com/facebook/drawee/generic/GenericDraweeHierarchy.java#L483-L485 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java | DateFunctions.dateDiffMillis | public static Expression dateDiffMillis(String expression1, String expression2, DatePart part) {
"""
Returned expression results in Date arithmetic.
Returns the elapsed time between two UNIX timestamps as an integer whose unit is part.
"""
return dateDiffMillis(x(expression1), x(expression2), part);
... | java | public static Expression dateDiffMillis(String expression1, String expression2, DatePart part) {
return dateDiffMillis(x(expression1), x(expression2), part);
} | [
"public",
"static",
"Expression",
"dateDiffMillis",
"(",
"String",
"expression1",
",",
"String",
"expression2",
",",
"DatePart",
"part",
")",
"{",
"return",
"dateDiffMillis",
"(",
"x",
"(",
"expression1",
")",
",",
"x",
"(",
"expression2",
")",
",",
"part",
... | Returned expression results in Date arithmetic.
Returns the elapsed time between two UNIX timestamps as an integer whose unit is part. | [
"Returned",
"expression",
"results",
"in",
"Date",
"arithmetic",
".",
"Returns",
"the",
"elapsed",
"time",
"between",
"two",
"UNIX",
"timestamps",
"as",
"an",
"integer",
"whose",
"unit",
"is",
"part",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java#L115-L117 |
SonarSource/sonarqube | server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java | CeServer.main | public static void main(String[] args) {
"""
Can't be started as is. Needs to be bootstrapped by sonar-application
"""
ProcessEntryPoint entryPoint = ProcessEntryPoint.createForArguments(args);
Props props = entryPoint.getProps();
new CeProcessLogging().configure(props);
CeServer server = new C... | java | public static void main(String[] args) {
ProcessEntryPoint entryPoint = ProcessEntryPoint.createForArguments(args);
Props props = entryPoint.getProps();
new CeProcessLogging().configure(props);
CeServer server = new CeServer(
new ComputeEngineImpl(props, new ComputeEngineContainerImpl()),
ne... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"ProcessEntryPoint",
"entryPoint",
"=",
"ProcessEntryPoint",
".",
"createForArguments",
"(",
"args",
")",
";",
"Props",
"props",
"=",
"entryPoint",
".",
"getProps",
"(",
")",
";",... | Can't be started as is. Needs to be bootstrapped by sonar-application | [
"Can",
"t",
"be",
"started",
"as",
"is",
".",
"Needs",
"to",
"be",
"bootstrapped",
"by",
"sonar",
"-",
"application"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java#L119-L127 |
bwkimmel/jdcp | jdcp-worker/src/main/java/ca/eandb/jdcp/worker/DbCachingJobServiceClassLoaderStrategy.java | DbCachingJobServiceClassLoaderStrategy.prepareDataSource | public static void prepareDataSource(DataSource ds) throws SQLException {
"""
Prepares the data source to store cached class definitions.
@param ds The <code>DataSource</code> to prepare.
@throws SQLException If an error occurs while communicating with the
database.
"""
Connection con = null;
String... | java | public static void prepareDataSource(DataSource ds) throws SQLException {
Connection con = null;
String sql;
try {
con = ds.getConnection();
con.setAutoCommit(false);
DatabaseMetaData meta = con.getMetaData();
ResultSet rs = meta.getTables(null, null, null, new String[]{"TABLE"});
... | [
"public",
"static",
"void",
"prepareDataSource",
"(",
"DataSource",
"ds",
")",
"throws",
"SQLException",
"{",
"Connection",
"con",
"=",
"null",
";",
"String",
"sql",
";",
"try",
"{",
"con",
"=",
"ds",
".",
"getConnection",
"(",
")",
";",
"con",
".",
"set... | Prepares the data source to store cached class definitions.
@param ds The <code>DataSource</code> to prepare.
@throws SQLException If an error occurs while communicating with the
database. | [
"Prepares",
"the",
"data",
"source",
"to",
"store",
"cached",
"class",
"definitions",
"."
] | train | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-worker/src/main/java/ca/eandb/jdcp/worker/DbCachingJobServiceClassLoaderStrategy.java#L63-L103 |
olivergondza/dumpling | core/src/main/java/com/github/olivergondza/dumpling/model/ProcessThread.java | ProcessThread.waitingOnLock | public static @Nonnull Predicate waitingOnLock(final @Nonnull String className) {
"""
Match waiting thread waiting for given thread to be notified.
"""
return new Predicate() {
@Override
public boolean isValid(@Nonnull ProcessThread<?, ?, ?> thread) {
final Threa... | java | public static @Nonnull Predicate waitingOnLock(final @Nonnull String className) {
return new Predicate() {
@Override
public boolean isValid(@Nonnull ProcessThread<?, ?, ?> thread) {
final ThreadLock lock = thread.getWaitingOnLock();
return lock != null && ... | [
"public",
"static",
"@",
"Nonnull",
"Predicate",
"waitingOnLock",
"(",
"final",
"@",
"Nonnull",
"String",
"className",
")",
"{",
"return",
"new",
"Predicate",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"isValid",
"(",
"@",
"Nonnull",
"ProcessThread",... | Match waiting thread waiting for given thread to be notified. | [
"Match",
"waiting",
"thread",
"waiting",
"for",
"given",
"thread",
"to",
"be",
"notified",
"."
] | train | https://github.com/olivergondza/dumpling/blob/ac698735fcc7c023db0c1637cc1f522cb3576c7f/core/src/main/java/com/github/olivergondza/dumpling/model/ProcessThread.java#L540-L548 |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/unitizing/UnitizingAnnotationStudy.java | UnitizingAnnotationStudy.findNextUnit | public static IUnitizingAnnotationUnit findNextUnit(
final Iterator<IUnitizingAnnotationUnit> units, int raterIdx) {
"""
Utility method for moving on the cursor of the given iterator until
a unit of the specified rater is returned.
"""
return findNextUnit(units, raterIdx, null);
} | java | public static IUnitizingAnnotationUnit findNextUnit(
final Iterator<IUnitizingAnnotationUnit> units, int raterIdx) {
return findNextUnit(units, raterIdx, null);
} | [
"public",
"static",
"IUnitizingAnnotationUnit",
"findNextUnit",
"(",
"final",
"Iterator",
"<",
"IUnitizingAnnotationUnit",
">",
"units",
",",
"int",
"raterIdx",
")",
"{",
"return",
"findNextUnit",
"(",
"units",
",",
"raterIdx",
",",
"null",
")",
";",
"}"
] | Utility method for moving on the cursor of the given iterator until
a unit of the specified rater is returned. | [
"Utility",
"method",
"for",
"moving",
"on",
"the",
"cursor",
"of",
"the",
"given",
"iterator",
"until",
"a",
"unit",
"of",
"the",
"specified",
"rater",
"is",
"returned",
"."
] | train | https://github.com/dkpro/dkpro-statistics/blob/0b0e93dc49223984964411cbc6df420ba796a8cb/dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/unitizing/UnitizingAnnotationStudy.java#L120-L123 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.readBugCollectionAndProject | private static void readBugCollectionAndProject(IProject project, IProgressMonitor monitor)
throws IOException, DocumentException, CoreException {
"""
Read saved bug collection and findbugs project from file. Will populate
the bug collection and findbugs project session properties if successful.
If t... | java | private static void readBugCollectionAndProject(IProject project, IProgressMonitor monitor)
throws IOException, DocumentException, CoreException {
SortedBugCollection bugCollection;
IPath bugCollectionPath = getBugCollectionFile(project);
// Don't turn the path to an IFile because i... | [
"private",
"static",
"void",
"readBugCollectionAndProject",
"(",
"IProject",
"project",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"IOException",
",",
"DocumentException",
",",
"CoreException",
"{",
"SortedBugCollection",
"bugCollection",
";",
"IPath",
"bugCollect... | Read saved bug collection and findbugs project from file. Will populate
the bug collection and findbugs project session properties if successful.
If there is no saved bug collection and project for the eclipse project,
then FileNotFoundException will be thrown.
@param project
the eclipse project
@param monitor
a progr... | [
"Read",
"saved",
"bug",
"collection",
"and",
"findbugs",
"project",
"from",
"file",
".",
"Will",
"populate",
"the",
"bug",
"collection",
"and",
"findbugs",
"project",
"session",
"properties",
"if",
"successful",
".",
"If",
"there",
"is",
"no",
"saved",
"bug",
... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L703-L729 |
pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/config/YamlConfigReader.java | YamlConfigReader.readConfig | public static ConfigParams readConfig(String correlationId, String path, ConfigParams parameters)
throws ApplicationException {
"""
Reads configuration from a file, parameterize it with given values and
returns a new ConfigParams object.
@param correlationId (optional) transaction id to trace execution thro... | java | public static ConfigParams readConfig(String correlationId, String path, ConfigParams parameters)
throws ApplicationException {
return new YamlConfigReader(path).readConfig(correlationId, parameters);
} | [
"public",
"static",
"ConfigParams",
"readConfig",
"(",
"String",
"correlationId",
",",
"String",
"path",
",",
"ConfigParams",
"parameters",
")",
"throws",
"ApplicationException",
"{",
"return",
"new",
"YamlConfigReader",
"(",
"path",
")",
".",
"readConfig",
"(",
"... | Reads configuration from a file, parameterize it with given values and
returns a new ConfigParams object.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param path a path to configuration file.
@param parameters values to parameters the configuration or null to skip
... | [
"Reads",
"configuration",
"from",
"a",
"file",
"parameterize",
"it",
"with",
"given",
"values",
"and",
"returns",
"a",
"new",
"ConfigParams",
"object",
"."
] | train | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/config/YamlConfigReader.java#L130-L133 |
alkacon/opencms-core | src/org/opencms/ui/dataview/CmsDataViewPanel.java | CmsDataViewPanel.refreshData | public void refreshData(boolean resetPaging, String textQuery) {
"""
Updates the data displayed in the table.<p>
@param resetPaging true if we should go back to page 1
@param textQuery the text query to use
"""
String fullTextQuery = textQuery != null ? textQuery : m_fullTextSearch.getValue();
... | java | public void refreshData(boolean resetPaging, String textQuery) {
String fullTextQuery = textQuery != null ? textQuery : m_fullTextSearch.getValue();
LinkedHashMap<String, String> filterValues = new LinkedHashMap<String, String>();
for (Map.Entry<String, CmsDataViewFilter> entry : m_filterMap.en... | [
"public",
"void",
"refreshData",
"(",
"boolean",
"resetPaging",
",",
"String",
"textQuery",
")",
"{",
"String",
"fullTextQuery",
"=",
"textQuery",
"!=",
"null",
"?",
"textQuery",
":",
"m_fullTextSearch",
".",
"getValue",
"(",
")",
";",
"LinkedHashMap",
"<",
"S... | Updates the data displayed in the table.<p>
@param resetPaging true if we should go back to page 1
@param textQuery the text query to use | [
"Updates",
"the",
"data",
"displayed",
"in",
"the",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dataview/CmsDataViewPanel.java#L396-L425 |
lucee/Lucee | core/src/main/java/lucee/commons/io/res/type/ram/RamResourceProviderOld.java | RamResourceProviderOld.createCore | RamResourceCore createCore(String path, int type) throws IOException {
"""
create a new core
@param path
@param type
@return created core
@throws IOException
"""
String[] names = ListUtil.listToStringArray(path, '/');
RamResourceCore rrc = root;
for (int i = 0; i < names.length - 1; i++) {
rrc = ... | java | RamResourceCore createCore(String path, int type) throws IOException {
String[] names = ListUtil.listToStringArray(path, '/');
RamResourceCore rrc = root;
for (int i = 0; i < names.length - 1; i++) {
rrc = rrc.getChild(names[i], caseSensitive);
if (rrc == null) throw new IOException("can't create resource ... | [
"RamResourceCore",
"createCore",
"(",
"String",
"path",
",",
"int",
"type",
")",
"throws",
"IOException",
"{",
"String",
"[",
"]",
"names",
"=",
"ListUtil",
".",
"listToStringArray",
"(",
"path",
",",
"'",
"'",
")",
";",
"RamResourceCore",
"rrc",
"=",
"roo... | create a new core
@param path
@param type
@return created core
@throws IOException | [
"create",
"a",
"new",
"core"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/type/ram/RamResourceProviderOld.java#L110-L119 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java | CPInstancePersistenceImpl.removeByG_NotST | @Override
public void removeByG_NotST(long groupId, int status) {
"""
Removes all the cp instances where groupId = ? and status ≠ ? from the database.
@param groupId the group ID
@param status the status
"""
for (CPInstance cpInstance : findByG_NotST(groupId, status,
QueryUtil.ALL_POS, Qu... | java | @Override
public void removeByG_NotST(long groupId, int status) {
for (CPInstance cpInstance : findByG_NotST(groupId, status,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpInstance);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_NotST",
"(",
"long",
"groupId",
",",
"int",
"status",
")",
"{",
"for",
"(",
"CPInstance",
"cpInstance",
":",
"findByG_NotST",
"(",
"groupId",
",",
"status",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
"."... | Removes all the cp instances where groupId = ? and status ≠ ? from the database.
@param groupId the group ID
@param status the status | [
"Removes",
"all",
"the",
"cp",
"instances",
"where",
"groupId",
"=",
"?",
";",
"and",
"status",
"&ne",
";",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L4001-L4007 |
bmwcarit/joynr | java/messaging/bounceproxy/bounceproxy-controller/src/main/java/io/joynr/messaging/bounceproxy/controller/RemoteBounceProxyFacade.java | RemoteBounceProxyFacade.createChannelLoop | private URI createChannelLoop(ControlledBounceProxyInformation bpInfo,
String ccid,
String trackingId,
int retries) throws JoynrProtocolException {
"""
Starts a loop to send createChannel requests to a bounce prox... | java | private URI createChannelLoop(ControlledBounceProxyInformation bpInfo,
String ccid,
String trackingId,
int retries) throws JoynrProtocolException {
while (retries > 0) {
retries--;
try ... | [
"private",
"URI",
"createChannelLoop",
"(",
"ControlledBounceProxyInformation",
"bpInfo",
",",
"String",
"ccid",
",",
"String",
"trackingId",
",",
"int",
"retries",
")",
"throws",
"JoynrProtocolException",
"{",
"while",
"(",
"retries",
">",
"0",
")",
"{",
"retries... | Starts a loop to send createChannel requests to a bounce proxy with a
maximum number of retries.
@param bpInfo
information about the bounce proxy to create the channel at
@param ccid
the channel ID for the channel to create
@param trackingId
a tracking ID necessary for long polling
@param retries
the maximum number of... | [
"Starts",
"a",
"loop",
"to",
"send",
"createChannel",
"requests",
"to",
"a",
"bounce",
"proxy",
"with",
"a",
"maximum",
"number",
"of",
"retries",
"."
] | train | https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/messaging/bounceproxy/bounceproxy-controller/src/main/java/io/joynr/messaging/bounceproxy/controller/RemoteBounceProxyFacade.java#L117-L143 |
checkstyle-addons/checkstyle-addons | buildSrc/src/main/java/com/thomasjensen/checkstyle/addons/build/BuildUtil.java | BuildUtil.addBuildTimestampDeferred | public void addBuildTimestampDeferred(@Nonnull final Task pTask, @Nonnull final Attributes pAttributes) {
"""
Add build timestamp to some manifest attributes in the execution phase, so that it does not count for the
up-to-date check.
@param pTask the executing task
@param pAttributes the attributes map to add... | java | public void addBuildTimestampDeferred(@Nonnull final Task pTask, @Nonnull final Attributes pAttributes)
{
pTask.doFirst(new Closure<Void>(pTask)
{
@Override
@SuppressWarnings("MethodDoesntCallSuperMethod")
public Void call()
{
addBuildT... | [
"public",
"void",
"addBuildTimestampDeferred",
"(",
"@",
"Nonnull",
"final",
"Task",
"pTask",
",",
"@",
"Nonnull",
"final",
"Attributes",
"pAttributes",
")",
"{",
"pTask",
".",
"doFirst",
"(",
"new",
"Closure",
"<",
"Void",
">",
"(",
"pTask",
")",
"{",
"@"... | Add build timestamp to some manifest attributes in the execution phase, so that it does not count for the
up-to-date check.
@param pTask the executing task
@param pAttributes the attributes map to add to | [
"Add",
"build",
"timestamp",
"to",
"some",
"manifest",
"attributes",
"in",
"the",
"execution",
"phase",
"so",
"that",
"it",
"does",
"not",
"count",
"for",
"the",
"up",
"-",
"to",
"-",
"date",
"check",
"."
] | train | https://github.com/checkstyle-addons/checkstyle-addons/blob/fae1b4d341639c8e32c3e59ec5abdc0ffc11b865/buildSrc/src/main/java/com/thomasjensen/checkstyle/addons/build/BuildUtil.java#L180-L192 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/RtfWriter2.java | RtfWriter2.importRtfFragment | public void importRtfFragment(InputStream documentSource, RtfImportMappings mappings, EventListener[] events ) throws IOException, DocumentException {
"""
Adds a fragment of an RTF document to the current RTF document being generated.
Since this fragment doesn't contain font or color tables, all fonts and colors
... | java | public void importRtfFragment(InputStream documentSource, RtfImportMappings mappings, EventListener[] events ) throws IOException, DocumentException {
if(!this.open) {
throw new DocumentException("The document must be open to import RTF fragments.");
}
RtfParser rtfImport = new RtfParse... | [
"public",
"void",
"importRtfFragment",
"(",
"InputStream",
"documentSource",
",",
"RtfImportMappings",
"mappings",
",",
"EventListener",
"[",
"]",
"events",
")",
"throws",
"IOException",
",",
"DocumentException",
"{",
"if",
"(",
"!",
"this",
".",
"open",
")",
"{... | Adds a fragment of an RTF document to the current RTF document being generated.
Since this fragment doesn't contain font or color tables, all fonts and colors
are mapped to the default font and color. If the font and color mappings are
known, they can be specified via the mappings parameter.
Uses new RtfParser object.
... | [
"Adds",
"a",
"fragment",
"of",
"an",
"RTF",
"document",
"to",
"the",
"current",
"RTF",
"document",
"being",
"generated",
".",
"Since",
"this",
"fragment",
"doesn",
"t",
"contain",
"font",
"or",
"color",
"tables",
"all",
"fonts",
"and",
"colors",
"are",
"ma... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/RtfWriter2.java#L335-L346 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.toCompoundCurveFromList | public CompoundCurve toCompoundCurveFromList(List<List<LatLng>> polylineList) {
"""
Convert a list of List<LatLng> to a {@link CompoundCurve}
@param polylineList polyline list
@return compound curve
"""
return toCompoundCurveFromList(polylineList, false, false);
} | java | public CompoundCurve toCompoundCurveFromList(List<List<LatLng>> polylineList) {
return toCompoundCurveFromList(polylineList, false, false);
} | [
"public",
"CompoundCurve",
"toCompoundCurveFromList",
"(",
"List",
"<",
"List",
"<",
"LatLng",
">",
">",
"polylineList",
")",
"{",
"return",
"toCompoundCurveFromList",
"(",
"polylineList",
",",
"false",
",",
"false",
")",
";",
"}"
] | Convert a list of List<LatLng> to a {@link CompoundCurve}
@param polylineList polyline list
@return compound curve | [
"Convert",
"a",
"list",
"of",
"List<LatLng",
">",
"to",
"a",
"{",
"@link",
"CompoundCurve",
"}"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L891-L893 |
camunda/camunda-xml-model | src/main/java/org/camunda/bpm/model/xml/impl/util/ModelUtil.java | ModelUtil.getModelElement | public static ModelElementInstance getModelElement(DomElement domElement, ModelInstanceImpl modelInstance, ModelElementTypeImpl modelType) {
"""
Returns the {@link ModelElementInstanceImpl ModelElement} for a DOM element.
If the model element does not yet exist, it is created and linked to the DOM.
@param domE... | java | public static ModelElementInstance getModelElement(DomElement domElement, ModelInstanceImpl modelInstance, ModelElementTypeImpl modelType) {
ModelElementInstance modelElement = domElement.getModelElementInstance();
if(modelElement == null) {
modelElement = modelType.newInstance(modelInstance, domElement)... | [
"public",
"static",
"ModelElementInstance",
"getModelElement",
"(",
"DomElement",
"domElement",
",",
"ModelInstanceImpl",
"modelInstance",
",",
"ModelElementTypeImpl",
"modelType",
")",
"{",
"ModelElementInstance",
"modelElement",
"=",
"domElement",
".",
"getModelElementInsta... | Returns the {@link ModelElementInstanceImpl ModelElement} for a DOM element.
If the model element does not yet exist, it is created and linked to the DOM.
@param domElement the child element to create a new {@link ModelElementInstanceImpl ModelElement} for
@param modelInstance the {@link ModelInstanceImpl ModelInstanc... | [
"Returns",
"the",
"{",
"@link",
"ModelElementInstanceImpl",
"ModelElement",
"}",
"for",
"a",
"DOM",
"element",
".",
"If",
"the",
"model",
"element",
"does",
"not",
"yet",
"exist",
"it",
"is",
"created",
"and",
"linked",
"to",
"the",
"DOM",
"."
] | train | https://github.com/camunda/camunda-xml-model/blob/85b3f879e26d063f71c94cfd21ac17d9ff6baf4d/src/main/java/org/camunda/bpm/model/xml/impl/util/ModelUtil.java#L68-L76 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Signature.java | Signature.permuteWith | public MethodHandle permuteWith(MethodHandle target, String... permuteArgs) {
"""
Produce a method handle permuting the arguments in this signature using
the given permute arguments and targeting the given java.lang.invoke.MethodHandle.
Example:
<pre>
Signature sig = Signature.returning(String.class).appen... | java | public MethodHandle permuteWith(MethodHandle target, String... permuteArgs) {
return MethodHandles.permuteArguments(target, methodType, to(permute(permuteArgs)));
} | [
"public",
"MethodHandle",
"permuteWith",
"(",
"MethodHandle",
"target",
",",
"String",
"...",
"permuteArgs",
")",
"{",
"return",
"MethodHandles",
".",
"permuteArguments",
"(",
"target",
",",
"methodType",
",",
"to",
"(",
"permute",
"(",
"permuteArgs",
")",
")",
... | Produce a method handle permuting the arguments in this signature using
the given permute arguments and targeting the given java.lang.invoke.MethodHandle.
Example:
<pre>
Signature sig = Signature.returning(String.class).appendArg("a", int.class).appendArg("b", int.class);
MethodHandle handle = handleThatTakesOneInt()... | [
"Produce",
"a",
"method",
"handle",
"permuting",
"the",
"arguments",
"in",
"this",
"signature",
"using",
"the",
"given",
"permute",
"arguments",
"and",
"targeting",
"the",
"given",
"java",
".",
"lang",
".",
"invoke",
".",
"MethodHandle",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L730-L732 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DateTimeUtils.java | DateTimeUtils.addYears | public static Calendar addYears(Calendar origin, int value) {
"""
Add/Subtract the specified amount of years to the given {@link Calendar}.
<p>
The returned {@link Calendar} has its fields synced.
</p>
@param origin
@param value
@return
@since 0.9.2
"""
Calendar cal = sync((Calendar) origin.... | java | public static Calendar addYears(Calendar origin, int value) {
Calendar cal = sync((Calendar) origin.clone());
cal.add(Calendar.YEAR, value);
return sync(cal);
} | [
"public",
"static",
"Calendar",
"addYears",
"(",
"Calendar",
"origin",
",",
"int",
"value",
")",
"{",
"Calendar",
"cal",
"=",
"sync",
"(",
"(",
"Calendar",
")",
"origin",
".",
"clone",
"(",
")",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"YEA... | Add/Subtract the specified amount of years to the given {@link Calendar}.
<p>
The returned {@link Calendar} has its fields synced.
</p>
@param origin
@param value
@return
@since 0.9.2 | [
"Add",
"/",
"Subtract",
"the",
"specified",
"amount",
"of",
"years",
"to",
"the",
"given",
"{",
"@link",
"Calendar",
"}",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DateTimeUtils.java#L965-L969 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/DefaultAttributeMarshaller.java | DefaultAttributeMarshaller.marshallAsElement | @Deprecated
public void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, XMLStreamWriter writer) throws XMLStreamException {
"""
Use {@link #marshallAsElement(AttributeDefinition, ModelNode, boolean, XMLStreamWriter)} instead.
"""
marshallAsElement(attribute, resourceModel,... | java | @Deprecated
public void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, XMLStreamWriter writer) throws XMLStreamException {
marshallAsElement(attribute, resourceModel, true, writer);
} | [
"@",
"Deprecated",
"public",
"void",
"marshallAsElement",
"(",
"AttributeDefinition",
"attribute",
",",
"ModelNode",
"resourceModel",
",",
"XMLStreamWriter",
"writer",
")",
"throws",
"XMLStreamException",
"{",
"marshallAsElement",
"(",
"attribute",
",",
"resourceModel",
... | Use {@link #marshallAsElement(AttributeDefinition, ModelNode, boolean, XMLStreamWriter)} instead. | [
"Use",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/DefaultAttributeMarshaller.java#L45-L48 |
gallandarakhneorg/afc | advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/layer/RoadNetworkLayerConstants.java | RoadNetworkLayerConstants.setPreferredRoadColor | public static void setPreferredRoadColor(RoadType roadType, Integer color) {
"""
Set the preferred color to draw the content of the roads of the given type.
@param roadType is the type of road for which the color should be replied.
@param color is the color or <code>null</code> to restore the default value.
... | java | public static void setPreferredRoadColor(RoadType roadType, Integer color) {
final RoadType rt = roadType == null ? RoadType.OTHER : roadType;
final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkLayerConstants.class);
if (prefs != null) {
if (color == null || color.intValue() == DEFAULT_ROAD_CO... | [
"public",
"static",
"void",
"setPreferredRoadColor",
"(",
"RoadType",
"roadType",
",",
"Integer",
"color",
")",
"{",
"final",
"RoadType",
"rt",
"=",
"roadType",
"==",
"null",
"?",
"RoadType",
".",
"OTHER",
":",
"roadType",
";",
"final",
"Preferences",
"prefs",... | Set the preferred color to draw the content of the roads of the given type.
@param roadType is the type of road for which the color should be replied.
@param color is the color or <code>null</code> to restore the default value. | [
"Set",
"the",
"preferred",
"color",
"to",
"draw",
"the",
"content",
"of",
"the",
"roads",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/layer/RoadNetworkLayerConstants.java#L195-L210 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.uploadFile | public FileUpload uploadFile(Object projectIdOrPath, File fileToUpload) throws GitLabApiException {
"""
Uploads a file to the specified project to be used in an issue or merge request description, or a comment.
<pre><code>POST /projects/:id/uploads</code></pre>
@param projectIdOrPath projectIdOrPath the proj... | java | public FileUpload uploadFile(Object projectIdOrPath, File fileToUpload) throws GitLabApiException {
return (uploadFile(projectIdOrPath, fileToUpload, null));
} | [
"public",
"FileUpload",
"uploadFile",
"(",
"Object",
"projectIdOrPath",
",",
"File",
"fileToUpload",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"uploadFile",
"(",
"projectIdOrPath",
",",
"fileToUpload",
",",
"null",
")",
")",
";",
"}"
] | Uploads a file to the specified project to be used in an issue or merge request description, or a comment.
<pre><code>POST /projects/:id/uploads</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param fileToUpload the File insta... | [
"Uploads",
"a",
"file",
"to",
"the",
"specified",
"project",
"to",
"be",
"used",
"in",
"an",
"issue",
"or",
"merge",
"request",
"description",
"or",
"a",
"comment",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L2145-L2147 |
wonderpush/wonderpush-android-sdk | sdk/src/main/java/com/wonderpush/sdk/WonderPushDialogBuilder.java | WonderPushDialogBuilder.getDialogStyledAttributes | @SuppressLint("Recycle")
public static TypedArray getDialogStyledAttributes(Context activity, int[] attrs, int defStyleAttr, int defStyleRef) {
"""
Read styled attributes, they will defined in an AlertDialog shown by the given activity.
You must call {@link TypedArray#recycle()} after having read the desired ... | java | @SuppressLint("Recycle")
public static TypedArray getDialogStyledAttributes(Context activity, int[] attrs, int defStyleAttr, int defStyleRef) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
AlertDialog dialog = builder.create();
TypedArray ta = dialog.getContext().obtainSt... | [
"@",
"SuppressLint",
"(",
"\"Recycle\"",
")",
"public",
"static",
"TypedArray",
"getDialogStyledAttributes",
"(",
"Context",
"activity",
",",
"int",
"[",
"]",
"attrs",
",",
"int",
"defStyleAttr",
",",
"int",
"defStyleRef",
")",
"{",
"AlertDialog",
".",
"Builder"... | Read styled attributes, they will defined in an AlertDialog shown by the given activity.
You must call {@link TypedArray#recycle()} after having read the desired attributes.
@see Context#obtainStyledAttributes(android.util.AttributeSet, int[], int, int) | [
"Read",
"styled",
"attributes",
"they",
"will",
"defined",
"in",
"an",
"AlertDialog",
"shown",
"by",
"the",
"given",
"activity",
".",
"You",
"must",
"call",
"{"
] | train | https://github.com/wonderpush/wonderpush-android-sdk/blob/ba0a1568f705cdd6206639bfab1e5cf529084b59/sdk/src/main/java/com/wonderpush/sdk/WonderPushDialogBuilder.java#L39-L46 |
jbundle/jbundle | base/message/jibx/src/main/java/org/jbundle/base/message/trx/message/external/convert/jibx/JibxConvertToMessage.java | JibxConvertToMessage.unmarshalRootElement | public Object unmarshalRootElement(Node node, BaseXmlTrxMessageIn soapTrxMessage) throws Exception {
"""
Create the root element for this message.
You must override this.
@return The root element.
"""
/* try {
// create a JAXBContext capable of handling classes generated into
/... | java | public Object unmarshalRootElement(Node node, BaseXmlTrxMessageIn soapTrxMessage) throws Exception
{
/* try {
// create a JAXBContext capable of handling classes generated into
// the primer.po package
String strSOAPPackage = (String)((TrxMessageHeader)soapTrxMessage.getMe... | [
"public",
"Object",
"unmarshalRootElement",
"(",
"Node",
"node",
",",
"BaseXmlTrxMessageIn",
"soapTrxMessage",
")",
"throws",
"Exception",
"{",
"/* try {\n // create a JAXBContext capable of handling classes generated into\n // the primer.po package\n ... | Create the root element for this message.
You must override this.
@return The root element. | [
"Create",
"the",
"root",
"element",
"for",
"this",
"message",
".",
"You",
"must",
"override",
"this",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/jibx/src/main/java/org/jbundle/base/message/trx/message/external/convert/jibx/JibxConvertToMessage.java#L102-L128 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/databasetype/SybaseIqDatabaseType.java | SybaseIqDatabaseType.getTableColumnInfo | public TableColumnInfo getTableColumnInfo(Connection connection, String schema, String table) throws SQLException {
"""
<p>Overridden to create the table metadata by hand rather than using the JDBC
<code>DatabaseMetadata.getColumns()</code> method. This is because the Sybase driver fails
when the connection is a... | java | public TableColumnInfo getTableColumnInfo(Connection connection, String schema, String table) throws SQLException
{
if (schema == null || schema.length() == 0 || schema.equals(this.getTempDbSchemaName()))
{
schema = this.getCurrentSchema(connection);
}
return TableC... | [
"public",
"TableColumnInfo",
"getTableColumnInfo",
"(",
"Connection",
"connection",
",",
"String",
"schema",
",",
"String",
"table",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"schema",
"==",
"null",
"||",
"schema",
".",
"length",
"(",
")",
"==",
"0",
"|... | <p>Overridden to create the table metadata by hand rather than using the JDBC
<code>DatabaseMetadata.getColumns()</code> method. This is because the Sybase driver fails
when the connection is an XA connection unless you allow transactional DDL in tempdb.</p> | [
"<p",
">",
"Overridden",
"to",
"create",
"the",
"table",
"metadata",
"by",
"hand",
"rather",
"than",
"using",
"the",
"JDBC",
"<code",
">",
"DatabaseMetadata",
".",
"getColumns",
"()",
"<",
"/",
"code",
">",
"method",
".",
"This",
"is",
"because",
"the",
... | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/databasetype/SybaseIqDatabaseType.java#L225-L232 |
geomajas/geomajas-project-client-gwt | plugin/widget-searchandfilter/searchandfilter/src/main/java/org/geomajas/widget/searchandfilter/service/SearchFavouritesServiceInMemoryImpl.java | SearchFavouritesServiceInMemoryImpl.deleteSearchFavourite | public void deleteSearchFavourite(SearchFavourite sf) throws IOException {
"""
If creator is not set, only shared favourites will be checked (if
shared)!
"""
synchronized (lock) {
if (sf == null || sf.getId() == null) {
throw new IllegalArgumentException("null, or id not set!");
} else {
allFa... | java | public void deleteSearchFavourite(SearchFavourite sf) throws IOException {
synchronized (lock) {
if (sf == null || sf.getId() == null) {
throw new IllegalArgumentException("null, or id not set!");
} else {
allFavourites.remove(sf.getId());
if (sf.isShared()) {
sharedFavourites.remove(sf.getId()... | [
"public",
"void",
"deleteSearchFavourite",
"(",
"SearchFavourite",
"sf",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"sf",
"==",
"null",
"||",
"sf",
".",
"getId",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
... | If creator is not set, only shared favourites will be checked (if
shared)! | [
"If",
"creator",
"is",
"not",
"set",
"only",
"shared",
"favourites",
"will",
"be",
"checked",
"(",
"if",
"shared",
")",
"!"
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-searchandfilter/searchandfilter/src/main/java/org/geomajas/widget/searchandfilter/service/SearchFavouritesServiceInMemoryImpl.java#L81-L101 |
census-instrumentation/opencensus-java | impl_core/src/main/java/io/opencensus/implcore/tags/TagContextUtils.java | TagContextUtils.addTagToBuilder | static void addTagToBuilder(Tag tag, TagMapBuilderImpl builder) {
"""
Add a {@code Tag} of any type to a builder.
@param tag tag containing the key and value to set.
@param builder the builder to update.
"""
builder.put(tag.getKey(), tag.getValue(), tag.getTagMetadata());
} | java | static void addTagToBuilder(Tag tag, TagMapBuilderImpl builder) {
builder.put(tag.getKey(), tag.getValue(), tag.getTagMetadata());
} | [
"static",
"void",
"addTagToBuilder",
"(",
"Tag",
"tag",
",",
"TagMapBuilderImpl",
"builder",
")",
"{",
"builder",
".",
"put",
"(",
"tag",
".",
"getKey",
"(",
")",
",",
"tag",
".",
"getValue",
"(",
")",
",",
"tag",
".",
"getTagMetadata",
"(",
")",
")",
... | Add a {@code Tag} of any type to a builder.
@param tag tag containing the key and value to set.
@param builder the builder to update. | [
"Add",
"a",
"{",
"@code",
"Tag",
"}",
"of",
"any",
"type",
"to",
"a",
"builder",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/impl_core/src/main/java/io/opencensus/implcore/tags/TagContextUtils.java#L30-L32 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java | DefaultRenditionHandler.getVirtualRendition | private RenditionMetadata getVirtualRendition(Set<RenditionMetadata> candidates,
long destWidth, long destHeight, double destRatio) {
"""
Check if a rendition is available from which the required format can be downscaled from and returns
a virtual rendition in this case.
@param candidates Candidates
@para... | java | private RenditionMetadata getVirtualRendition(Set<RenditionMetadata> candidates,
long destWidth, long destHeight, double destRatio) {
// if ratio is defined get first rendition with matching ratio and same or bigger size
if (destRatio > 0) {
for (RenditionMetadata candidate : candidates) {
... | [
"private",
"RenditionMetadata",
"getVirtualRendition",
"(",
"Set",
"<",
"RenditionMetadata",
">",
"candidates",
",",
"long",
"destWidth",
",",
"long",
"destHeight",
",",
"double",
"destRatio",
")",
"{",
"// if ratio is defined get first rendition with matching ratio and same ... | Check if a rendition is available from which the required format can be downscaled from and returns
a virtual rendition in this case.
@param candidates Candidates
@param destWidth Destination width
@param destHeight Destination height
@param destRatio Destination ratio
@return Rendition or null | [
"Check",
"if",
"a",
"rendition",
"is",
"available",
"from",
"which",
"the",
"required",
"format",
"can",
"be",
"downscaled",
"from",
"and",
"returns",
"a",
"virtual",
"rendition",
"in",
"this",
"case",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java#L387-L409 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/io/ModbusUDPTransport.java | ModbusUDPTransport.writeMessage | private void writeMessage(ModbusMessage msg) throws ModbusIOException {
"""
Writes the request/response message to the port
@param msg Message to write
@throws ModbusIOException If the port cannot be written to
"""
try {
synchronized (byteOutputStream) {
int len = msg.getO... | java | private void writeMessage(ModbusMessage msg) throws ModbusIOException {
try {
synchronized (byteOutputStream) {
int len = msg.getOutputLength();
byteOutputStream.reset();
msg.writeTo(byteOutputStream);
byte data[] = byteOutputStream.get... | [
"private",
"void",
"writeMessage",
"(",
"ModbusMessage",
"msg",
")",
"throws",
"ModbusIOException",
"{",
"try",
"{",
"synchronized",
"(",
"byteOutputStream",
")",
"{",
"int",
"len",
"=",
"msg",
".",
"getOutputLength",
"(",
")",
";",
"byteOutputStream",
".",
"r... | Writes the request/response message to the port
@param msg Message to write
@throws ModbusIOException If the port cannot be written to | [
"Writes",
"the",
"request",
"/",
"response",
"message",
"to",
"the",
"port"
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/io/ModbusUDPTransport.java#L136-L150 |
casmi/casmi | src/main/java/casmi/image/Image.java | Image.getColor | public final Color getColor(int x, int y) {
"""
Returns the pixel color of this Image.
@param x
The x-coordinate of the pixel.
@param y
The y-coordinate of the pixel.
@return
The color of the pixel.
"""
int[] pixels = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();
int idx =... | java | public final Color getColor(int x, int y) {
int[] pixels = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();
int idx = x + y * width;
return new RGBColor((pixels[idx] >> 16 & 0x000000ff) / 255.0,
(pixels[idx] >> 8 & 0x000000ff) / 255.0,
... | [
"public",
"final",
"Color",
"getColor",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"[",
"]",
"pixels",
"=",
"(",
"(",
"DataBufferInt",
")",
"img",
".",
"getRaster",
"(",
")",
".",
"getDataBuffer",
"(",
")",
")",
".",
"getData",
"(",
")",
... | Returns the pixel color of this Image.
@param x
The x-coordinate of the pixel.
@param y
The y-coordinate of the pixel.
@return
The color of the pixel. | [
"Returns",
"the",
"pixel",
"color",
"of",
"this",
"Image",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/image/Image.java#L251-L259 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailmxplan/src/main/java/net/minidev/ovh/api/ApiOvhEmailmxplan.java | ApiOvhEmailmxplan.service_domain_domainName_disclaimer_POST | public OvhTask service_domain_domainName_disclaimer_POST(String service, String domainName, String content, Boolean outsideOnly) throws IOException {
"""
Create organization disclaimer of each email
REST: POST /email/mxplan/{service}/domain/{domainName}/disclaimer
@param content [required] Signature, added at ... | java | public OvhTask service_domain_domainName_disclaimer_POST(String service, String domainName, String content, Boolean outsideOnly) throws IOException {
String qPath = "/email/mxplan/{service}/domain/{domainName}/disclaimer";
StringBuilder sb = path(qPath, service, domainName);
HashMap<String, Object>o = new HashMap... | [
"public",
"OvhTask",
"service_domain_domainName_disclaimer_POST",
"(",
"String",
"service",
",",
"String",
"domainName",
",",
"String",
"content",
",",
"Boolean",
"outsideOnly",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/mxplan/{service}/domain/{... | Create organization disclaimer of each email
REST: POST /email/mxplan/{service}/domain/{domainName}/disclaimer
@param content [required] Signature, added at the bottom of your organization emails
@param outsideOnly [required] Activate the disclaimer only for external emails
@param service [required] The internal name ... | [
"Create",
"organization",
"disclaimer",
"of",
"each",
"email"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailmxplan/src/main/java/net/minidev/ovh/api/ApiOvhEmailmxplan.java#L702-L710 |
kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/Cache.java | Cache.deleteFromIndices | private void deleteFromIndices(ApiType oldObj, String key) {
"""
deleteFromIndices removes the object from each of the managed indexes.
<p>Note: It is intended to be called from a function that already has a lock on the cache.
@param oldObj the old obj
@param key the key
"""
for (Map.Entry<String, F... | java | private void deleteFromIndices(ApiType oldObj, String key) {
for (Map.Entry<String, Function<ApiType, List<String>>> indexEntry : this.indexers.entrySet()) {
Function<ApiType, List<String>> indexFunc = indexEntry.getValue();
List<String> indexValues = indexFunc.apply(oldObj);
if (io.kubernetes.cli... | [
"private",
"void",
"deleteFromIndices",
"(",
"ApiType",
"oldObj",
",",
"String",
"key",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Function",
"<",
"ApiType",
",",
"List",
"<",
"String",
">",
">",
">",
"indexEntry",
":",
"this",
"."... | deleteFromIndices removes the object from each of the managed indexes.
<p>Note: It is intended to be called from a function that already has a lock on the cache.
@param oldObj the old obj
@param key the key | [
"deleteFromIndices",
"removes",
"the",
"object",
"from",
"each",
"of",
"the",
"managed",
"indexes",
"."
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L357-L376 |
alkacon/opencms-core | src/org/opencms/loader/CmsJspLoader.java | CmsJspLoader.parseJspLinkMacros | protected String parseJspLinkMacros(String content, CmsFlexController controller) {
"""
Parses all jsp link macros, and replace them by the right target path.<p>
@param content the content to parse
@param controller the request controller
@return the parsed content
"""
CmsJspLinkMacroResolver m... | java | protected String parseJspLinkMacros(String content, CmsFlexController controller) {
CmsJspLinkMacroResolver macroResolver = new CmsJspLinkMacroResolver(controller.getCmsObject(), null, true);
return macroResolver.resolveMacros(content);
} | [
"protected",
"String",
"parseJspLinkMacros",
"(",
"String",
"content",
",",
"CmsFlexController",
"controller",
")",
"{",
"CmsJspLinkMacroResolver",
"macroResolver",
"=",
"new",
"CmsJspLinkMacroResolver",
"(",
"controller",
".",
"getCmsObject",
"(",
")",
",",
"null",
"... | Parses all jsp link macros, and replace them by the right target path.<p>
@param content the content to parse
@param controller the request controller
@return the parsed content | [
"Parses",
"all",
"jsp",
"link",
"macros",
"and",
"replace",
"them",
"by",
"the",
"right",
"target",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsJspLoader.java#L1585-L1589 |
JodaOrg/joda-convert | src/main/java/org/joda/convert/RenameHandler.java | RenameHandler.lookupEnum | public <T extends Enum<T>> T lookupEnum(Class<T> type, String name) {
"""
Lookup an enum from a name, handling renames.
@param <T> the type of the desired enum
@param type the enum type, not null
@param name the name of the enum to lookup, not null
@return the enum value, not null
@throws IllegalArgument... | java | public <T extends Enum<T>> T lookupEnum(Class<T> type, String name) {
if (type == null) {
throw new IllegalArgumentException("type must not be null");
}
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
Map<String, Enum<?>>... | [
"public",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"lookupEnum",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"name",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"type mu... | Lookup an enum from a name, handling renames.
@param <T> the type of the desired enum
@param type the enum type, not null
@param name the name of the enum to lookup, not null
@return the enum value, not null
@throws IllegalArgumentException if the name is not a valid enum constant | [
"Lookup",
"an",
"enum",
"from",
"a",
"name",
"handling",
"renames",
"."
] | train | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/RenameHandler.java#L267-L280 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.