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 |
|---|---|---|---|---|---|---|---|---|---|---|
aws/aws-sdk-java | aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/Database.java | Database.withParameters | public Database withParameters(java.util.Map<String, String> parameters) {
"""
<p>
These key-value pairs define parameters and properties of the database.
</p>
@param parameters
These key-value pairs define parameters and properties of the database.
@return Returns a reference to this object so that method ... | java | public Database withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
} | [
"public",
"Database",
"withParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"setParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
These key-value pairs define parameters and properties of the database.
</p>
@param parameters
These key-value pairs define parameters and properties of the database.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"These",
"key",
"-",
"value",
"pairs",
"define",
"parameters",
"and",
"properties",
"of",
"the",
"database",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/Database.java#L218-L221 |
zaproxy/zaproxy | src/org/parosproxy/paros/common/FileXML.java | FileXML.getValue | protected String getValue(Element base, String tag) {
"""
Get the value of the tag under a base element
@param base
@param tag
@return
"""
Element element = null;
String result = "";
try {
// ZAP: Removed unnecessary cast.
element = getElement(base, tag);
result = getText(element);... | java | protected String getValue(Element base, String tag) {
Element element = null;
String result = "";
try {
// ZAP: Removed unnecessary cast.
element = getElement(base, tag);
result = getText(element);
} catch (Exception e) {
}
return result;
} | [
"protected",
"String",
"getValue",
"(",
"Element",
"base",
",",
"String",
"tag",
")",
"{",
"Element",
"element",
"=",
"null",
";",
"String",
"result",
"=",
"\"\"",
";",
"try",
"{",
"// ZAP: Removed unnecessary cast.\r",
"element",
"=",
"getElement",
"(",
"base... | Get the value of the tag under a base element
@param base
@param tag
@return | [
"Get",
"the",
"value",
"of",
"the",
"tag",
"under",
"a",
"base",
"element"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/common/FileXML.java#L184-L196 |
aws/aws-sdk-java | aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/model/GrantConstraints.java | GrantConstraints.withEncryptionContextSubset | public GrantConstraints withEncryptionContextSubset(java.util.Map<String, String> encryptionContextSubset) {
"""
<p>
A list of key-value pairs, all of which must be present in the encryption context of certain subsequent
operations that the grant allows. When certain subsequent operations allowed by the grant in... | java | public GrantConstraints withEncryptionContextSubset(java.util.Map<String, String> encryptionContextSubset) {
setEncryptionContextSubset(encryptionContextSubset);
return this;
} | [
"public",
"GrantConstraints",
"withEncryptionContextSubset",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"encryptionContextSubset",
")",
"{",
"setEncryptionContextSubset",
"(",
"encryptionContextSubset",
")",
";",
"return",
"this",
";",
... | <p>
A list of key-value pairs, all of which must be present in the encryption context of certain subsequent
operations that the grant allows. When certain subsequent operations allowed by the grant include encryption
context that matches this list or is a superset of this list, the grant allows the operation. Otherwise... | [
"<p",
">",
"A",
"list",
"of",
"key",
"-",
"value",
"pairs",
"all",
"of",
"which",
"must",
"be",
"present",
"in",
"the",
"encryption",
"context",
"of",
"certain",
"subsequent",
"operations",
"that",
"the",
"grant",
"allows",
".",
"When",
"certain",
"subsequ... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/model/GrantConstraints.java#L117-L120 |
Azure/azure-sdk-for-java | recoveryservices/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/v2016_06_01/implementation/VaultsInner.java | VaultsInner.updateAsync | public Observable<VaultInner> updateAsync(String resourceGroupName, String vaultName, PatchVault vault) {
"""
Updates the vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@param vaultName The name of the recovery services vault.
@param vault Recovery... | java | public Observable<VaultInner> updateAsync(String resourceGroupName, String vaultName, PatchVault vault) {
return updateWithServiceResponseAsync(resourceGroupName, vaultName, vault).map(new Func1<ServiceResponse<VaultInner>, VaultInner>() {
@Override
public VaultInner call(ServiceResponse... | [
"public",
"Observable",
"<",
"VaultInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vaultName",
",",
"PatchVault",
"vault",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vaultName",
",",
"vault",
... | Updates the vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@param vaultName The name of the recovery services vault.
@param vault Recovery Services Vault to be created.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the ob... | [
"Updates",
"the",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/v2016_06_01/implementation/VaultsInner.java#L629-L636 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.globalClassesAbsent | public static void globalClassesAbsent(Class<?> aClass) {
"""
Thrown if the configured class hasn't classes parameter.
@param aClass class's field
"""
throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorRelationalException3, aClass.getSimpleName()));
} | java | public static void globalClassesAbsent(Class<?> aClass){
throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorRelationalException3, aClass.getSimpleName()));
} | [
"public",
"static",
"void",
"globalClassesAbsent",
"(",
"Class",
"<",
"?",
">",
"aClass",
")",
"{",
"throw",
"new",
"MappingErrorException",
"(",
"MSG",
".",
"INSTANCE",
".",
"message",
"(",
"mappingErrorRelationalException3",
",",
"aClass",
".",
"getSimpleName",
... | Thrown if the configured class hasn't classes parameter.
@param aClass class's field | [
"Thrown",
"if",
"the",
"configured",
"class",
"hasn",
"t",
"classes",
"parameter",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L550-L552 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/ArrayFunctions.java | ArrayFunctions.arrayContains | public static Expression arrayContains(String expression, Expression value) {
"""
Returned expression results in true if the array contains value.
"""
return arrayContains(x(expression), value);
} | java | public static Expression arrayContains(String expression, Expression value) {
return arrayContains(x(expression), value);
} | [
"public",
"static",
"Expression",
"arrayContains",
"(",
"String",
"expression",
",",
"Expression",
"value",
")",
"{",
"return",
"arrayContains",
"(",
"x",
"(",
"expression",
")",
",",
"value",
")",
";",
"}"
] | Returned expression results in true if the array contains value. | [
"Returned",
"expression",
"results",
"in",
"true",
"if",
"the",
"array",
"contains",
"value",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/ArrayFunctions.java#L118-L120 |
jenkinsci/jenkins | core/src/main/java/jenkins/security/DefaultConfidentialStore.java | DefaultConfidentialStore.load | @Override
protected byte[] load(ConfidentialKey key) throws IOException {
"""
Reverse operation of {@link #store(ConfidentialKey, byte[])}
@return
null the data has not been previously persisted.
"""
try {
File f = getFileFor(key);
if (!f.exists()) return null;
... | java | @Override
protected byte[] load(ConfidentialKey key) throws IOException {
try {
File f = getFileFor(key);
if (!f.exists()) return null;
Cipher sym = Secret.getCipher("AES");
sym.init(Cipher.DECRYPT_MODE, masterKey);
try (InputStream fis=Files.n... | [
"@",
"Override",
"protected",
"byte",
"[",
"]",
"load",
"(",
"ConfidentialKey",
"key",
")",
"throws",
"IOException",
"{",
"try",
"{",
"File",
"f",
"=",
"getFileFor",
"(",
"key",
")",
";",
"if",
"(",
"!",
"f",
".",
"exists",
"(",
")",
")",
"return",
... | Reverse operation of {@link #store(ConfidentialKey, byte[])}
@return
null the data has not been previously persisted. | [
"Reverse",
"operation",
"of",
"{",
"@link",
"#store",
"(",
"ConfidentialKey",
"byte",
"[]",
")",
"}"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/DefaultConfidentialStore.java#L97-L121 |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/WeldRuntime.java | WeldRuntime.fireEventForNonWebModules | private void fireEventForNonWebModules(Type eventType, Object event, Annotation... qualifiers) {
"""
Fires given event for non-web modules. Used for @BeforeDestroyed and @Destroyed events.
"""
try {
BeanDeploymentModules modules = deploymentManager.getServices().get(BeanDeploymentModule... | java | private void fireEventForNonWebModules(Type eventType, Object event, Annotation... qualifiers) {
try {
BeanDeploymentModules modules = deploymentManager.getServices().get(BeanDeploymentModules.class);
if (modules != null) {
// fire event for non-web modules
... | [
"private",
"void",
"fireEventForNonWebModules",
"(",
"Type",
"eventType",
",",
"Object",
"event",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"try",
"{",
"BeanDeploymentModules",
"modules",
"=",
"deploymentManager",
".",
"getServices",
"(",
")",
".",
"get",
... | Fires given event for non-web modules. Used for @BeforeDestroyed and @Destroyed events. | [
"Fires",
"given",
"event",
"for",
"non",
"-",
"web",
"modules",
".",
"Used",
"for"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/WeldRuntime.java#L81-L95 |
restfb/restfb | src/main/java/com/restfb/util/ObjectUtil.java | ObjectUtil.verifyParameterPresence | public static void verifyParameterPresence(String parameterName, String parameter) {
"""
Ensures that {@code parameter} isn't {@code null} or an empty string.
@param parameterName
The name of the parameter (to be used in exception message).
@param parameter
The parameter to check.
@throws IllegalArgumentExc... | java | public static void verifyParameterPresence(String parameterName, String parameter) {
verifyParameterPresence(parameterName, (Object) parameter);
if (parameter.trim().length() == 0) {
throw new IllegalArgumentException("The '" + parameterName + "' parameter cannot be an empty string.");
}
} | [
"public",
"static",
"void",
"verifyParameterPresence",
"(",
"String",
"parameterName",
",",
"String",
"parameter",
")",
"{",
"verifyParameterPresence",
"(",
"parameterName",
",",
"(",
"Object",
")",
"parameter",
")",
";",
"if",
"(",
"parameter",
".",
"trim",
"("... | Ensures that {@code parameter} isn't {@code null} or an empty string.
@param parameterName
The name of the parameter (to be used in exception message).
@param parameter
The parameter to check.
@throws IllegalArgumentException
If {@code parameter} is {@code null} or an empty string. | [
"Ensures",
"that",
"{",
"@code",
"parameter",
"}",
"isn",
"t",
"{",
"@code",
"null",
"}",
"or",
"an",
"empty",
"string",
"."
] | train | https://github.com/restfb/restfb/blob/fb77ba5486d1339e7deb81b9830670fa209b1047/src/main/java/com/restfb/util/ObjectUtil.java#L77-L82 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassTabbedPaneUI.java | SeaGlassTabbedPaneUI.paintScrollButtonBackground | protected void paintScrollButtonBackground(SeaGlassContext ss, Graphics g, JButton scrollButton) {
"""
Paint the background for a tab scroll button.
@param ss the tab subregion SynthContext.
@param g the Graphics context.
@param scrollButton the button to paint.
"""
Rectangle ... | java | protected void paintScrollButtonBackground(SeaGlassContext ss, Graphics g, JButton scrollButton) {
Rectangle tabRect = scrollButton.getBounds();
int x = tabRect.x;
int y = tabRect.y;
int height = tabRect.height;
int width = tabRect.width;
... | [
"protected",
"void",
"paintScrollButtonBackground",
"(",
"SeaGlassContext",
"ss",
",",
"Graphics",
"g",
",",
"JButton",
"scrollButton",
")",
"{",
"Rectangle",
"tabRect",
"=",
"scrollButton",
".",
"getBounds",
"(",
")",
";",
"int",
"x",
"=",
"tabRect",
".",
"x"... | Paint the background for a tab scroll button.
@param ss the tab subregion SynthContext.
@param g the Graphics context.
@param scrollButton the button to paint. | [
"Paint",
"the",
"background",
"for",
"a",
"tab",
"scroll",
"button",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassTabbedPaneUI.java#L809-L832 |
samskivert/samskivert | src/main/java/com/samskivert/swing/ScrollBox.java | ScrollBox.paintBox | protected void paintBox (Graphics g, Rectangle box) {
"""
Paint the box that represents the visible area of the two-dimensional
scrolling area.
"""
// just draw the box in our foreground color
g.setColor(getForeground());
g.drawRect(box.x, box.y, box.width, box.height);
} | java | protected void paintBox (Graphics g, Rectangle box)
{
// just draw the box in our foreground color
g.setColor(getForeground());
g.drawRect(box.x, box.y, box.width, box.height);
} | [
"protected",
"void",
"paintBox",
"(",
"Graphics",
"g",
",",
"Rectangle",
"box",
")",
"{",
"// just draw the box in our foreground color",
"g",
".",
"setColor",
"(",
"getForeground",
"(",
")",
")",
";",
"g",
".",
"drawRect",
"(",
"box",
".",
"x",
",",
"box",
... | Paint the box that represents the visible area of the two-dimensional
scrolling area. | [
"Paint",
"the",
"box",
"that",
"represents",
"the",
"visible",
"area",
"of",
"the",
"two",
"-",
"dimensional",
"scrolling",
"area",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/ScrollBox.java#L100-L105 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java | PolicyEventsInner.listQueryResultsForSubscriptionLevelPolicyAssignmentAsync | public Observable<PolicyEventsQueryResultsInner> listQueryResultsForSubscriptionLevelPolicyAssignmentAsync(String subscriptionId, String policyAssignmentName, QueryOptions queryOptions) {
"""
Queries policy events for the subscription level policy assignment.
@param subscriptionId Microsoft Azure subscription I... | java | public Observable<PolicyEventsQueryResultsInner> listQueryResultsForSubscriptionLevelPolicyAssignmentAsync(String subscriptionId, String policyAssignmentName, QueryOptions queryOptions) {
return listQueryResultsForSubscriptionLevelPolicyAssignmentWithServiceResponseAsync(subscriptionId, policyAssignmentName, qu... | [
"public",
"Observable",
"<",
"PolicyEventsQueryResultsInner",
">",
"listQueryResultsForSubscriptionLevelPolicyAssignmentAsync",
"(",
"String",
"subscriptionId",
",",
"String",
"policyAssignmentName",
",",
"QueryOptions",
"queryOptions",
")",
"{",
"return",
"listQueryResultsForSub... | Queries policy events for the subscription level policy assignment.
@param subscriptionId Microsoft Azure subscription ID.
@param policyAssignmentName Policy assignment name.
@param queryOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return th... | [
"Queries",
"policy",
"events",
"for",
"the",
"subscription",
"level",
"policy",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java#L1396-L1403 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java | RedBlackTreeInteger.searchNearestLower | public Node<T> searchNearestLower(int value, boolean acceptEquals) {
"""
Returns the node containing the highest value strictly lower than the given one.
"""
if (root == null) return null;
return searchNearestLower(root, value, acceptEquals);
} | java | public Node<T> searchNearestLower(int value, boolean acceptEquals) {
if (root == null) return null;
return searchNearestLower(root, value, acceptEquals);
} | [
"public",
"Node",
"<",
"T",
">",
"searchNearestLower",
"(",
"int",
"value",
",",
"boolean",
"acceptEquals",
")",
"{",
"if",
"(",
"root",
"==",
"null",
")",
"return",
"null",
";",
"return",
"searchNearestLower",
"(",
"root",
",",
"value",
",",
"acceptEquals... | Returns the node containing the highest value strictly lower than the given one. | [
"Returns",
"the",
"node",
"containing",
"the",
"highest",
"value",
"strictly",
"lower",
"than",
"the",
"given",
"one",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java#L275-L278 |
aol/cyclops | cyclops/src/main/java/cyclops/companion/Streams.java | Streams.scheduleFixedDelay | public static <T> Connectable<T> scheduleFixedDelay(final Stream<T> stream, final long delay, final ScheduledExecutorService ex) {
"""
Execute this Stream on a schedule
<pre>
{@code
//run every 60 seconds after last job completes
Streams.scheduleFixedDelay(Stream.generate(()->"next job:"+formatDate(new Date(... | java | public static <T> Connectable<T> scheduleFixedDelay(final Stream<T> stream, final long delay, final ScheduledExecutorService ex) {
return new NonPausableConnectable<>(
stream).scheduleFixedDelay(delay, ex);
} | [
"public",
"static",
"<",
"T",
">",
"Connectable",
"<",
"T",
">",
"scheduleFixedDelay",
"(",
"final",
"Stream",
"<",
"T",
">",
"stream",
",",
"final",
"long",
"delay",
",",
"final",
"ScheduledExecutorService",
"ex",
")",
"{",
"return",
"new",
"NonPausableConn... | Execute this Stream on a schedule
<pre>
{@code
//run every 60 seconds after last job completes
Streams.scheduleFixedDelay(Stream.generate(()->"next job:"+formatDate(new Date()))
.map(this::processJob)
,60_000,Executors.newScheduledThreadPool(1)));
}
</pre>
Connect to the Scheduled Stream
<pre>
{@code
Connectable<Dat... | [
"Execute",
"this",
"Stream",
"on",
"a",
"schedule"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Streams.java#L777-L780 |
Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java | MongoDBClient.populateGFSEntity | private void populateGFSEntity(EntityMetadata entityMetadata, List entities, GridFSDBFile gfsDBFile) {
"""
Populate gfs entity.
@param entityMetadata
the entity metadata
@param entities
the entities
@param gfsDBFile
the gfs db file
"""
Object entity = instantiateEntity(entityMetadata.getEntityC... | java | private void populateGFSEntity(EntityMetadata entityMetadata, List entities, GridFSDBFile gfsDBFile)
{
Object entity = instantiateEntity(entityMetadata.getEntityClazz(), null);
handler.getEntityFromGFSDBFile(entityMetadata.getEntityClazz(), entity, entityMetadata, gfsDBFile,
kunderaM... | [
"private",
"void",
"populateGFSEntity",
"(",
"EntityMetadata",
"entityMetadata",
",",
"List",
"entities",
",",
"GridFSDBFile",
"gfsDBFile",
")",
"{",
"Object",
"entity",
"=",
"instantiateEntity",
"(",
"entityMetadata",
".",
"getEntityClazz",
"(",
")",
",",
"null",
... | Populate gfs entity.
@param entityMetadata
the entity metadata
@param entities
the entities
@param gfsDBFile
the gfs db file | [
"Populate",
"gfs",
"entity",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java#L838-L844 |
Unicon/cas-addons | src/main/java/net/unicon/cas/addons/support/ResourceChangeDetectingEventNotifier.java | ResourceChangeDetectingEventNotifier.notifyOfTheResourceChangeEventIfNecessary | public void notifyOfTheResourceChangeEventIfNecessary() {
"""
Compare the SHA1 digests (since last check and the latest) of the configured resource, and if change is detected,
publish the <code>ResourceChangeEvent</code> to ApplicationContext.
"""
final String currentResourceSha1 = this.resourceSha1He... | java | public void notifyOfTheResourceChangeEventIfNecessary() {
final String currentResourceSha1 = this.resourceSha1Hex;
String newResourceSha1 = null;
try {
newResourceSha1 = new Sha1Hash(this.watchedResource.getFile()).toHex();
if (!newResourceSha1.equals(currentResourceSha1)... | [
"public",
"void",
"notifyOfTheResourceChangeEventIfNecessary",
"(",
")",
"{",
"final",
"String",
"currentResourceSha1",
"=",
"this",
".",
"resourceSha1Hex",
";",
"String",
"newResourceSha1",
"=",
"null",
";",
"try",
"{",
"newResourceSha1",
"=",
"new",
"Sha1Hash",
"(... | Compare the SHA1 digests (since last check and the latest) of the configured resource, and if change is detected,
publish the <code>ResourceChangeEvent</code> to ApplicationContext. | [
"Compare",
"the",
"SHA1",
"digests",
"(",
"since",
"last",
"check",
"and",
"the",
"latest",
")",
"of",
"the",
"configured",
"resource",
"and",
"if",
"change",
"is",
"detected",
"publish",
"the",
"<code",
">",
"ResourceChangeEvent<",
"/",
"code",
">",
"to",
... | train | https://github.com/Unicon/cas-addons/blob/9af2d4896e02d30622acec638539bfc41f45e480/src/main/java/net/unicon/cas/addons/support/ResourceChangeDetectingEventNotifier.java#L83-L101 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SecurityRulesInner.java | SecurityRulesInner.listAsync | public Observable<Page<SecurityRuleInner>> listAsync(final String resourceGroupName, final String networkSecurityGroupName) {
"""
Gets all security rules in a network security group.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network security group.... | java | public Observable<Page<SecurityRuleInner>> listAsync(final String resourceGroupName, final String networkSecurityGroupName) {
return listWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName)
.map(new Func1<ServiceResponse<Page<SecurityRuleInner>>, Page<SecurityRuleInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"SecurityRuleInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"networkSecurityGroupName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"n... | Gets all security rules in a network security group.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network security group.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<SecurityRuleInner>... | [
"Gets",
"all",
"security",
"rules",
"in",
"a",
"network",
"security",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SecurityRulesInner.java#L581-L589 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderId.java | GVRShaderId.makeTemplate | GVRShader makeTemplate(Class<? extends GVRShader> id, GVRContext ctx) {
"""
Instantiates an instance of input Java shader class,
which must be derived from GVRShader or GVRShaderTemplate.
@param id Java class which implements shaders of this type.
@param ctx GVRContext shader belongs to
@return GV... | java | GVRShader makeTemplate(Class<? extends GVRShader> id, GVRContext ctx)
{
try
{
Constructor<? extends GVRShader> maker = id.getDeclaredConstructor(GVRContext.class);
return maker.newInstance(ctx);
}
catch (NoSuchMethodException | IllegalAccessException | Instant... | [
"GVRShader",
"makeTemplate",
"(",
"Class",
"<",
"?",
"extends",
"GVRShader",
">",
"id",
",",
"GVRContext",
"ctx",
")",
"{",
"try",
"{",
"Constructor",
"<",
"?",
"extends",
"GVRShader",
">",
"maker",
"=",
"id",
".",
"getDeclaredConstructor",
"(",
"GVRContext"... | Instantiates an instance of input Java shader class,
which must be derived from GVRShader or GVRShaderTemplate.
@param id Java class which implements shaders of this type.
@param ctx GVRContext shader belongs to
@return GVRShader subclass which implements this shader type | [
"Instantiates",
"an",
"instance",
"of",
"input",
"Java",
"shader",
"class",
"which",
"must",
"be",
"derived",
"from",
"GVRShader",
"or",
"GVRShaderTemplate",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderId.java#L107-L127 |
ACRA/acra | acra-core/src/main/java/org/acra/util/ApplicationStartupProcessor.java | ApplicationStartupProcessor.deleteUnsentReportsFromOldAppVersion | private void deleteUnsentReportsFromOldAppVersion() {
"""
Delete any old unsent reports if this is a newer version of the app than when we last started.
"""
final SharedPreferences prefs = new SharedPreferencesFactory(context, config).create();
final long lastVersionNr = prefs.getInt(ACRA.PREF_... | java | private void deleteUnsentReportsFromOldAppVersion() {
final SharedPreferences prefs = new SharedPreferencesFactory(context, config).create();
final long lastVersionNr = prefs.getInt(ACRA.PREF_LAST_VERSION_NR, 0);
final int appVersion = getAppVersion();
if (appVersion > lastVersionNr) {
... | [
"private",
"void",
"deleteUnsentReportsFromOldAppVersion",
"(",
")",
"{",
"final",
"SharedPreferences",
"prefs",
"=",
"new",
"SharedPreferencesFactory",
"(",
"context",
",",
"config",
")",
".",
"create",
"(",
")",
";",
"final",
"long",
"lastVersionNr",
"=",
"prefs... | Delete any old unsent reports if this is a newer version of the app than when we last started. | [
"Delete",
"any",
"old",
"unsent",
"reports",
"if",
"this",
"is",
"a",
"newer",
"version",
"of",
"the",
"app",
"than",
"when",
"we",
"last",
"started",
"."
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/util/ApplicationStartupProcessor.java#L56-L67 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java | JQLBuilder.defineLimitStatement | private static <L extends Annotation> String defineLimitStatement(final SQLiteModelMethod method, final JQL result, Class<L> annotation, Map<JQLDynamicStatementType, String> dynamicReplace) {
"""
Define WHERE statement.
@param <L>
the generic type
@param method
the method
@param result
the result
@param a... | java | private static <L extends Annotation> String defineLimitStatement(final SQLiteModelMethod method, final JQL result, Class<L> annotation, Map<JQLDynamicStatementType, String> dynamicReplace) {
StringBuilder builder = new StringBuilder();
int pageSize = AnnotationUtility.extractAsInt(method.getElement(), annotation,... | [
"private",
"static",
"<",
"L",
"extends",
"Annotation",
">",
"String",
"defineLimitStatement",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"final",
"JQL",
"result",
",",
"Class",
"<",
"L",
">",
"annotation",
",",
"Map",
"<",
"JQLDynamicStatementType",
",",... | Define WHERE statement.
@param <L>
the generic type
@param method
the method
@param result
the result
@param annotation
the annotation
@param dynamicReplace
the dynamic replace
@return the string | [
"Define",
"WHERE",
"statement",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java#L899-L945 |
VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/VForDefinition.java | VForDefinition.initLoopVariable | private void initLoopVariable(String type, String name, TemplateParserContext context) {
"""
Init the loop variable and add it to the parser context
@param type Java type of the variable, will look for qualified class name in the context
@param name Name of the variable
@param context Context of the template ... | java | private void initLoopVariable(String type, String name, TemplateParserContext context) {
this.loopVariableInfo =
context.addLocalVariable(context.getFullyQualifiedNameForClassName(type.trim()),
name.trim());
} | [
"private",
"void",
"initLoopVariable",
"(",
"String",
"type",
",",
"String",
"name",
",",
"TemplateParserContext",
"context",
")",
"{",
"this",
".",
"loopVariableInfo",
"=",
"context",
".",
"addLocalVariable",
"(",
"context",
".",
"getFullyQualifiedNameForClassName",
... | Init the loop variable and add it to the parser context
@param type Java type of the variable, will look for qualified class name in the context
@param name Name of the variable
@param context Context of the template parser | [
"Init",
"the",
"loop",
"variable",
"and",
"add",
"it",
"to",
"the",
"parser",
"context"
] | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/VForDefinition.java#L157-L161 |
alkacon/opencms-core | src/org/opencms/configuration/CmsElementWithSubElementsParamConfigHelper.java | CmsElementWithSubElementsParamConfigHelper.generateXml | public void generateXml(Element parent, I_CmsConfigurationParameterHandler config) {
"""
Generates the XML configuration from the given configuration object.<p>
@param parent the parent element
@param config the configuration
"""
if (config != null) {
Element elem = parent.addElement(m... | java | public void generateXml(Element parent, I_CmsConfigurationParameterHandler config) {
if (config != null) {
Element elem = parent.addElement(m_name);
for (String subElemName : m_subElements) {
for (String value : config.getConfiguration().getList(subElemName)) {
... | [
"public",
"void",
"generateXml",
"(",
"Element",
"parent",
",",
"I_CmsConfigurationParameterHandler",
"config",
")",
"{",
"if",
"(",
"config",
"!=",
"null",
")",
"{",
"Element",
"elem",
"=",
"parent",
".",
"addElement",
"(",
"m_name",
")",
";",
"for",
"(",
... | Generates the XML configuration from the given configuration object.<p>
@param parent the parent element
@param config the configuration | [
"Generates",
"the",
"XML",
"configuration",
"from",
"the",
"given",
"configuration",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/configuration/CmsElementWithSubElementsParamConfigHelper.java#L118-L128 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/expression/Strings.java | Strings.defaultString | public String defaultString(final Object target, final Object defaultValue) {
"""
<p>
Checks if target text is empty and uses either target,
or if the target is empty uses {@code defaultValue}.
</p>
@param target value that to be checked if is null or empty
If non-String objects, toString() will be called.
... | java | public String defaultString(final Object target, final Object defaultValue) {
if (target == null) {
if (defaultValue == null) {
return "null";
}
return defaultValue.toString();
}
String targetString = target.toString();
if (StringUtils.isEmptyOrWh... | [
"public",
"String",
"defaultString",
"(",
"final",
"Object",
"target",
",",
"final",
"Object",
"defaultValue",
")",
"{",
"if",
"(",
"target",
"==",
"null",
")",
"{",
"if",
"(",
"defaultValue",
"==",
"null",
")",
"{",
"return",
"\"null\"",
";",
"}",
"retu... | <p>
Checks if target text is empty and uses either target,
or if the target is empty uses {@code defaultValue}.
</p>
@param target value that to be checked if is null or empty
If non-String objects, toString() will be called.
@param defaultValue value to use if target is empty
If non-String objects, toString() will be... | [
"<p",
">",
"Checks",
"if",
"target",
"text",
"is",
"empty",
"and",
"uses",
"either",
"target",
"or",
"if",
"the",
"target",
"is",
"empty",
"uses",
"{",
"@code",
"defaultValue",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/expression/Strings.java#L2153-L2170 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java | JimfsPath.startsWith | private static boolean startsWith(List<?> list, List<?> other) {
"""
Returns true if list starts with all elements of other in the same order.
"""
return list.size() >= other.size() && list.subList(0, other.size()).equals(other);
} | java | private static boolean startsWith(List<?> list, List<?> other) {
return list.size() >= other.size() && list.subList(0, other.size()).equals(other);
} | [
"private",
"static",
"boolean",
"startsWith",
"(",
"List",
"<",
"?",
">",
"list",
",",
"List",
"<",
"?",
">",
"other",
")",
"{",
"return",
"list",
".",
"size",
"(",
")",
">=",
"other",
".",
"size",
"(",
")",
"&&",
"list",
".",
"subList",
"(",
"0"... | Returns true if list starts with all elements of other in the same order. | [
"Returns",
"true",
"if",
"list",
"starts",
"with",
"all",
"elements",
"of",
"other",
"in",
"the",
"same",
"order",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java#L163-L165 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/SortedBugCollection.java | SortedBugCollection.readXML | public void readXML(@WillClose InputStream in, File base) throws IOException, DocumentException {
"""
Read XML data from given input stream into this object, populating the
Project as a side effect. An attempt will be made to close the input
stream (even if an exception is thrown).
@param in
the InputStream
... | java | public void readXML(@WillClose InputStream in, File base) throws IOException, DocumentException {
try {
doReadXML(in, base);
} finally {
in.close();
}
} | [
"public",
"void",
"readXML",
"(",
"@",
"WillClose",
"InputStream",
"in",
",",
"File",
"base",
")",
"throws",
"IOException",
",",
"DocumentException",
"{",
"try",
"{",
"doReadXML",
"(",
"in",
",",
"base",
")",
";",
"}",
"finally",
"{",
"in",
".",
"close",... | Read XML data from given input stream into this object, populating the
Project as a side effect. An attempt will be made to close the input
stream (even if an exception is thrown).
@param in
the InputStream | [
"Read",
"XML",
"data",
"from",
"given",
"input",
"stream",
"into",
"this",
"object",
"populating",
"the",
"Project",
"as",
"a",
"side",
"effect",
".",
"An",
"attempt",
"will",
"be",
"made",
"to",
"close",
"the",
"input",
"stream",
"(",
"even",
"if",
"an"... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SortedBugCollection.java#L306-L312 |
facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/DistCp.java | DistCp.getChunkFilePaths | private static Path[] getChunkFilePaths(Configuration conf,
FileSystem dstfs, Path chunkFileDir, int chunkNum) throws IOException {
"""
go to the directory we created for the chunk files
the chunk files are named as 0, 1, 2, 3....
For example, if a file File1 is chopped into 3 chunks,
the we should have a... | java | private static Path[] getChunkFilePaths(Configuration conf,
FileSystem dstfs, Path chunkFileDir, int chunkNum) throws IOException{
FileStatus [] chunkFileStatus = dstfs.listStatus(chunkFileDir);
HashSet <String> chunkFilePathSet = new HashSet<String>(chunkFileStatus.length);
for(FileStatus chunkfs:chu... | [
"private",
"static",
"Path",
"[",
"]",
"getChunkFilePaths",
"(",
"Configuration",
"conf",
",",
"FileSystem",
"dstfs",
",",
"Path",
"chunkFileDir",
",",
"int",
"chunkNum",
")",
"throws",
"IOException",
"{",
"FileStatus",
"[",
"]",
"chunkFileStatus",
"=",
"dstfs",... | go to the directory we created for the chunk files
the chunk files are named as 0, 1, 2, 3....
For example, if a file File1 is chopped into 3 chunks,
the we should have a directory /File1_chunkfiles, and
there are three files in that directory:
/File1_chunkfiles/0, /File1_chunkfiles/1, File1_chunkfiles/2
The returned c... | [
"go",
"to",
"the",
"directory",
"we",
"created",
"for",
"the",
"chunk",
"files",
"the",
"chunk",
"files",
"are",
"named",
"as",
"0",
"1",
"2",
"3",
"....",
"For",
"example",
"if",
"a",
"file",
"File1",
"is",
"chopped",
"into",
"3",
"chunks",
"the",
"... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistCp.java#L1692-L1723 |
jaxio/javaee-lab | javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java | GenericRepository.findUniqueOrNone | @Transactional
public E findUniqueOrNone(E entity, SearchParameters sp) {
"""
/*
We request at most 2, if there's more than one then we throw a {@link javax.persistence.NonUniqueResultException}
@throws javax.persistence.NonUniqueResultException
"""
// this code is an optimization to prevent us... | java | @Transactional
public E findUniqueOrNone(E entity, SearchParameters sp) {
// this code is an optimization to prevent using a count
sp.setFirst(0);
sp.setMaxResults(2);
List<E> results = find(entity, sp);
if (results == null || results.isEmpty()) {
return null;
... | [
"@",
"Transactional",
"public",
"E",
"findUniqueOrNone",
"(",
"E",
"entity",
",",
"SearchParameters",
"sp",
")",
"{",
"// this code is an optimization to prevent using a count",
"sp",
".",
"setFirst",
"(",
"0",
")",
";",
"sp",
".",
"setMaxResults",
"(",
"2",
")",
... | /*
We request at most 2, if there's more than one then we throw a {@link javax.persistence.NonUniqueResultException}
@throws javax.persistence.NonUniqueResultException | [
"/",
"*",
"We",
"request",
"at",
"most",
"2",
"if",
"there",
"s",
"more",
"than",
"one",
"then",
"we",
"throw",
"a",
"{",
"@link",
"javax",
".",
"persistence",
".",
"NonUniqueResultException",
"}"
] | train | https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java#L469-L483 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/reflect/Type.java | Type.newInstanceUsingCoercion | public T newInstanceUsingCoercion(String... args) throws Throwable {
"""
<p>newInstanceUsingCoercion.</p>
@param args a {@link java.lang.String} object.
@return a T object.
@throws java.lang.Throwable if any.
"""
Constructor<? extends T> constructor = ClassUtils.findPossibleConstructor(klass, args... | java | public T newInstanceUsingCoercion(String... args) throws Throwable
{
Constructor<? extends T> constructor = ClassUtils.findPossibleConstructor(klass, args);
Class[] types = constructor.getParameterTypes();
return newInstance( TypeConversion.convert( args, types ) );
} | [
"public",
"T",
"newInstanceUsingCoercion",
"(",
"String",
"...",
"args",
")",
"throws",
"Throwable",
"{",
"Constructor",
"<",
"?",
"extends",
"T",
">",
"constructor",
"=",
"ClassUtils",
".",
"findPossibleConstructor",
"(",
"klass",
",",
"args",
")",
";",
"Clas... | <p>newInstanceUsingCoercion.</p>
@param args a {@link java.lang.String} object.
@return a T object.
@throws java.lang.Throwable if any. | [
"<p",
">",
"newInstanceUsingCoercion",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/reflect/Type.java#L59-L64 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/ResourceLoader.java | ResourceLoader.getResourceAsURLString | public static String getResourceAsURLString(Class<?> requestingClass, String resource)
throws ResourceMissingException {
"""
Returns the requested resource as a URL string.
@param requestingClass the java.lang.Class object of the class that is attempting to load the
resource
@param resource a Stri... | java | public static String getResourceAsURLString(Class<?> requestingClass, String resource)
throws ResourceMissingException {
return getResourceAsURL(requestingClass, resource).toString();
} | [
"public",
"static",
"String",
"getResourceAsURLString",
"(",
"Class",
"<",
"?",
">",
"requestingClass",
",",
"String",
"resource",
")",
"throws",
"ResourceMissingException",
"{",
"return",
"getResourceAsURL",
"(",
"requestingClass",
",",
"resource",
")",
".",
"toStr... | Returns the requested resource as a URL string.
@param requestingClass the java.lang.Class object of the class that is attempting to load the
resource
@param resource a String describing the full or partial URL of the resource to load
@return the requested resource as a URL string
@throws ResourceMissingException | [
"Returns",
"the",
"requested",
"resource",
"as",
"a",
"URL",
"string",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/ResourceLoader.java#L180-L183 |
nwillc/almost-functional | src/main/java/almost/functional/utils/Preconditions.java | Preconditions.checkNonEmptyString | public static String checkNonEmptyString(final String reference, final String errorMessage) {
"""
Check that a String is not empty after removing whitespace.
@param reference the string
@param errorMessage the message for the exception
@throws java.lang.NullPointerException if the String is null
@thro... | java | public static String checkNonEmptyString(final String reference, final String errorMessage) {
return precondition(reference, Predicates.notEmptyString(),
IllegalArgumentException.class, errorMessage);
} | [
"public",
"static",
"String",
"checkNonEmptyString",
"(",
"final",
"String",
"reference",
",",
"final",
"String",
"errorMessage",
")",
"{",
"return",
"precondition",
"(",
"reference",
",",
"Predicates",
".",
"notEmptyString",
"(",
")",
",",
"IllegalArgumentException... | Check that a String is not empty after removing whitespace.
@param reference the string
@param errorMessage the message for the exception
@throws java.lang.NullPointerException if the String is null
@throws java.lang.IllegalArgumentException if the string is non-null but zero length | [
"Check",
"that",
"a",
"String",
"is",
"not",
"empty",
"after",
"removing",
"whitespace",
"."
] | train | https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/utils/Preconditions.java#L82-L85 |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/ui/PixelUtils.java | PixelUtils.getDpFromPixel | public static int getDpFromPixel(Context context, int pixel) {
"""
Converts Pixel to DP<br>
@param pixel Pixel
@return DP
@see <a href="http://developer.android.com/guide/practices/screens_support.html#dips-pels">http://developer.android.com/guide/practices/screens_support.html#dips-pels</a>
"""
float sca... | java | public static int getDpFromPixel(Context context, int pixel) {
float scale = context.getResources().getDisplayMetrics().density; // get display density
return (int)(pixel / scale);
} | [
"public",
"static",
"int",
"getDpFromPixel",
"(",
"Context",
"context",
",",
"int",
"pixel",
")",
"{",
"float",
"scale",
"=",
"context",
".",
"getResources",
"(",
")",
".",
"getDisplayMetrics",
"(",
")",
".",
"density",
";",
"// get display density",
"return",... | Converts Pixel to DP<br>
@param pixel Pixel
@return DP
@see <a href="http://developer.android.com/guide/practices/screens_support.html#dips-pels">http://developer.android.com/guide/practices/screens_support.html#dips-pels</a> | [
"Converts",
"Pixel",
"to",
"DP<br",
">"
] | train | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/ui/PixelUtils.java#L24-L28 |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/ejbjar30/EjbJarDescriptorImpl.java | EjbJarDescriptorImpl.addNamespace | public EjbJarDescriptor addNamespace(String name, String value) {
"""
Adds a new namespace
@return the current instance of <code>EjbJarDescriptor</code>
"""
model.attribute(name, value);
return this;
} | java | public EjbJarDescriptor addNamespace(String name, String value)
{
model.attribute(name, value);
return this;
} | [
"public",
"EjbJarDescriptor",
"addNamespace",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"model",
".",
"attribute",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new namespace
@return the current instance of <code>EjbJarDescriptor</code> | [
"Adds",
"a",
"new",
"namespace"
] | train | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/ejbjar30/EjbJarDescriptorImpl.java#L89-L93 |
aws/aws-sdk-java | aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/model/CreateCustomMetadataRequest.java | CreateCustomMetadataRequest.withCustomMetadata | public CreateCustomMetadataRequest withCustomMetadata(java.util.Map<String, String> customMetadata) {
"""
<p>
Custom metadata in the form of name-value pairs.
</p>
@param customMetadata
Custom metadata in the form of name-value pairs.
@return Returns a reference to this object so that method calls can be ch... | java | public CreateCustomMetadataRequest withCustomMetadata(java.util.Map<String, String> customMetadata) {
setCustomMetadata(customMetadata);
return this;
} | [
"public",
"CreateCustomMetadataRequest",
"withCustomMetadata",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"customMetadata",
")",
"{",
"setCustomMetadata",
"(",
"customMetadata",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Custom metadata in the form of name-value pairs.
</p>
@param customMetadata
Custom metadata in the form of name-value pairs.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Custom",
"metadata",
"in",
"the",
"form",
"of",
"name",
"-",
"value",
"pairs",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/model/CreateCustomMetadataRequest.java#L215-L218 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseHeadlessStatement | private Stmt parseHeadlessStatement(EnclosingScope scope) {
"""
A headless statement is one which has no identifying keyword. The set of
headless statements include assignments, invocations, variable
declarations and named blocks.
@param scope
The enclosing scope for this statement, which determines the
set... | java | private Stmt parseHeadlessStatement(EnclosingScope scope) {
int start = index;
// See if it is a named block
Identifier blockName = parseOptionalIdentifier(scope);
if (blockName != null) {
if (tryAndMatch(true, Colon) != null && isAtEOL()) {
int end = index;
matchEndLine();
scope = scope.newEncl... | [
"private",
"Stmt",
"parseHeadlessStatement",
"(",
"EnclosingScope",
"scope",
")",
"{",
"int",
"start",
"=",
"index",
";",
"// See if it is a named block",
"Identifier",
"blockName",
"=",
"parseOptionalIdentifier",
"(",
"scope",
")",
";",
"if",
"(",
"blockName",
"!="... | A headless statement is one which has no identifying keyword. The set of
headless statements include assignments, invocations, variable
declarations and named blocks.
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation leve... | [
"A",
"headless",
"statement",
"is",
"one",
"which",
"has",
"no",
"identifying",
"keyword",
".",
"The",
"set",
"of",
"headless",
"statements",
"include",
"assignments",
"invocations",
"variable",
"declarations",
"and",
"named",
"blocks",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L756-L800 |
windup/windup | config/api/src/main/java/org/jboss/windup/config/Variables.java | Variables.setVariable | public void setVariable(String name, Iterable<? extends WindupVertexFrame> frames) {
"""
Set a variable in the top variables layer to given "collection" of the vertex frames. Can't be reassigned -
throws on attempt to reassign.
"""
Map<String, Iterable<? extends WindupVertexFrame>> frame = peek();
... | java | public void setVariable(String name, Iterable<? extends WindupVertexFrame> frames)
{
Map<String, Iterable<? extends WindupVertexFrame>> frame = peek();
if (!Iteration.DEFAULT_VARIABLE_LIST_STRING.equals(name) && findVariable(name) != null)
{
throw new IllegalArgumentException("Va... | [
"public",
"void",
"setVariable",
"(",
"String",
"name",
",",
"Iterable",
"<",
"?",
"extends",
"WindupVertexFrame",
">",
"frames",
")",
"{",
"Map",
"<",
"String",
",",
"Iterable",
"<",
"?",
"extends",
"WindupVertexFrame",
">",
">",
"frame",
"=",
"peek",
"("... | Set a variable in the top variables layer to given "collection" of the vertex frames. Can't be reassigned -
throws on attempt to reassign. | [
"Set",
"a",
"variable",
"in",
"the",
"top",
"variables",
"layer",
"to",
"given",
"collection",
"of",
"the",
"vertex",
"frames",
".",
"Can",
"t",
"be",
"reassigned",
"-",
"throws",
"on",
"attempt",
"to",
"reassign",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/Variables.java#L99-L109 |
ops4j/org.ops4j.pax.exam2 | containers/pax-exam-container-karaf/src/main/java/org/ops4j/pax/exam/karaf/container/internal/DependenciesDeployer.java | DependenciesDeployer.writeDependenciesFeature | static void writeDependenciesFeature(Writer writer, ProvisionOption<?>... provisionOptions) {
"""
Write a feature xml structure for test dependencies specified as ProvisionOption
in system to the given writer
@param writer where to write the feature xml
@param provisionOptions dependencies
"""
XML... | java | static void writeDependenciesFeature(Writer writer, ProvisionOption<?>... provisionOptions) {
XMLOutputFactory xof = XMLOutputFactory.newInstance();
xof.setProperty("javax.xml.stream.isRepairingNamespaces", true);
XMLStreamWriter sw = null;
try {
sw = xof.createXMLStreamWrit... | [
"static",
"void",
"writeDependenciesFeature",
"(",
"Writer",
"writer",
",",
"ProvisionOption",
"<",
"?",
">",
"...",
"provisionOptions",
")",
"{",
"XMLOutputFactory",
"xof",
"=",
"XMLOutputFactory",
".",
"newInstance",
"(",
")",
";",
"xof",
".",
"setProperty",
"... | Write a feature xml structure for test dependencies specified as ProvisionOption
in system to the given writer
@param writer where to write the feature xml
@param provisionOptions dependencies | [
"Write",
"a",
"feature",
"xml",
"structure",
"for",
"test",
"dependencies",
"specified",
"as",
"ProvisionOption",
"in",
"system",
"to",
"the",
"given",
"writer"
] | train | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/containers/pax-exam-container-karaf/src/main/java/org/ops4j/pax/exam/karaf/container/internal/DependenciesDeployer.java#L142-L180 |
lukas-krecan/JsonUnit | json-unit-spring/src/main/java/net/javacrumbs/jsonunit/spring/JsonUnitResultMatchers.java | JsonUnitResultMatchers.when | public JsonUnitResultMatchers when(Option firstOption, Option... otherOptions) {
"""
Sets options changing comparison behavior. For more
details see {@link net.javacrumbs.jsonunit.core.Option}
@see net.javacrumbs.jsonunit.core.Option
"""
return new JsonUnitResultMatchers(path, configuration.withOpt... | java | public JsonUnitResultMatchers when(Option firstOption, Option... otherOptions) {
return new JsonUnitResultMatchers(path, configuration.withOptions(firstOption, otherOptions));
} | [
"public",
"JsonUnitResultMatchers",
"when",
"(",
"Option",
"firstOption",
",",
"Option",
"...",
"otherOptions",
")",
"{",
"return",
"new",
"JsonUnitResultMatchers",
"(",
"path",
",",
"configuration",
".",
"withOptions",
"(",
"firstOption",
",",
"otherOptions",
")",
... | Sets options changing comparison behavior. For more
details see {@link net.javacrumbs.jsonunit.core.Option}
@see net.javacrumbs.jsonunit.core.Option | [
"Sets",
"options",
"changing",
"comparison",
"behavior",
".",
"For",
"more",
"details",
"see",
"{",
"@link",
"net",
".",
"javacrumbs",
".",
"jsonunit",
".",
"core",
".",
"Option",
"}"
] | train | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit-spring/src/main/java/net/javacrumbs/jsonunit/spring/JsonUnitResultMatchers.java#L276-L278 |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/common/GeospatialUtils.java | GeospatialUtils.checkLongitude | public static Double checkLongitude(String name, Double longitude) {
"""
Checks if the specified longitude is correct.
@param name the name of the longitude field
@param longitude the value of the longitude field
@return the longitude
"""
if (longitude == null) {
throw new IndexExcepti... | java | public static Double checkLongitude(String name, Double longitude) {
if (longitude == null) {
throw new IndexException("{} required", name);
} else if (longitude < MIN_LONGITUDE || longitude > MAX_LONGITUDE) {
throw new IndexException("{} must be in range [{}, {}], but found {}",... | [
"public",
"static",
"Double",
"checkLongitude",
"(",
"String",
"name",
",",
"Double",
"longitude",
")",
"{",
"if",
"(",
"longitude",
"==",
"null",
")",
"{",
"throw",
"new",
"IndexException",
"(",
"\"{} required\"",
",",
"name",
")",
";",
"}",
"else",
"if",... | Checks if the specified longitude is correct.
@param name the name of the longitude field
@param longitude the value of the longitude field
@return the longitude | [
"Checks",
"if",
"the",
"specified",
"longitude",
"is",
"correct",
"."
] | train | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/common/GeospatialUtils.java#L88-L99 |
mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/function/DifferentiableFunctionOpts.java | DifferentiableFunctionOpts.getRegularizedOptimizer | public static Optimizer<DifferentiableFunction> getRegularizedOptimizer(final Optimizer<DifferentiableFunction> opt,
final double l1Lambda, final double l2Lambda) {
"""
Converts a standard optimizer to one which the given amount of l1 or l2 regularization.
"""
if (l1Lambda == 0 && l2Lambda ... | java | public static Optimizer<DifferentiableFunction> getRegularizedOptimizer(final Optimizer<DifferentiableFunction> opt,
final double l1Lambda, final double l2Lambda) {
if (l1Lambda == 0 && l2Lambda == 0) {
return opt;
}
return new Optimizer<DifferentiableFunction>() {
... | [
"public",
"static",
"Optimizer",
"<",
"DifferentiableFunction",
">",
"getRegularizedOptimizer",
"(",
"final",
"Optimizer",
"<",
"DifferentiableFunction",
">",
"opt",
",",
"final",
"double",
"l1Lambda",
",",
"final",
"double",
"l2Lambda",
")",
"{",
"if",
"(",
"l1La... | Converts a standard optimizer to one which the given amount of l1 or l2 regularization. | [
"Converts",
"a",
"standard",
"optimizer",
"to",
"one",
"which",
"the",
"given",
"amount",
"of",
"l1",
"or",
"l2",
"regularization",
"."
] | train | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/function/DifferentiableFunctionOpts.java#L165-L179 |
fcrepo3/fcrepo | fcrepo-installer/src/main/java/org/fcrepo/utilities/install/InstallOptions.java | InstallOptions.getIntValue | public int getIntValue(String name, int defaultValue)
throws NumberFormatException {
"""
Get the value of the given option as an integer, or the given default
value if unspecified.
@throws NumberFormatException
if the value is specified, but cannot be parsed as an integer.
"""
String ... | java | public int getIntValue(String name, int defaultValue)
throws NumberFormatException {
String value = getValue(name);
if (value == null) {
return defaultValue;
} else {
return Integer.parseInt(value);
}
} | [
"public",
"int",
"getIntValue",
"(",
"String",
"name",
",",
"int",
"defaultValue",
")",
"throws",
"NumberFormatException",
"{",
"String",
"value",
"=",
"getValue",
"(",
"name",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"defaultValue",
... | Get the value of the given option as an integer, or the given default
value if unspecified.
@throws NumberFormatException
if the value is specified, but cannot be parsed as an integer. | [
"Get",
"the",
"value",
"of",
"the",
"given",
"option",
"as",
"an",
"integer",
"or",
"the",
"given",
"default",
"value",
"if",
"unspecified",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-installer/src/main/java/org/fcrepo/utilities/install/InstallOptions.java#L419-L429 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/util/Reflection.java | Reflection.methodHandle | public static MethodHandle methodHandle(StandardErrorCode errorCode, Method method) {
"""
Returns a MethodHandle corresponding to the specified method.
<p>
Warning: The way Oracle JVM implements producing MethodHandle for a method involves creating
JNI global weak references. G1 processes such references serial... | java | public static MethodHandle methodHandle(StandardErrorCode errorCode, Method method)
{
try {
return MethodHandles.lookup().unreflect(method);
}
catch (IllegalAccessException e) {
throw new PrestoException(errorCode, e);
}
} | [
"public",
"static",
"MethodHandle",
"methodHandle",
"(",
"StandardErrorCode",
"errorCode",
",",
"Method",
"method",
")",
"{",
"try",
"{",
"return",
"MethodHandles",
".",
"lookup",
"(",
")",
".",
"unreflect",
"(",
"method",
")",
";",
"}",
"catch",
"(",
"Illeg... | Returns a MethodHandle corresponding to the specified method.
<p>
Warning: The way Oracle JVM implements producing MethodHandle for a method involves creating
JNI global weak references. G1 processes such references serially. As a result, calling this
method in a tight loop can create significant GC pressure and signif... | [
"Returns",
"a",
"MethodHandle",
"corresponding",
"to",
"the",
"specified",
"method",
".",
"<p",
">",
"Warning",
":",
"The",
"way",
"Oracle",
"JVM",
"implements",
"producing",
"MethodHandle",
"for",
"a",
"method",
"involves",
"creating",
"JNI",
"global",
"weak",
... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/util/Reflection.java#L77-L85 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java | HttpCommandExecutor.defineCommand | protected void defineCommand(String commandName, CommandInfo info) {
"""
It may be useful to extend the commands understood by this {@code HttpCommandExecutor} at run
time, and this can be achieved via this method. Note, this is protected, and expected usage is
for subclasses only to call this.
@param command... | java | protected void defineCommand(String commandName, CommandInfo info) {
checkNotNull(commandName);
checkNotNull(info);
commandCodec.defineCommand(commandName, info.getMethod(), info.getUrl());
} | [
"protected",
"void",
"defineCommand",
"(",
"String",
"commandName",
",",
"CommandInfo",
"info",
")",
"{",
"checkNotNull",
"(",
"commandName",
")",
";",
"checkNotNull",
"(",
"info",
")",
";",
"commandCodec",
".",
"defineCommand",
"(",
"commandName",
",",
"info",
... | It may be useful to extend the commands understood by this {@code HttpCommandExecutor} at run
time, and this can be achieved via this method. Note, this is protected, and expected usage is
for subclasses only to call this.
@param commandName The name of the command to use.
@param info CommandInfo for the command name ... | [
"It",
"may",
"be",
"useful",
"to",
"extend",
"the",
"commands",
"understood",
"by",
"this",
"{",
"@code",
"HttpCommandExecutor",
"}",
"at",
"run",
"time",
"and",
"this",
"can",
"be",
"achieved",
"via",
"this",
"method",
".",
"Note",
"this",
"is",
"protecte... | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java#L101-L105 |
opentable/otj-jaxrs | client/src/main/java/com/opentable/jaxrs/CalculateThreads.java | CalculateThreads.calculateThreads | public static int calculateThreads(final int executorThreads, final String name) {
"""
Calculate optimal threads. If they exceed the specified executorThreads, use optimal threads
instead. Emit appropriate logging
@param executorThreads executor threads - what the caller wishes to use for size
@param name clien... | java | public static int calculateThreads(final int executorThreads, final String name) {
// For current standard 8 core machines this is 10 regardless.
// On Java 10, you might get less than 8 core reported, but it will still size as if it's 8
// Beyond 8 core you MIGHT undersize if running on Docker,... | [
"public",
"static",
"int",
"calculateThreads",
"(",
"final",
"int",
"executorThreads",
",",
"final",
"String",
"name",
")",
"{",
"// For current standard 8 core machines this is 10 regardless.",
"// On Java 10, you might get less than 8 core reported, but it will still size as if it's ... | Calculate optimal threads. If they exceed the specified executorThreads, use optimal threads
instead. Emit appropriate logging
@param executorThreads executor threads - what the caller wishes to use for size
@param name client pool name. Used for logging.
@return int actual threads to use | [
"Calculate",
"optimal",
"threads",
".",
"If",
"they",
"exceed",
"the",
"specified",
"executorThreads",
"use",
"optimal",
"threads",
"instead",
".",
"Emit",
"appropriate",
"logging"
] | train | https://github.com/opentable/otj-jaxrs/blob/384e7094fe5a56d41b2a9970bfd783fa85cbbcb8/client/src/main/java/com/opentable/jaxrs/CalculateThreads.java#L29-L48 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/querycache/subscriber/DefaultQueryCache.java | DefaultQueryCache.isTryRecoverSucceeded | private boolean isTryRecoverSucceeded(ConcurrentMap<Integer, Long> brokenSequences) {
"""
This tries to reset cursor position of the accumulator to the supplied sequence,
if that sequence is still there, it will be succeeded, otherwise query cache content stays inconsistent.
"""
int numberOfBrokenSequ... | java | private boolean isTryRecoverSucceeded(ConcurrentMap<Integer, Long> brokenSequences) {
int numberOfBrokenSequences = brokenSequences.size();
InvokerWrapper invokerWrapper = context.getInvokerWrapper();
SubscriberContext subscriberContext = context.getSubscriberContext();
SubscriberContext... | [
"private",
"boolean",
"isTryRecoverSucceeded",
"(",
"ConcurrentMap",
"<",
"Integer",
",",
"Long",
">",
"brokenSequences",
")",
"{",
"int",
"numberOfBrokenSequences",
"=",
"brokenSequences",
".",
"size",
"(",
")",
";",
"InvokerWrapper",
"invokerWrapper",
"=",
"contex... | This tries to reset cursor position of the accumulator to the supplied sequence,
if that sequence is still there, it will be succeeded, otherwise query cache content stays inconsistent. | [
"This",
"tries",
"to",
"reset",
"cursor",
"position",
"of",
"the",
"accumulator",
"to",
"the",
"supplied",
"sequence",
"if",
"that",
"sequence",
"is",
"still",
"there",
"it",
"will",
"be",
"succeeded",
"otherwise",
"query",
"cache",
"content",
"stays",
"incons... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/querycache/subscriber/DefaultQueryCache.java#L146-L173 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/utility/visitor/ExceptionTableSensitiveMethodVisitor.java | ExceptionTableSensitiveMethodVisitor.onVisitMethodInsn | @Deprecated
@SuppressWarnings("deprecation")
protected void onVisitMethodInsn(int opcode, String owner, String name, String descriptor) {
"""
Visits a method instruction.
@param opcode The visited opcode.
@param owner The method's owner.
@param name The method's internal name.
@param d... | java | @Deprecated
@SuppressWarnings("deprecation")
protected void onVisitMethodInsn(int opcode, String owner, String name, String descriptor) {
super.visitMethodInsn(opcode, owner, name, descriptor);
} | [
"@",
"Deprecated",
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"protected",
"void",
"onVisitMethodInsn",
"(",
"int",
"opcode",
",",
"String",
"owner",
",",
"String",
"name",
",",
"String",
"descriptor",
")",
"{",
"super",
".",
"visitMethodInsn",
"(",
... | Visits a method instruction.
@param opcode The visited opcode.
@param owner The method's owner.
@param name The method's internal name.
@param descriptor The method's descriptor.
@deprecated Use {@link ExceptionTableSensitiveMethodVisitor#onVisitMethodInsn(int, String, String, String, boolean)} instead. | [
"Visits",
"a",
"method",
"instruction",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/utility/visitor/ExceptionTableSensitiveMethodVisitor.java#L158-L162 |
OpenHFT/Chronicle-Network | src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java | TcpChannelHub.writeAsyncHeader | public void writeAsyncHeader(@NotNull Wire wire, String csp, long cid) {
"""
The writes the meta data to wire - the async version does not contain the tid
@param wire the wire that we will write to
@param csp provide either the csp or the cid
@param cid provide either the csp or the cid
"""
asse... | java | public void writeAsyncHeader(@NotNull Wire wire, String csp, long cid) {
assert outBytesLock().isHeldByCurrentThread();
wire.writeDocument(true, wireOut -> {
if (cid == 0)
wireOut.writeEventName(CoreFields.csp).text(csp);
else
wireOut.writeEventNa... | [
"public",
"void",
"writeAsyncHeader",
"(",
"@",
"NotNull",
"Wire",
"wire",
",",
"String",
"csp",
",",
"long",
"cid",
")",
"{",
"assert",
"outBytesLock",
"(",
")",
".",
"isHeldByCurrentThread",
"(",
")",
";",
"wire",
".",
"writeDocument",
"(",
"true",
",",
... | The writes the meta data to wire - the async version does not contain the tid
@param wire the wire that we will write to
@param csp provide either the csp or the cid
@param cid provide either the csp or the cid | [
"The",
"writes",
"the",
"meta",
"data",
"to",
"wire",
"-",
"the",
"async",
"version",
"does",
"not",
"contain",
"the",
"tid"
] | train | https://github.com/OpenHFT/Chronicle-Network/blob/b50d232a1763b1400d5438c7925dce845e5c387a/src/main/java/net/openhft/chronicle/network/connection/TcpChannelHub.java#L866-L875 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/CoffeeScriptCompilerMojo.java | CoffeeScriptCompilerMojo.execute | @Override
public void execute() throws MojoExecutionException {
"""
Finds and compiles coffeescript files.
@throws MojoExecutionException if the compilation failed.
"""
coffee = npm(this, COFFEE_SCRIPT_NPM_NAME, coffeeScriptVersion);
try {
if (getInternalAssetsDirectory().... | java | @Override
public void execute() throws MojoExecutionException {
coffee = npm(this, COFFEE_SCRIPT_NPM_NAME, coffeeScriptVersion);
try {
if (getInternalAssetsDirectory().isDirectory()) {
getLog().info("Compiling CoffeeScript files from " + getInternalAssetsDirectory().ge... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"coffee",
"=",
"npm",
"(",
"this",
",",
"COFFEE_SCRIPT_NPM_NAME",
",",
"coffeeScriptVersion",
")",
";",
"try",
"{",
"if",
"(",
"getInternalAssetsDirectory",
"(",
")"... | Finds and compiles coffeescript files.
@throws MojoExecutionException if the compilation failed. | [
"Finds",
"and",
"compiles",
"coffeescript",
"files",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/CoffeeScriptCompilerMojo.java#L72-L91 |
GCRC/nunaliit | nunaliit2-utils/src/main/java/ca/carleton/gcrc/utils/StreamUtils.java | StreamUtils.copyStream | static public void copyStream(InputStream is, OutputStream os) throws IOException {
"""
Copy all the bytes from an input stream to an output stream.
@param is Stream to read bytes from
@param os Stream to write bytes to
@throws IOException
"""
copyStream(is, os, DEFAULT_TRANSFER_BUFFER_SIZE);
} | java | static public void copyStream(InputStream is, OutputStream os) throws IOException {
copyStream(is, os, DEFAULT_TRANSFER_BUFFER_SIZE);
} | [
"static",
"public",
"void",
"copyStream",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"copyStream",
"(",
"is",
",",
"os",
",",
"DEFAULT_TRANSFER_BUFFER_SIZE",
")",
";",
"}"
] | Copy all the bytes from an input stream to an output stream.
@param is Stream to read bytes from
@param os Stream to write bytes to
@throws IOException | [
"Copy",
"all",
"the",
"bytes",
"from",
"an",
"input",
"stream",
"to",
"an",
"output",
"stream",
"."
] | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-utils/src/main/java/ca/carleton/gcrc/utils/StreamUtils.java#L19-L21 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/NetworkUtils.java | NetworkUtils.setLearningRate | public static void setLearningRate(MultiLayerNetwork net, int layerNumber, double newLr) {
"""
Set the learning rate for a single layer in the network to the specified value. Note that if any learning rate
schedules are currently present, these will be removed in favor of the new (fixed) learning rate.<br>
<br>
... | java | public static void setLearningRate(MultiLayerNetwork net, int layerNumber, double newLr) {
setLearningRate(net, layerNumber, newLr, null, true);
} | [
"public",
"static",
"void",
"setLearningRate",
"(",
"MultiLayerNetwork",
"net",
",",
"int",
"layerNumber",
",",
"double",
"newLr",
")",
"{",
"setLearningRate",
"(",
"net",
",",
"layerNumber",
",",
"newLr",
",",
"null",
",",
"true",
")",
";",
"}"
] | Set the learning rate for a single layer in the network to the specified value. Note that if any learning rate
schedules are currently present, these will be removed in favor of the new (fixed) learning rate.<br>
<br>
<b>Note</b>: <i>This method not free from a performance point of view</i>: a proper learning rate sche... | [
"Set",
"the",
"learning",
"rate",
"for",
"a",
"single",
"layer",
"in",
"the",
"network",
"to",
"the",
"specified",
"value",
".",
"Note",
"that",
"if",
"any",
"learning",
"rate",
"schedules",
"are",
"currently",
"present",
"these",
"will",
"be",
"removed",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/NetworkUtils.java#L176-L178 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/api/bean/Controls.java | Controls.initializeClient | public static void initializeClient( ClassLoader cl, Object client, ControlBeanContext cbc )
throws ClassNotFoundException {
"""
Helper method for initializing instances of declarative control clients (objects that use controls via @Control
and @EventHandler annotations). This method runs the client-spec... | java | public static void initializeClient( ClassLoader cl, Object client, ControlBeanContext cbc )
throws ClassNotFoundException
{
Class clientClass = client.getClass();
String clientName = clientClass.getName();
if ( cl == null )
cl = clientClass.getClassLoader();
St... | [
"public",
"static",
"void",
"initializeClient",
"(",
"ClassLoader",
"cl",
",",
"Object",
"client",
",",
"ControlBeanContext",
"cbc",
")",
"throws",
"ClassNotFoundException",
"{",
"Class",
"clientClass",
"=",
"client",
".",
"getClass",
"(",
")",
";",
"String",
"c... | Helper method for initializing instances of declarative control clients (objects that use controls via @Control
and @EventHandler annotations). This method runs the client-specific generated ClientInitializer class to do
its initialization work.
@param cl the classloader used to load the ClientInitializer. If null, ... | [
"Helper",
"method",
"for",
"initializing",
"instances",
"of",
"declarative",
"control",
"clients",
"(",
"objects",
"that",
"use",
"controls",
"via",
"@Control",
"and",
"@EventHandler",
"annotations",
")",
".",
"This",
"method",
"runs",
"the",
"client",
"-",
"spe... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/api/bean/Controls.java#L122-L152 |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/base/BaseConstraint.java | BaseConstraint.getValue | protected final String getValue(final String key, final FieldCase ca) throws IdNotFoundException {
"""
Method searches the constraint for the given key, initializes it with the passed FieldCase
and returns this value.
@return return the value of the constrain for the passed key. If the value is {@code null}
r... | java | protected final String getValue(final String key, final FieldCase ca) throws IdNotFoundException {
ConstraintFactory f = generator.getConstraintFactory();
String value = f.getModel(key).initValues(ca);
if (value == null) {
return "";
}
return value;
} | [
"protected",
"final",
"String",
"getValue",
"(",
"final",
"String",
"key",
",",
"final",
"FieldCase",
"ca",
")",
"throws",
"IdNotFoundException",
"{",
"ConstraintFactory",
"f",
"=",
"generator",
".",
"getConstraintFactory",
"(",
")",
";",
"String",
"value",
"=",... | Method searches the constraint for the given key, initializes it with the passed FieldCase
and returns this value.
@return return the value of the constrain for the passed key. If the value is {@code null}
return an empty string | [
"Method",
"searches",
"the",
"constraint",
"for",
"the",
"given",
"key",
"initializes",
"it",
"with",
"the",
"passed",
"FieldCase",
"and",
"returns",
"this",
"value",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/base/BaseConstraint.java#L222-L229 |
google/j2objc | jre_emul/android/frameworks/base/core/java/android/util/SparseBooleanArray.java | SparseBooleanArray.put | public void put(int key, boolean value) {
"""
Adds a mapping from the specified key to the specified value,
replacing the previous mapping from the specified key if there
was one.
"""
int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
if (i >= 0) {
mValues[i] = value;
... | java | public void put(int key, boolean value) {
int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
if (i >= 0) {
mValues[i] = value;
} else {
i = ~i;
if (mSize >= mKeys.length) {
int n = ArrayUtils.idealIntArraySize(mSize + 1);
... | [
"public",
"void",
"put",
"(",
"int",
"key",
",",
"boolean",
"value",
")",
"{",
"int",
"i",
"=",
"ContainerHelpers",
".",
"binarySearch",
"(",
"mKeys",
",",
"mSize",
",",
"key",
")",
";",
"if",
"(",
"i",
">=",
"0",
")",
"{",
"mValues",
"[",
"i",
"... | Adds a mapping from the specified key to the specified value,
replacing the previous mapping from the specified key if there
was one. | [
"Adds",
"a",
"mapping",
"from",
"the",
"specified",
"key",
"to",
"the",
"specified",
"value",
"replacing",
"the",
"previous",
"mapping",
"from",
"the",
"specified",
"key",
"if",
"there",
"was",
"one",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/util/SparseBooleanArray.java#L123-L155 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ContainerServicesInner.java | ContainerServicesInner.beginCreateOrUpdate | public ContainerServiceInner beginCreateOrUpdate(String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) {
"""
Creates or updates a container service.
Creates or updates a container service with the specified configuration of orchestrator, masters, and agents.
@param resourceGr... | java | public ContainerServiceInner beginCreateOrUpdate(String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerServiceName, parameters).toBlocking().single().body();
} | [
"public",
"ContainerServiceInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"containerServiceName",
",",
"ContainerServiceInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"co... | Creates or updates a container service.
Creates or updates a container service with the specified configuration of orchestrator, masters, and agents.
@param resourceGroupName The name of the resource group.
@param containerServiceName The name of the container service in the specified subscription and resource group.
... | [
"Creates",
"or",
"updates",
"a",
"container",
"service",
".",
"Creates",
"or",
"updates",
"a",
"container",
"service",
"with",
"the",
"specified",
"configuration",
"of",
"orchestrator",
"masters",
"and",
"agents",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ContainerServicesInner.java#L310-L312 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/env/DefaultCoreEnvironment.java | DefaultCoreEnvironment.wrapShutdown | private Observable<ShutdownStatus> wrapShutdown(Observable<Boolean> source, final String target) {
"""
This method wraps an Observable of Boolean (for shutdown hook) into an Observable of ShutdownStatus.
It will log each status with a short message indicating which target has been shut down, and the result of
th... | java | private Observable<ShutdownStatus> wrapShutdown(Observable<Boolean> source, final String target) {
return source.
reduce(true, new Func2<Boolean, Boolean, Boolean>() {
@Override
public Boolean call(Boolean previousStatus, Boolean currentStatus) {
... | [
"private",
"Observable",
"<",
"ShutdownStatus",
">",
"wrapShutdown",
"(",
"Observable",
"<",
"Boolean",
">",
"source",
",",
"final",
"String",
"target",
")",
"{",
"return",
"source",
".",
"reduce",
"(",
"true",
",",
"new",
"Func2",
"<",
"Boolean",
",",
"Bo... | This method wraps an Observable of Boolean (for shutdown hook) into an Observable of ShutdownStatus.
It will log each status with a short message indicating which target has been shut down, and the result of
the call. | [
"This",
"method",
"wraps",
"an",
"Observable",
"of",
"Boolean",
"(",
"for",
"shutdown",
"hook",
")",
"into",
"an",
"Observable",
"of",
"ShutdownStatus",
".",
"It",
"will",
"log",
"each",
"status",
"with",
"a",
"short",
"message",
"indicating",
"which",
"targ... | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/env/DefaultCoreEnvironment.java#L719-L745 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java | FastAdapter.notifyAdapterItemRangeRemoved | public void notifyAdapterItemRangeRemoved(int position, int itemCount) {
"""
wraps notifyItemRangeRemoved
@param position the global position
@param itemCount the count of items removed
"""
// handle our extensions
for (IAdapterExtension<Item> ext : mExtensions.values()) {
ext.... | java | public void notifyAdapterItemRangeRemoved(int position, int itemCount) {
// handle our extensions
for (IAdapterExtension<Item> ext : mExtensions.values()) {
ext.notifyAdapterItemRangeRemoved(position, itemCount);
}
cacheSizes();
notifyItemRangeRemoved(position, itemC... | [
"public",
"void",
"notifyAdapterItemRangeRemoved",
"(",
"int",
"position",
",",
"int",
"itemCount",
")",
"{",
"// handle our extensions",
"for",
"(",
"IAdapterExtension",
"<",
"Item",
">",
"ext",
":",
"mExtensions",
".",
"values",
"(",
")",
")",
"{",
"ext",
".... | wraps notifyItemRangeRemoved
@param position the global position
@param itemCount the count of items removed | [
"wraps",
"notifyItemRangeRemoved"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L1303-L1311 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/time/JMTimeUtil.java | JMTimeUtil.getTime | public static String getTime(long epochTimestamp, String timeFormat,
ZoneId zoneId) {
"""
Gets time.
@param epochTimestamp the epoch timestamp
@param timeFormat the time format
@param zoneId the zone id
@return the time
"""
return getTime(epochTimestamp, getDateTimeFormatt... | java | public static String getTime(long epochTimestamp, String timeFormat,
ZoneId zoneId) {
return getTime(epochTimestamp, getDateTimeFormatter(timeFormat),
zoneId);
} | [
"public",
"static",
"String",
"getTime",
"(",
"long",
"epochTimestamp",
",",
"String",
"timeFormat",
",",
"ZoneId",
"zoneId",
")",
"{",
"return",
"getTime",
"(",
"epochTimestamp",
",",
"getDateTimeFormatter",
"(",
"timeFormat",
")",
",",
"zoneId",
")",
";",
"}... | Gets time.
@param epochTimestamp the epoch timestamp
@param timeFormat the time format
@param zoneId the zone id
@return the time | [
"Gets",
"time",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/time/JMTimeUtil.java#L333-L337 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/CmsModelGroupHelper.java | CmsModelGroupHelper.createModelGroup | public static CmsResource createModelGroup(CmsObject cms, CmsADEConfigData configData) throws CmsException {
"""
Creates a new model group resource.<p>
@param cms the current cms context
@param configData the configuration data
@return the new resource
@throws CmsException in case creating the resource f... | java | public static CmsResource createModelGroup(CmsObject cms, CmsADEConfigData configData) throws CmsException {
CmsResourceTypeConfig typeConfig = configData.getResourceType(
CmsResourceTypeXmlContainerPage.MODEL_GROUP_TYPE_NAME);
return typeConfig.createNewElement(cms, configData.getBasePath(... | [
"public",
"static",
"CmsResource",
"createModelGroup",
"(",
"CmsObject",
"cms",
",",
"CmsADEConfigData",
"configData",
")",
"throws",
"CmsException",
"{",
"CmsResourceTypeConfig",
"typeConfig",
"=",
"configData",
".",
"getResourceType",
"(",
"CmsResourceTypeXmlContainerPage... | Creates a new model group resource.<p>
@param cms the current cms context
@param configData the configuration data
@return the new resource
@throws CmsException in case creating the resource fails | [
"Creates",
"a",
"new",
"model",
"group",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/CmsModelGroupHelper.java#L133-L138 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Graphics.java | Graphics.drawString | public void drawString(String str, float x, float y) {
"""
Draw a string to the screen using the current font
@param str
The string to draw
@param x
The x coordinate to draw the string at
@param y
The y coordinate to draw the string at
"""
predraw();
font.drawString(x, y, str, currentColor);
p... | java | public void drawString(String str, float x, float y) {
predraw();
font.drawString(x, y, str, currentColor);
postdraw();
} | [
"public",
"void",
"drawString",
"(",
"String",
"str",
",",
"float",
"x",
",",
"float",
"y",
")",
"{",
"predraw",
"(",
")",
";",
"font",
".",
"drawString",
"(",
"x",
",",
"y",
",",
"str",
",",
"currentColor",
")",
";",
"postdraw",
"(",
")",
";",
"... | Draw a string to the screen using the current font
@param str
The string to draw
@param x
The x coordinate to draw the string at
@param y
The y coordinate to draw the string at | [
"Draw",
"a",
"string",
"to",
"the",
"screen",
"using",
"the",
"current",
"font"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Graphics.java#L1364-L1368 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuSurfRefSetArray | public static int cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, int Flags ) {
"""
Sets the CUDA array for a surface reference.
<pre>
CUresult cuSurfRefSetArray (
CUsurfref hSurfRef,
CUarray hArray,
unsigned int Flags )
</pre>
<div>
<p>Sets the CUDA array for a surface
reference. Sets the CUDA ... | java | public static int cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, int Flags )
{
return checkResult(cuSurfRefSetArrayNative(hSurfRef, hArray, Flags));
} | [
"public",
"static",
"int",
"cuSurfRefSetArray",
"(",
"CUsurfref",
"hSurfRef",
",",
"CUarray",
"hArray",
",",
"int",
"Flags",
")",
"{",
"return",
"checkResult",
"(",
"cuSurfRefSetArrayNative",
"(",
"hSurfRef",
",",
"hArray",
",",
"Flags",
")",
")",
";",
"}"
] | Sets the CUDA array for a surface reference.
<pre>
CUresult cuSurfRefSetArray (
CUsurfref hSurfRef,
CUarray hArray,
unsigned int Flags )
</pre>
<div>
<p>Sets the CUDA array for a surface
reference. Sets the CUDA array <tt>hArray</tt> to be read and written
by the surface reference <tt>hSurfRef</tt>. Any previous CUD... | [
"Sets",
"the",
"CUDA",
"array",
"for",
"a",
"surface",
"reference",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L10876-L10879 |
wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java | Result.with | public Result with(String headerName, String headerContent) {
"""
Sets a header. If this header was already set, the value is overridden.
@param headerName the header name
@param headerContent the header value
@return the current result.
"""
headers.put(headerName, headerContent);
retur... | java | public Result with(String headerName, String headerContent) {
headers.put(headerName, headerContent);
return this;
} | [
"public",
"Result",
"with",
"(",
"String",
"headerName",
",",
"String",
"headerContent",
")",
"{",
"headers",
".",
"put",
"(",
"headerName",
",",
"headerContent",
")",
";",
"return",
"this",
";",
"}"
] | Sets a header. If this header was already set, the value is overridden.
@param headerName the header name
@param headerContent the header value
@return the current result. | [
"Sets",
"a",
"header",
".",
"If",
"this",
"header",
"was",
"already",
"set",
"the",
"value",
"is",
"overridden",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java#L291-L294 |
infinispan/infinispan | server/integration/commons/src/main/java/org/infinispan/server/commons/msc/ServiceContainerHelper.java | ServiceContainerHelper.findValue | public static <T> T findValue(ServiceRegistry registry, ServiceName name) {
"""
Returns the value of the specified service, if the service exists and is started.
@param registry the service registry
@param name the service name
@return the service value, if the service exists and is started, null otherwise
... | java | public static <T> T findValue(ServiceRegistry registry, ServiceName name) {
ServiceController<T> service = findService(registry, name);
return ((service != null) && (service.getState() == State.UP)) ? service.getValue() : null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"findValue",
"(",
"ServiceRegistry",
"registry",
",",
"ServiceName",
"name",
")",
"{",
"ServiceController",
"<",
"T",
">",
"service",
"=",
"findService",
"(",
"registry",
",",
"name",
")",
";",
"return",
"(",
"(",
... | Returns the value of the specified service, if the service exists and is started.
@param registry the service registry
@param name the service name
@return the service value, if the service exists and is started, null otherwise | [
"Returns",
"the",
"value",
"of",
"the",
"specified",
"service",
"if",
"the",
"service",
"exists",
"and",
"is",
"started",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/integration/commons/src/main/java/org/infinispan/server/commons/msc/ServiceContainerHelper.java#L69-L72 |
inkstand-io/scribble | scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/builder/JNDIContentRepositoryBuilder.java | JNDIContentRepositoryBuilder.withSecurityPrincipal | public JNDIContentRepositoryBuilder withSecurityPrincipal(final String principalName, final String credentials) {
"""
Sets the context properties for SECURITY_PRINCIPAL and SECURITY_CREDENTIAL to perform the lookup. This method is
a convenience for setting the properties SECURITY_PRINCIPAL and SECURITY_CREDENTIAL... | java | public JNDIContentRepositoryBuilder withSecurityPrincipal(final String principalName, final String credentials) {
contextProperties.put(Context.SECURITY_PRINCIPAL, principalName);
contextProperties.put(Context.SECURITY_CREDENTIALS, credentials);
return this;
} | [
"public",
"JNDIContentRepositoryBuilder",
"withSecurityPrincipal",
"(",
"final",
"String",
"principalName",
",",
"final",
"String",
"credentials",
")",
"{",
"contextProperties",
".",
"put",
"(",
"Context",
".",
"SECURITY_PRINCIPAL",
",",
"principalName",
")",
";",
"co... | Sets the context properties for SECURITY_PRINCIPAL and SECURITY_CREDENTIAL to perform the lookup. This method is
a convenience for setting the properties SECURITY_PRINCIPAL and SECURITY_CREDENTIAL on the environment.
@param principalName
the principal name to use to perform the lookup
@param credentials
the credential... | [
"Sets",
"the",
"context",
"properties",
"for",
"SECURITY_PRINCIPAL",
"and",
"SECURITY_CREDENTIAL",
"to",
"perform",
"the",
"lookup",
".",
"This",
"method",
"is",
"a",
"convenience",
"for",
"setting",
"the",
"properties",
"SECURITY_PRINCIPAL",
"and",
"SECURITY_CREDENTI... | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/builder/JNDIContentRepositoryBuilder.java#L190-L195 |
sksamuel/scrimage | scrimage-filters/src/main/java/thirdparty/jhlabs/math/NoiseInstance.java | NoiseInstance.turbulence2 | public float turbulence2(float x, float y, float octaves) {
"""
Compute turbulence using Perlin noise.
@param x the x value
@param y the y value
@param octaves number of octaves of turbulence
@return turbulence value at (x,y)
"""
float t = 0.0f;
for (float f = 1.0f; f <= octa... | java | public float turbulence2(float x, float y, float octaves) {
float t = 0.0f;
for (float f = 1.0f; f <= octaves; f *= 2)
t += Math.abs(noise2(f * x, f * y)) / f;
return t;
} | [
"public",
"float",
"turbulence2",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"octaves",
")",
"{",
"float",
"t",
"=",
"0.0f",
";",
"for",
"(",
"float",
"f",
"=",
"1.0f",
";",
"f",
"<=",
"octaves",
";",
"f",
"*=",
"2",
")",
"t",
"+=",
"M... | Compute turbulence using Perlin noise.
@param x the x value
@param y the y value
@param octaves number of octaves of turbulence
@return turbulence value at (x,y) | [
"Compute",
"turbulence",
"using",
"Perlin",
"noise",
"."
] | train | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/jhlabs/math/NoiseInstance.java#L52-L58 |
dmerkushov/log-helper | src/main/java/ru/dmerkushov/loghelper/configure/loggerwrapper/LoggerWrapperConfigurator.java | LoggerWrapperConfigurator.getConfigurationOptionValue | public String getConfigurationOptionValue (String optionName, String defaultValue) {
"""
Get a configuration option value as String.
@param optionName
@param defaultValue
@return The configuration option node value, or <code>defaultValue</code> if it does not exist
"""
String optionValue;
Node configura... | java | public String getConfigurationOptionValue (String optionName, String defaultValue) {
String optionValue;
Node configurationOption = this.getConfigurationOption (optionName);
if (configurationOption != null) {
optionValue = configurationOption.getTextContent ();
} else {
optionValue = defaultValue;
}
r... | [
"public",
"String",
"getConfigurationOptionValue",
"(",
"String",
"optionName",
",",
"String",
"defaultValue",
")",
"{",
"String",
"optionValue",
";",
"Node",
"configurationOption",
"=",
"this",
".",
"getConfigurationOption",
"(",
"optionName",
")",
";",
"if",
"(",
... | Get a configuration option value as String.
@param optionName
@param defaultValue
@return The configuration option node value, or <code>defaultValue</code> if it does not exist | [
"Get",
"a",
"configuration",
"option",
"value",
"as",
"String",
"."
] | train | https://github.com/dmerkushov/log-helper/blob/3b7d3d30faa7f1437b27cd07c10fa579a995de23/src/main/java/ru/dmerkushov/loghelper/configure/loggerwrapper/LoggerWrapperConfigurator.java#L100-L109 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/url/JPAWSJarURLConnection.java | JPAWSJarURLConnection.getInputStream | @Override
public synchronized InputStream getInputStream() throws IOException {
"""
/*
Passthrough operations for archive referencing wsjar URL support. Synchronized because calling getInputStream()
while an InputStream is still active should return the active InputStream.
"""
if (connected == fa... | java | @Override
public synchronized InputStream getInputStream() throws IOException {
if (connected == false) {
// Implicitly open the connection if it has not yet been done so.
connect();
}
Object token = ThreadIdentityManager.runAsServer();
try {
if (... | [
"@",
"Override",
"public",
"synchronized",
"InputStream",
"getInputStream",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"connected",
"==",
"false",
")",
"{",
"// Implicitly open the connection if it has not yet been done so.",
"connect",
"(",
")",
";",
"}",
"Ob... | /*
Passthrough operations for archive referencing wsjar URL support. Synchronized because calling getInputStream()
while an InputStream is still active should return the active InputStream. | [
"/",
"*",
"Passthrough",
"operations",
"for",
"archive",
"referencing",
"wsjar",
"URL",
"support",
".",
"Synchronized",
"because",
"calling",
"getInputStream",
"()",
"while",
"an",
"InputStream",
"is",
"still",
"active",
"should",
"return",
"the",
"active",
"Input... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/url/JPAWSJarURLConnection.java#L63-L84 |
nextreports/nextreports-engine | src/ro/nextreports/engine/chart/Chart.java | Chart.getI18nkeys | public List<String> getI18nkeys() {
"""
Get keys for internationalized strings
@return list of keys for internationalized strings
"""
if (i18nkeys == null) {
return new ArrayList<String>();
}
Collections.sort(i18nkeys, new Comparator<String>() {
@Override
public int compare(Strin... | java | public List<String> getI18nkeys() {
if (i18nkeys == null) {
return new ArrayList<String>();
}
Collections.sort(i18nkeys, new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
return Collator.getInstance().compare(o1, o2);
}
});
return i18nkeys;
} | [
"public",
"List",
"<",
"String",
">",
"getI18nkeys",
"(",
")",
"{",
"if",
"(",
"i18nkeys",
"==",
"null",
")",
"{",
"return",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"}",
"Collections",
".",
"sort",
"(",
"i18nkeys",
",",
"new",
"Compara... | Get keys for internationalized strings
@return list of keys for internationalized strings | [
"Get",
"keys",
"for",
"internationalized",
"strings"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/chart/Chart.java#L666-L678 |
Harium/keel | src/main/java/jdt/triangulation/DelaunayTriangulation.java | DelaunayTriangulation.findConnectedTriangles | private List<Triangle> findConnectedTriangles(Vector3 point) {
"""
/*
Receives a point and returns all the points of the triangles that
shares point as a corner (Connected vertices to this point).
By Doron Ganel & Eyal Roth
"""
// Getting one of the neigh
Triangle triangle = find(point);
// V... | java | private List<Triangle> findConnectedTriangles(Vector3 point) {
// Getting one of the neigh
Triangle triangle = find(point);
// Validating find results.
if (!triangle.isCorner(point)) {
System.err.println("findConnectedTriangles: Could not find connected vertices since the first found triangle doesn'... | [
"private",
"List",
"<",
"Triangle",
">",
"findConnectedTriangles",
"(",
"Vector3",
"point",
")",
"{",
"// Getting one of the neigh\r",
"Triangle",
"triangle",
"=",
"find",
"(",
"point",
")",
";",
"// Validating find results.\r",
"if",
"(",
"!",
"triangle",
".",
"i... | /*
Receives a point and returns all the points of the triangles that
shares point as a corner (Connected vertices to this point).
By Doron Ganel & Eyal Roth | [
"/",
"*",
"Receives",
"a",
"point",
"and",
"returns",
"all",
"the",
"points",
"of",
"the",
"triangles",
"that",
"shares",
"point",
"as",
"a",
"corner",
"(",
"Connected",
"vertices",
"to",
"this",
"point",
")",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/jdt/triangulation/DelaunayTriangulation.java#L1130-L1143 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/bidiagonal/BidiagonalDecompositionRow_DDRM.java | BidiagonalDecompositionRow_DDRM.getU | @Override
public DMatrixRMaj getU(DMatrixRMaj U , boolean transpose , boolean compact ) {
"""
Returns the orthogonal U matrix.
@param U If not null then the results will be stored here. Otherwise a new matrix will be created.
@return The extracted Q matrix.
"""
U = handleU(U, transpose, compac... | java | @Override
public DMatrixRMaj getU(DMatrixRMaj U , boolean transpose , boolean compact ) {
U = handleU(U, transpose, compact,m,n,min);
CommonOps_DDRM.setIdentity(U);
for( int i = 0; i < m; i++ ) u[i] = 0;
for( int j = min-1; j >= 0; j-- ) {
u[j] = 1;
for( int... | [
"@",
"Override",
"public",
"DMatrixRMaj",
"getU",
"(",
"DMatrixRMaj",
"U",
",",
"boolean",
"transpose",
",",
"boolean",
"compact",
")",
"{",
"U",
"=",
"handleU",
"(",
"U",
",",
"transpose",
",",
"compact",
",",
"m",
",",
"n",
",",
"min",
")",
";",
"C... | Returns the orthogonal U matrix.
@param U If not null then the results will be stored here. Otherwise a new matrix will be created.
@return The extracted Q matrix. | [
"Returns",
"the",
"orthogonal",
"U",
"matrix",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/bidiagonal/BidiagonalDecompositionRow_DDRM.java#L181-L200 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/util/MenuUtil.java | MenuUtil.getPath | private static void getPath(BaseComponent comp, StringBuilder sb) {
"""
Recurses parent menu nodes to build the menu path.
@param comp Current component in menu tree.
@param sb String builder to receive path.
"""
while (comp instanceof BaseMenuComponent) {
sb.insert(0, "\\" + ((BaseMenu... | java | private static void getPath(BaseComponent comp, StringBuilder sb) {
while (comp instanceof BaseMenuComponent) {
sb.insert(0, "\\" + ((BaseMenuComponent) comp).getLabel());
comp = comp.getParent();
}
} | [
"private",
"static",
"void",
"getPath",
"(",
"BaseComponent",
"comp",
",",
"StringBuilder",
"sb",
")",
"{",
"while",
"(",
"comp",
"instanceof",
"BaseMenuComponent",
")",
"{",
"sb",
".",
"insert",
"(",
"0",
",",
"\"\\\\\"",
"+",
"(",
"(",
"BaseMenuComponent",... | Recurses parent menu nodes to build the menu path.
@param comp Current component in menu tree.
@param sb String builder to receive path. | [
"Recurses",
"parent",
"menu",
"nodes",
"to",
"build",
"the",
"menu",
"path",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/util/MenuUtil.java#L164-L169 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.drawButton | public void drawButton(float llx, float lly, float urx, float ury, String text, BaseFont bf, float size) {
"""
Draws a button.
@param llx
@param lly
@param urx
@param ury
@param text
@param bf
@param size
"""
if (llx > urx) { float x = llx; llx = urx; urx = x; }
if (lly > ury) { float y ... | java | public void drawButton(float llx, float lly, float urx, float ury, String text, BaseFont bf, float size) {
if (llx > urx) { float x = llx; llx = urx; urx = x; }
if (lly > ury) { float y = lly; lly = ury; ury = y; }
// black rectangle not filled
setColorStroke(new Color(0x00, 0x00, 0x00))... | [
"public",
"void",
"drawButton",
"(",
"float",
"llx",
",",
"float",
"lly",
",",
"float",
"urx",
",",
"float",
"ury",
",",
"String",
"text",
",",
"BaseFont",
"bf",
",",
"float",
"size",
")",
"{",
"if",
"(",
"llx",
">",
"urx",
")",
"{",
"float",
"x",
... | Draws a button.
@param llx
@param lly
@param urx
@param ury
@param text
@param bf
@param size | [
"Draws",
"a",
"button",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L2746-L2783 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Animation.java | Animation.addFrame | public void addFrame(int duration, int x, int y) {
"""
Add animation frame to the animation.
@param duration The duration to display the frame for
@param x The x location of the frame on the <tt>SpriteSheet</tt>
@param y The y location of the frame on the <tt>spriteSheet</tt>
"""
if (duration == 0) {
... | java | public void addFrame(int duration, int x, int y){
if (duration == 0) {
Log.error("Invalid duration: "+duration);
throw new RuntimeException("Invalid duration: "+duration);
}
if (frames.isEmpty()) {
nextChange = (int) (duration / speed);
}
frames.add(new Frame(... | [
"public",
"void",
"addFrame",
"(",
"int",
"duration",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"duration",
"==",
"0",
")",
"{",
"Log",
".",
"error",
"(",
"\"Invalid duration: \"",
"+",
"duration",
")",
";",
"throw",
"new",
"RuntimeExcepti... | Add animation frame to the animation.
@param duration The duration to display the frame for
@param x The x location of the frame on the <tt>SpriteSheet</tt>
@param y The y location of the frame on the <tt>spriteSheet</tt> | [
"Add",
"animation",
"frame",
"to",
"the",
"animation",
"."
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Animation.java#L185-L197 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/JapaneseChronology.java | JapaneseChronology.dateYearDay | @Override
public JapaneseDate dateYearDay(int prolepticYear, int dayOfYear) {
"""
Obtains a local date in Japanese calendar system from the
proleptic-year and day-of-year fields.
<p>
The day-of-year in this factory is expressed relative to the start of the proleptic year.
The Japanese proleptic year and da... | java | @Override
public JapaneseDate dateYearDay(int prolepticYear, int dayOfYear) {
LocalDate date = LocalDate.ofYearDay(prolepticYear, dayOfYear);
return date(prolepticYear, date.getMonthValue(), date.getDayOfMonth());
} | [
"@",
"Override",
"public",
"JapaneseDate",
"dateYearDay",
"(",
"int",
"prolepticYear",
",",
"int",
"dayOfYear",
")",
"{",
"LocalDate",
"date",
"=",
"LocalDate",
".",
"ofYearDay",
"(",
"prolepticYear",
",",
"dayOfYear",
")",
";",
"return",
"date",
"(",
"prolept... | Obtains a local date in Japanese calendar system from the
proleptic-year and day-of-year fields.
<p>
The day-of-year in this factory is expressed relative to the start of the proleptic year.
The Japanese proleptic year and day-of-year are the same as those in the ISO calendar system.
They are not reset when the era cha... | [
"Obtains",
"a",
"local",
"date",
"in",
"Japanese",
"calendar",
"system",
"from",
"the",
"proleptic",
"-",
"year",
"and",
"day",
"-",
"of",
"-",
"year",
"fields",
".",
"<p",
">",
"The",
"day",
"-",
"of",
"-",
"year",
"in",
"this",
"factory",
"is",
"ex... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/JapaneseChronology.java#L256-L260 |
kiegroup/droolsjbpm-knowledge | kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/DeploymentDescriptorIO.java | DeploymentDescriptorIO.fromXml | public static DeploymentDescriptor fromXml(InputStream inputStream) {
"""
Reads XML data from given input stream and produces valid instance of
<code>DeploymentDescriptor</code>
@param inputStream input stream that comes with xml data of the descriptor
@return instance of the descriptor after deserialization
... | java | public static DeploymentDescriptor fromXml(InputStream inputStream) {
try {
Unmarshaller unmarshaller = getContext().createUnmarshaller();
unmarshaller.setSchema(schema);
DeploymentDescriptor descriptor = (DeploymentDescriptor) unmarshaller.unmarshal(inputStream);
... | [
"public",
"static",
"DeploymentDescriptor",
"fromXml",
"(",
"InputStream",
"inputStream",
")",
"{",
"try",
"{",
"Unmarshaller",
"unmarshaller",
"=",
"getContext",
"(",
")",
".",
"createUnmarshaller",
"(",
")",
";",
"unmarshaller",
".",
"setSchema",
"(",
"schema",
... | Reads XML data from given input stream and produces valid instance of
<code>DeploymentDescriptor</code>
@param inputStream input stream that comes with xml data of the descriptor
@return instance of the descriptor after deserialization | [
"Reads",
"XML",
"data",
"from",
"given",
"input",
"stream",
"and",
"produces",
"valid",
"instance",
"of",
"<code",
">",
"DeploymentDescriptor<",
"/",
"code",
">"
] | train | https://github.com/kiegroup/droolsjbpm-knowledge/blob/fbe6de817c9f27cd4f6ef07e808e5c7bc946d4e5/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/DeploymentDescriptorIO.java#L51-L61 |
google/error-prone | check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java | ASTHelpers.containsComments | public static boolean containsComments(Tree tree, VisitorState state) {
"""
Returns whether the given {@code tree} contains any comments in its source.
"""
return ErrorProneTokens.getTokens(state.getSourceForNode(tree), state.context).stream()
.anyMatch(t -> !t.comments().isEmpty());
} | java | public static boolean containsComments(Tree tree, VisitorState state) {
return ErrorProneTokens.getTokens(state.getSourceForNode(tree), state.context).stream()
.anyMatch(t -> !t.comments().isEmpty());
} | [
"public",
"static",
"boolean",
"containsComments",
"(",
"Tree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"return",
"ErrorProneTokens",
".",
"getTokens",
"(",
"state",
".",
"getSourceForNode",
"(",
"tree",
")",
",",
"state",
".",
"context",
")",
".",
"... | Returns whether the given {@code tree} contains any comments in its source. | [
"Returns",
"whether",
"the",
"given",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java#L1646-L1649 |
carewebframework/carewebframework-core | org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BinaryTransform.java | BinaryTransform.readWord | protected int readWord(byte[] data, int offset) {
"""
Reads a two-byte integer from a byte array at the specified offset.
@param data The source data.
@param offset The byte offset.
@return A two-byte integer value.
"""
int low = data[offset] & 0xff;
int high = data[offset + 1] & 0xff;
... | java | protected int readWord(byte[] data, int offset) {
int low = data[offset] & 0xff;
int high = data[offset + 1] & 0xff;
return high << 8 | low;
} | [
"protected",
"int",
"readWord",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"int",
"low",
"=",
"data",
"[",
"offset",
"]",
"&",
"0xff",
";",
"int",
"high",
"=",
"data",
"[",
"offset",
"+",
"1",
"]",
"&",
"0xff",
";",
"return",
... | Reads a two-byte integer from a byte array at the specified offset.
@param data The source data.
@param offset The byte offset.
@return A two-byte integer value. | [
"Reads",
"a",
"two",
"-",
"byte",
"integer",
"from",
"a",
"byte",
"array",
"at",
"the",
"specified",
"offset",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BinaryTransform.java#L96-L100 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java | TemplatedURLFormatter.initServletContext | public static void initServletContext( ServletContext servletContext, TemplatedURLFormatter formatter ) {
"""
Adds a given TemplatedURLFormatter instance as an attribute on the ServletContext.
@param servletContext the current ServletContext.
@param formatter the TemplatedURLFormatter instance to add as an att... | java | public static void initServletContext( ServletContext servletContext, TemplatedURLFormatter formatter )
{
assert servletContext != null : "The ServletContext cannot be null.";
if ( servletContext == null )
{
throw new IllegalArgumentException( "The ServletContext cannot be null.... | [
"public",
"static",
"void",
"initServletContext",
"(",
"ServletContext",
"servletContext",
",",
"TemplatedURLFormatter",
"formatter",
")",
"{",
"assert",
"servletContext",
"!=",
"null",
":",
"\"The ServletContext cannot be null.\"",
";",
"if",
"(",
"servletContext",
"==",... | Adds a given TemplatedURLFormatter instance as an attribute on the ServletContext.
@param servletContext the current ServletContext.
@param formatter the TemplatedURLFormatter instance to add as an attribute of the context | [
"Adds",
"a",
"given",
"TemplatedURLFormatter",
"instance",
"as",
"an",
"attribute",
"on",
"the",
"ServletContext",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java#L95-L105 |
JCTools/JCTools | jctools-build/src/main/java/org/jctools/queues/atomic/JavaParsingAtomicArrayQueueGenerator.java | JavaParsingAtomicArrayQueueGenerator.processSpecialNodeTypes | void processSpecialNodeTypes(NodeWithType<?, Type> node, String name) {
"""
Given a variable declaration of some sort, check it's name and type and
if it looks like any of the key type changes between unsafe and atomic
queues, perform the conversion to change it's type.
@param node
@param name
"""
... | java | void processSpecialNodeTypes(NodeWithType<?, Type> node, String name) {
Type type = node.getType();
if ("buffer".equals(name) && isRefArray(type, "E")) {
node.setType(atomicRefArrayType((ArrayType) type));
} else if ("sBuffer".equals(name) && isLongArray(type)) {
node.set... | [
"void",
"processSpecialNodeTypes",
"(",
"NodeWithType",
"<",
"?",
",",
"Type",
">",
"node",
",",
"String",
"name",
")",
"{",
"Type",
"type",
"=",
"node",
".",
"getType",
"(",
")",
";",
"if",
"(",
"\"buffer\"",
".",
"equals",
"(",
"name",
")",
"&&",
"... | Given a variable declaration of some sort, check it's name and type and
if it looks like any of the key type changes between unsafe and atomic
queues, perform the conversion to change it's type.
@param node
@param name | [
"Given",
"a",
"variable",
"declaration",
"of",
"some",
"sort",
"check",
"it",
"s",
"name",
"and",
"type",
"and",
"if",
"it",
"looks",
"like",
"any",
"of",
"the",
"key",
"type",
"changes",
"between",
"unsafe",
"and",
"atomic",
"queues",
"perform",
"the",
... | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-build/src/main/java/org/jctools/queues/atomic/JavaParsingAtomicArrayQueueGenerator.java#L132-L148 |
virgo47/javasimon | jdbc41/src/main/java/org/javasimon/jdbc4/SimonConnection.java | SimonConnection.prepareCall | @Override
public CallableStatement prepareCall(String sql) throws SQLException {
"""
Calls real prepareCall and wraps returned statement by Simon's statement.
@param sql an SQL statement, typically a JDBC function call escape string
@return Simon's statement with wrapped real statement
@throws java.sql.SQLEx... | java | @Override
public CallableStatement prepareCall(String sql) throws SQLException {
return new SimonCallableStatement(conn, conn.prepareCall(sql), sql, prefix);
} | [
"@",
"Override",
"public",
"CallableStatement",
"prepareCall",
"(",
"String",
"sql",
")",
"throws",
"SQLException",
"{",
"return",
"new",
"SimonCallableStatement",
"(",
"conn",
",",
"conn",
".",
"prepareCall",
"(",
"sql",
")",
",",
"sql",
",",
"prefix",
")",
... | Calls real prepareCall and wraps returned statement by Simon's statement.
@param sql an SQL statement, typically a JDBC function call escape string
@return Simon's statement with wrapped real statement
@throws java.sql.SQLException if real operation fails | [
"Calls",
"real",
"prepareCall",
"and",
"wraps",
"returned",
"statement",
"by",
"Simon",
"s",
"statement",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/jdbc41/src/main/java/org/javasimon/jdbc4/SimonConnection.java#L252-L255 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java | ST_LineIntersector.add | private static void add(LineString line, int flag, ArrayList<SegmentString> segments) {
"""
Convert a linestring as a list of segments and mark it with a flag
@param line
@param flag
@param segments
"""
SegmentString ss = new NodedSegmentString(line.getCoordinates(),
flag);
s... | java | private static void add(LineString line, int flag, ArrayList<SegmentString> segments) {
SegmentString ss = new NodedSegmentString(line.getCoordinates(),
flag);
segments.add(ss);
} | [
"private",
"static",
"void",
"add",
"(",
"LineString",
"line",
",",
"int",
"flag",
",",
"ArrayList",
"<",
"SegmentString",
">",
"segments",
")",
"{",
"SegmentString",
"ss",
"=",
"new",
"NodedSegmentString",
"(",
"line",
".",
"getCoordinates",
"(",
")",
",",
... | Convert a linestring as a list of segments and mark it with a flag
@param line
@param flag
@param segments | [
"Convert",
"a",
"linestring",
"as",
"a",
"list",
"of",
"segments",
"and",
"mark",
"it",
"with",
"a",
"flag"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java#L144-L148 |
UrielCh/ovh-java-sdk | ovh-java-sdk-overTheBox/src/main/java/net/minidev/ovh/api/ApiOvhOverTheBox.java | ApiOvhOverTheBox.serviceName_remoteAccesses_remoteAccessId_GET | public OvhRemoteAccess serviceName_remoteAccesses_remoteAccessId_GET(String serviceName, String remoteAccessId) throws IOException {
"""
Get this object properties
REST: GET /overTheBox/{serviceName}/remoteAccesses/{remoteAccessId}
@param serviceName [required] The internal name of your overTheBox offer
@para... | java | public OvhRemoteAccess serviceName_remoteAccesses_remoteAccessId_GET(String serviceName, String remoteAccessId) throws IOException {
String qPath = "/overTheBox/{serviceName}/remoteAccesses/{remoteAccessId}";
StringBuilder sb = path(qPath, serviceName, remoteAccessId);
String resp = exec(qPath, "GET", sb.toString... | [
"public",
"OvhRemoteAccess",
"serviceName_remoteAccesses_remoteAccessId_GET",
"(",
"String",
"serviceName",
",",
"String",
"remoteAccessId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/overTheBox/{serviceName}/remoteAccesses/{remoteAccessId}\"",
";",
"StringBui... | Get this object properties
REST: GET /overTheBox/{serviceName}/remoteAccesses/{remoteAccessId}
@param serviceName [required] The internal name of your overTheBox offer
@param remoteAccessId [required] The id of the remote access | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-overTheBox/src/main/java/net/minidev/ovh/api/ApiOvhOverTheBox.java#L281-L286 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_phoneCanBeAssociable_GET | public ArrayList<OvhLinePhone> billingAccount_line_serviceName_phoneCanBeAssociable_GET(String billingAccount, String serviceName) throws IOException {
"""
List the phones with Sip slot available
REST: GET /telephony/{billingAccount}/line/{serviceName}/phoneCanBeAssociable
@param billingAccount [required] The ... | java | public ArrayList<OvhLinePhone> billingAccount_line_serviceName_phoneCanBeAssociable_GET(String billingAccount, String serviceName) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/phoneCanBeAssociable";
StringBuilder sb = path(qPath, billingAccount, serviceName);
String resp = e... | [
"public",
"ArrayList",
"<",
"OvhLinePhone",
">",
"billingAccount_line_serviceName_phoneCanBeAssociable_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/line/{serviceNam... | List the phones with Sip slot available
REST: GET /telephony/{billingAccount}/line/{serviceName}/phoneCanBeAssociable
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@deprecated | [
"List",
"the",
"phones",
"with",
"Sip",
"slot",
"available"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L1525-L1530 |
apereo/cas | support/cas-server-support-wsfederation/src/main/java/org/apereo/cas/support/wsfederation/web/WsFederationNavigationController.java | WsFederationNavigationController.redirectToProvider | @GetMapping(ENDPOINT_REDIRECT)
public View redirectToProvider(final HttpServletRequest request, final HttpServletResponse response) {
"""
Redirect to provider. Receive the client name from the request and then try to determine and build the endpoint url
for the redirection. The redirection data/url must conta... | java | @GetMapping(ENDPOINT_REDIRECT)
public View redirectToProvider(final HttpServletRequest request, final HttpServletResponse response) {
val wsfedId = request.getParameter(PARAMETER_NAME);
try {
val cfg = configurations.stream().filter(c -> c.getId().equals(wsfedId)).findFirst().orElse(null... | [
"@",
"GetMapping",
"(",
"ENDPOINT_REDIRECT",
")",
"public",
"View",
"redirectToProvider",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
")",
"{",
"val",
"wsfedId",
"=",
"request",
".",
"getParameter",
"(",
"PARAMETER... | Redirect to provider. Receive the client name from the request and then try to determine and build the endpoint url
for the redirection. The redirection data/url must contain a delegated client ticket id so that the request be can
restored on the trip back. SAML clients use the relay-state session attribute while other... | [
"Redirect",
"to",
"provider",
".",
"Receive",
"the",
"client",
"name",
"from",
"the",
"request",
"and",
"then",
"try",
"to",
"determine",
"and",
"build",
"the",
"endpoint",
"url",
"for",
"the",
"redirection",
".",
"The",
"redirection",
"data",
"/",
"url",
... | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-wsfederation/src/main/java/org/apereo/cas/support/wsfederation/web/WsFederationNavigationController.java#L63-L80 |
sevensource/html-email-service | src/main/java/org/sevensource/commons/email/model/DefaultEmailModel.java | DefaultEmailModel.setFrom | public void setFrom(String address, String personal) throws AddressException {
"""
set the From address of the email
@param address a valid email address
@param personal the real world name of the sender (can be null)
@throws AddressException in case of an invalid email address
"""
from = toInternetAddr... | java | public void setFrom(String address, String personal) throws AddressException {
from = toInternetAddress(address, personal);
} | [
"public",
"void",
"setFrom",
"(",
"String",
"address",
",",
"String",
"personal",
")",
"throws",
"AddressException",
"{",
"from",
"=",
"toInternetAddress",
"(",
"address",
",",
"personal",
")",
";",
"}"
] | set the From address of the email
@param address a valid email address
@param personal the real world name of the sender (can be null)
@throws AddressException in case of an invalid email address | [
"set",
"the",
"From",
"address",
"of",
"the",
"email"
] | train | https://github.com/sevensource/html-email-service/blob/a55d9ef1a2173917cb5f870854bc24e5aaebd182/src/main/java/org/sevensource/commons/email/model/DefaultEmailModel.java#L71-L73 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/metadata/DescriptorRepository.java | DescriptorRepository.addExtent | void addExtent(String classname, ClassDescriptor cld) {
"""
Add a pair of extent/classdescriptor to the extentTable to gain speed
while retrieval of extents.
@param classname the name of the extent itself
@param cld the class descriptor, where it belongs to
"""
synchronized (extentTable)
{... | java | void addExtent(String classname, ClassDescriptor cld)
{
synchronized (extentTable)
{
extentTable.put(classname, cld);
}
} | [
"void",
"addExtent",
"(",
"String",
"classname",
",",
"ClassDescriptor",
"cld",
")",
"{",
"synchronized",
"(",
"extentTable",
")",
"{",
"extentTable",
".",
"put",
"(",
"classname",
",",
"cld",
")",
";",
"}",
"}"
] | Add a pair of extent/classdescriptor to the extentTable to gain speed
while retrieval of extents.
@param classname the name of the extent itself
@param cld the class descriptor, where it belongs to | [
"Add",
"a",
"pair",
"of",
"extent",
"/",
"classdescriptor",
"to",
"the",
"extentTable",
"to",
"gain",
"speed",
"while",
"retrieval",
"of",
"extents",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/DescriptorRepository.java#L98-L104 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java | NotificationHubsInner.debugSend | public DebugSendResponseInner debugSend(String resourceGroupName, String namespaceName, String notificationHubName) {
"""
test send a push notification.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param notificationHubName The notification hub name.
@thr... | java | public DebugSendResponseInner debugSend(String resourceGroupName, String namespaceName, String notificationHubName) {
return debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body();
} | [
"public",
"DebugSendResponseInner",
"debugSend",
"(",
"String",
"resourceGroupName",
",",
"String",
"namespaceName",
",",
"String",
"notificationHubName",
")",
"{",
"return",
"debugSendWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"namespaceName",
",",
"notifica... | test send a push notification.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param notificationHubName The notification hub name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by se... | [
"test",
"send",
"a",
"push",
"notification",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java#L715-L717 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.hashByWords | public static int hashByWords(MemorySegment[] segments, int offset, int numBytes) {
"""
hash segments to int, numBytes must be aligned to 4 bytes.
@param segments Source segments.
@param offset Source segments offset.
@param numBytes the number bytes to hash.
"""
if (inFirstSegment(segments, offset, num... | java | public static int hashByWords(MemorySegment[] segments, int offset, int numBytes) {
if (inFirstSegment(segments, offset, numBytes)) {
return MurmurHashUtil.hashBytesByWords(segments[0], offset, numBytes);
} else {
return hashMultiSegByWords(segments, offset, numBytes);
}
} | [
"public",
"static",
"int",
"hashByWords",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"int",
"numBytes",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"numBytes",
")",
")",
"{",
"return",
"MurmurHash... | hash segments to int, numBytes must be aligned to 4 bytes.
@param segments Source segments.
@param offset Source segments offset.
@param numBytes the number bytes to hash. | [
"hash",
"segments",
"to",
"int",
"numBytes",
"must",
"be",
"aligned",
"to",
"4",
"bytes",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L370-L376 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/Util.java | Util.checkIfPowerOf2 | public static void checkIfPowerOf2(final int v, final String argName) {
"""
Checks the given parameter to make sure it is positive, an integer-power of 2 and greater than
zero.
@param v The input argument.
@param argName Used in the thrown exception.
"""
if ((v > 0) && ((v & (v - 1)) == 0)) {
re... | java | public static void checkIfPowerOf2(final int v, final String argName) {
if ((v > 0) && ((v & (v - 1)) == 0)) {
return;
}
throw new SketchesArgumentException("The value of the parameter \"" + argName
+ "\" must be a positive integer-power of 2" + " and greater than 0: " + v);
} | [
"public",
"static",
"void",
"checkIfPowerOf2",
"(",
"final",
"int",
"v",
",",
"final",
"String",
"argName",
")",
"{",
"if",
"(",
"(",
"v",
">",
"0",
")",
"&&",
"(",
"(",
"v",
"&",
"(",
"v",
"-",
"1",
")",
")",
"==",
"0",
")",
")",
"{",
"retur... | Checks the given parameter to make sure it is positive, an integer-power of 2 and greater than
zero.
@param v The input argument.
@param argName Used in the thrown exception. | [
"Checks",
"the",
"given",
"parameter",
"to",
"make",
"sure",
"it",
"is",
"positive",
"an",
"integer",
"-",
"power",
"of",
"2",
"and",
"greater",
"than",
"zero",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/Util.java#L366-L372 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getDayOfMonth | private static int getDayOfMonth(int dayOfYear, int month, int year) {
"""
Returns day-of-month.
@param dayOfYear day of year
@param month month
@param year year
@return day-of-month
"""
Integer[] newMonths = getAdjustedMonthDays(year);
if (dayOfYear >= 0) {
if (month > ... | java | private static int getDayOfMonth(int dayOfYear, int month, int year) {
Integer[] newMonths = getAdjustedMonthDays(year);
if (dayOfYear >= 0) {
if (month > 0) {
return dayOfYear - newMonths[month].intValue();
} else {
return dayOfYear;
... | [
"private",
"static",
"int",
"getDayOfMonth",
"(",
"int",
"dayOfYear",
",",
"int",
"month",
",",
"int",
"year",
")",
"{",
"Integer",
"[",
"]",
"newMonths",
"=",
"getAdjustedMonthDays",
"(",
"year",
")",
";",
"if",
"(",
"dayOfYear",
">=",
"0",
")",
"{",
... | Returns day-of-month.
@param dayOfYear day of year
@param month month
@param year year
@return day-of-month | [
"Returns",
"day",
"-",
"of",
"-",
"month",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1086-L1105 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/NetworkUtils.java | NetworkUtils.getLearningRate | public static Double getLearningRate(MultiLayerNetwork net, int layerNumber) {
"""
Get the current learning rate, for the specified layer, fromthe network.
Note: If the layer has no learning rate (no parameters, or an updater without a learning rate) then null is returned
@param net Network
@param lay... | java | public static Double getLearningRate(MultiLayerNetwork net, int layerNumber) {
Layer l = net.getLayer(layerNumber).conf().getLayer();
int iter = net.getIterationCount();
int epoch = net.getEpochCount();
if (l instanceof BaseLayer) {
BaseLayer bl = (BaseLayer) l;
I... | [
"public",
"static",
"Double",
"getLearningRate",
"(",
"MultiLayerNetwork",
"net",
",",
"int",
"layerNumber",
")",
"{",
"Layer",
"l",
"=",
"net",
".",
"getLayer",
"(",
"layerNumber",
")",
".",
"conf",
"(",
")",
".",
"getLayer",
"(",
")",
";",
"int",
"iter... | Get the current learning rate, for the specified layer, fromthe network.
Note: If the layer has no learning rate (no parameters, or an updater without a learning rate) then null is returned
@param net Network
@param layerNumber Layer number to get the learning rate for
@return Learning rate for the specified l... | [
"Get",
"the",
"current",
"learning",
"rate",
"for",
"the",
"specified",
"layer",
"fromthe",
"network",
".",
"Note",
":",
"If",
"the",
"layer",
"has",
"no",
"learning",
"rate",
"(",
"no",
"parameters",
"or",
"an",
"updater",
"without",
"a",
"learning",
"rat... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/NetworkUtils.java#L203-L220 |
OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.setJVMName | protected static void setJVMName(final int port, final String iface) {
"""
Attempts to set the vm agent property that identifies the vm's display name.
This is the name displayed for tools such as jconsole and jps when using auto-dicsovery.
When using a fat-jar, this provides a much more identifiable name
@para... | java | protected static void setJVMName(final int port, final String iface) {
final Properties p = getAgentProperties();
if(p!=null) {
final String ifc = (iface==null || iface.trim().isEmpty()) ? "" : (iface.trim() + ":");
final String name = "opentsdb[" + ifc + port + "]";
p.setProperty("sun.java.co... | [
"protected",
"static",
"void",
"setJVMName",
"(",
"final",
"int",
"port",
",",
"final",
"String",
"iface",
")",
"{",
"final",
"Properties",
"p",
"=",
"getAgentProperties",
"(",
")",
";",
"if",
"(",
"p",
"!=",
"null",
")",
"{",
"final",
"String",
"ifc",
... | Attempts to set the vm agent property that identifies the vm's display name.
This is the name displayed for tools such as jconsole and jps when using auto-dicsovery.
When using a fat-jar, this provides a much more identifiable name
@param port The listening port
@param iface The bound interface | [
"Attempts",
"to",
"set",
"the",
"vm",
"agent",
"property",
"that",
"identifies",
"the",
"vm",
"s",
"display",
"name",
".",
"This",
"is",
"the",
"name",
"displayed",
"for",
"tools",
"such",
"as",
"jconsole",
"and",
"jps",
"when",
"using",
"auto",
"-",
"di... | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L449-L459 |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/MonitoringAspect.java | MonitoringAspect.doProfilingClass | @Around(value = "execution(* *.*(..)) && @within(monitor) && !@annotation(net.anotheria.moskito.aop.annotation.DontMonitor)")
public Object doProfilingClass(ProceedingJoinPoint pjp, Monitor monitor) throws Throwable {
"""
Common class profiling entry-point.
@param pjp
{@link ProceedingJoinPoint}
@param mo... | java | @Around(value = "execution(* *.*(..)) && @within(monitor) && !@annotation(net.anotheria.moskito.aop.annotation.DontMonitor)")
public Object doProfilingClass(ProceedingJoinPoint pjp, Monitor monitor) throws Throwable {
return doProfiling(pjp, monitor.producerId(), monitor.subsystem(), monitor.category());
... | [
"@",
"Around",
"(",
"value",
"=",
"\"execution(* *.*(..)) && @within(monitor) && !@annotation(net.anotheria.moskito.aop.annotation.DontMonitor)\"",
")",
"public",
"Object",
"doProfilingClass",
"(",
"ProceedingJoinPoint",
"pjp",
",",
"Monitor",
"monitor",
")",
"throws",
"Throwable... | Common class profiling entry-point.
@param pjp
{@link ProceedingJoinPoint}
@param monitor
{@link Monitor}
@return call result
@throws Throwable
in case of error during {@link ProceedingJoinPoint#proceed()} | [
"Common",
"class",
"profiling",
"entry",
"-",
"point",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/MonitoringAspect.java#L52-L55 |
cubedtear/aritzh | aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java | Configuration.setProperty | public void setProperty(String category, String key, String value) {
"""
Sets a property in the configuration
@param category The category of the property
@param key The key to identify the property
@param value The value associated with it
"""
category = (this.compressedSpaces ? category.replac... | java | public void setProperty(String category, String key, String value) {
category = (this.compressedSpaces ? category.replaceAll("\\s+", " ") : category).trim();
if (Strings.isNullOrEmpty(category)) category = "Main";
key = (this.compressedSpaces ? key.replaceAll("\\s+", " ") : key).trim().replace(" ", "_");
value ... | [
"public",
"void",
"setProperty",
"(",
"String",
"category",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"category",
"=",
"(",
"this",
".",
"compressedSpaces",
"?",
"category",
".",
"replaceAll",
"(",
"\"\\\\s+\"",
",",
"\" \"",
")",
":",
"categ... | Sets a property in the configuration
@param category The category of the property
@param key The key to identify the property
@param value The value associated with it | [
"Sets",
"a",
"property",
"in",
"the",
"configuration"
] | train | https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java#L226-L237 |
apereo/cas | core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java | AbstractCasWebflowConfigurer.prependActionsToActionStateExecutionList | public void prependActionsToActionStateExecutionList(final Flow flow, final ActionState actionStateId, final EvaluateAction... actions) {
"""
Prepend actions to action state execution list.
@param flow the flow
@param actionStateId the action state id
@param actions the actions
"""
... | java | public void prependActionsToActionStateExecutionList(final Flow flow, final ActionState actionStateId, final EvaluateAction... actions) {
addActionsToActionStateExecutionListAt(flow, actionStateId.getId(), 0, actions);
} | [
"public",
"void",
"prependActionsToActionStateExecutionList",
"(",
"final",
"Flow",
"flow",
",",
"final",
"ActionState",
"actionStateId",
",",
"final",
"EvaluateAction",
"...",
"actions",
")",
"{",
"addActionsToActionStateExecutionListAt",
"(",
"flow",
",",
"actionStateId... | Prepend actions to action state execution list.
@param flow the flow
@param actionStateId the action state id
@param actions the actions | [
"Prepend",
"actions",
"to",
"action",
"state",
"execution",
"list",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java#L833-L835 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPTextWriter.java | JBBPTextWriter.Byte | public JBBPTextWriter Byte(final byte[] array, int off, int len) throws IOException {
"""
Print values from byte array.
@param array source byte array, must not be null
@param off the offset of the first element in array
@param len number of bytes to be printed
@return the context
@throws IOException it... | java | public JBBPTextWriter Byte(final byte[] array, int off, int len) throws IOException {
ensureValueMode();
while (len-- > 0) {
Byte(array[off++]);
}
return this;
} | [
"public",
"JBBPTextWriter",
"Byte",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"ensureValueMode",
"(",
")",
";",
"while",
"(",
"len",
"--",
">",
"0",
")",
"{",
"Byte",
"(",
"array... | Print values from byte array.
@param array source byte array, must not be null
@param off the offset of the first element in array
@param len number of bytes to be printed
@return the context
@throws IOException it will be thrown for transport errors | [
"Print",
"values",
"from",
"byte",
"array",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPTextWriter.java#L624-L631 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2Exception.java | Http2Exception.headerListSizeError | public static Http2Exception headerListSizeError(int id, Http2Error error, boolean onDecode,
String fmt, Object... args) {
"""
A specific stream error resulting from failing to decode headers that exceeds the max header size list.
If the {@code id} is not {@link Http2CodecUtil#CONNECTION_STREAM_ID} th... | java | public static Http2Exception headerListSizeError(int id, Http2Error error, boolean onDecode,
String fmt, Object... args) {
return CONNECTION_STREAM_ID == id ?
Http2Exception.connectionError(error, fmt, args) :
new HeaderListSizeException(id, error, String.format(f... | [
"public",
"static",
"Http2Exception",
"headerListSizeError",
"(",
"int",
"id",
",",
"Http2Error",
"error",
",",
"boolean",
"onDecode",
",",
"String",
"fmt",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"CONNECTION_STREAM_ID",
"==",
"id",
"?",
"Http2Exceptio... | A specific stream error resulting from failing to decode headers that exceeds the max header size list.
If the {@code id} is not {@link Http2CodecUtil#CONNECTION_STREAM_ID} then a
{@link Http2Exception.StreamException} will be returned. Otherwise the error is considered a
connection error and a {@link Http2Exception} i... | [
"A",
"specific",
"stream",
"error",
"resulting",
"from",
"failing",
"to",
"decode",
"headers",
"that",
"exceeds",
"the",
"max",
"header",
"size",
"list",
".",
"If",
"the",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2Exception.java#L167-L172 |
apereo/person-directory | person-directory-impl/src/main/java/org/apereo/services/persondir/support/AbstractQueryPersonAttributeDao.java | AbstractQueryPersonAttributeDao.setResultAttributeMapping | public void setResultAttributeMapping(final Map<String, ?> resultAttributeMapping) {
"""
Set the {@link Map} to use for mapping from a data layer name to an attribute name or {@link Set} of attribute
names. Data layer names that are specified but have null mappings will use the column name for the attribute
name... | java | public void setResultAttributeMapping(final Map<String, ?> resultAttributeMapping) {
final Map<String, Set<String>> parsedResultAttributeMapping = MultivaluedPersonAttributeUtils.parseAttributeToAttributeMapping(resultAttributeMapping);
if (parsedResultAttributeMapping.containsKey("")) {
th... | [
"public",
"void",
"setResultAttributeMapping",
"(",
"final",
"Map",
"<",
"String",
",",
"?",
">",
"resultAttributeMapping",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"parsedResultAttributeMapping",
"=",
"MultivaluedPersonAttribu... | Set the {@link Map} to use for mapping from a data layer name to an attribute name or {@link Set} of attribute
names. Data layer names that are specified but have null mappings will use the column name for the attribute
name. Data layer names that are not specified as keys in this {@link Map} will be ignored.
<br>
The ... | [
"Set",
"the",
"{",
"@link",
"Map",
"}",
"to",
"use",
"for",
"mapping",
"from",
"a",
"data",
"layer",
"name",
"to",
"an",
"attribute",
"name",
"or",
"{",
"@link",
"Set",
"}",
"of",
"attribute",
"names",
".",
"Data",
"layer",
"names",
"that",
"are",
"s... | train | https://github.com/apereo/person-directory/blob/331200c0878aec202b8aff12a732402d6ba7681f/person-directory-impl/src/main/java/org/apereo/services/persondir/support/AbstractQueryPersonAttributeDao.java#L181-L192 |
markushi/android-ui | src/main/java/at/markushi/ui/ActionView.java | ActionView.setAction | public void setAction(final Action fromAction, final Action toAction, final int rotation, long delay) {
"""
Sets a new action transition.
@param fromAction The initial action.
@param toAction The target action.
@param rotation The rotation direction used for the transition {@link #ROTATE_CLOCKWISE} or {@l... | java | public void setAction(final Action fromAction, final Action toAction, final int rotation, long delay) {
setAction(fromAction, false, ROTATE_CLOCKWISE);
postDelayed(new Runnable() {
@Override
public void run() {
if (!isAttachedToWindow()) {
return;
}
setAction(toAction, true, rotation);
}
... | [
"public",
"void",
"setAction",
"(",
"final",
"Action",
"fromAction",
",",
"final",
"Action",
"toAction",
",",
"final",
"int",
"rotation",
",",
"long",
"delay",
")",
"{",
"setAction",
"(",
"fromAction",
",",
"false",
",",
"ROTATE_CLOCKWISE",
")",
";",
"postDe... | Sets a new action transition.
@param fromAction The initial action.
@param toAction The target action.
@param rotation The rotation direction used for the transition {@link #ROTATE_CLOCKWISE} or {@link #ROTATE_COUNTER_CLOCKWISE}.
@param delay The delay in ms before the transition is started. | [
"Sets",
"a",
"new",
"action",
"transition",
"."
] | train | https://github.com/markushi/android-ui/blob/a589fad7b74ace063c2b0e90741d43225b200a18/src/main/java/at/markushi/ui/ActionView.java#L215-L226 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListPersistenceImpl.java | CommercePriceListPersistenceImpl.findByCompanyId | @Override
public List<CommercePriceList> findByCompanyId(long companyId, int start,
int end) {
"""
Returns a range of all the commerce price lists where companyId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are... | java | @Override
public List<CommercePriceList> findByCompanyId(long companyId, int start,
int end) {
return findByCompanyId(companyId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePriceList",
">",
"findByCompanyId",
"(",
"long",
"companyId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCompanyId",
"(",
"companyId",
",",
"start",
",",
"end",
",",
"null",
")",
";",... | Returns a range of all the commerce price lists where companyId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"price",
"lists",
"where",
"companyId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListPersistenceImpl.java#L2053-L2057 |
apache/fluo | modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java | FluoConfiguration.setTransactionRollbackTime | public FluoConfiguration setTransactionRollbackTime(long time, TimeUnit tu) {
"""
Sets the transaction rollback time, in milliseconds.
<p>
Sets the value of the property {@value #TRANSACTION_ROLLBACK_TIME_PROP}
@param time A long representation of the duration, must be positive
@param tu The TimeUnit to use
... | java | public FluoConfiguration setTransactionRollbackTime(long time, TimeUnit tu) {
return setPositiveLong(TRANSACTION_ROLLBACK_TIME_PROP, tu.toMillis(time));
} | [
"public",
"FluoConfiguration",
"setTransactionRollbackTime",
"(",
"long",
"time",
",",
"TimeUnit",
"tu",
")",
"{",
"return",
"setPositiveLong",
"(",
"TRANSACTION_ROLLBACK_TIME_PROP",
",",
"tu",
".",
"toMillis",
"(",
"time",
")",
")",
";",
"}"
] | Sets the transaction rollback time, in milliseconds.
<p>
Sets the value of the property {@value #TRANSACTION_ROLLBACK_TIME_PROP}
@param time A long representation of the duration, must be positive
@param tu The TimeUnit to use | [
"Sets",
"the",
"transaction",
"rollback",
"time",
"in",
"milliseconds",
".",
"<p",
">",
"Sets",
"the",
"value",
"of",
"the",
"property",
"{",
"@value",
"#TRANSACTION_ROLLBACK_TIME_PROP",
"}"
] | train | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L853-L855 |
baratine/baratine | core/src/main/java/com/caucho/v5/loader/EnvLoader.java | EnvLoader.addPermission | public static void addPermission(Permission perm, ClassLoader loader) {
"""
Adds a permission to the current environment.
@param perm the permission to add.
@return the old attribute value
"""
for (; loader != null; loader = loader.getParent()) {
if (loader instanceof EnvironmentClassLoader) {
... | java | public static void addPermission(Permission perm, ClassLoader loader)
{
for (; loader != null; loader = loader.getParent()) {
if (loader instanceof EnvironmentClassLoader) {
EnvironmentClassLoader envLoader = (EnvironmentClassLoader) loader;
envLoader.addPermission(perm);
}
}
} | [
"public",
"static",
"void",
"addPermission",
"(",
"Permission",
"perm",
",",
"ClassLoader",
"loader",
")",
"{",
"for",
"(",
";",
"loader",
"!=",
"null",
";",
"loader",
"=",
"loader",
".",
"getParent",
"(",
")",
")",
"{",
"if",
"(",
"loader",
"instanceof"... | Adds a permission to the current environment.
@param perm the permission to add.
@return the old attribute value | [
"Adds",
"a",
"permission",
"to",
"the",
"current",
"environment",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/loader/EnvLoader.java#L702-L711 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.