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-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SegmentDimensions.java | SegmentDimensions.withUserAttributes | public SegmentDimensions withUserAttributes(java.util.Map<String, AttributeDimension> userAttributes) {
"""
Custom segment user attributes.
@param userAttributes
Custom segment user attributes.
@return Returns a reference to this object so that method calls can be chained together.
"""
setUserAttr... | java | public SegmentDimensions withUserAttributes(java.util.Map<String, AttributeDimension> userAttributes) {
setUserAttributes(userAttributes);
return this;
} | [
"public",
"SegmentDimensions",
"withUserAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AttributeDimension",
">",
"userAttributes",
")",
"{",
"setUserAttributes",
"(",
"userAttributes",
")",
";",
"return",
"this",
";",
"}"
] | Custom segment user attributes.
@param userAttributes
Custom segment user attributes.
@return Returns a reference to this object so that method calls can be chained together. | [
"Custom",
"segment",
"user",
"attributes",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SegmentDimensions.java#L283-L286 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java | JBossASClient.createRequest | public static ModelNode createRequest(String operation, Address address) {
"""
Convienence method that builds a partial operation request node.
@param operation the operation to be requested
@param address identifies the target resource
@return the partial operation request node - caller should fill this in f... | java | public static ModelNode createRequest(String operation, Address address) {
return createRequest(operation, address, null);
} | [
"public",
"static",
"ModelNode",
"createRequest",
"(",
"String",
"operation",
",",
"Address",
"address",
")",
"{",
"return",
"createRequest",
"(",
"operation",
",",
"address",
",",
"null",
")",
";",
"}"
] | Convienence method that builds a partial operation request node.
@param operation the operation to be requested
@param address identifies the target resource
@return the partial operation request node - caller should fill this in further to complete the node | [
"Convienence",
"method",
"that",
"builds",
"a",
"partial",
"operation",
"request",
"node",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java#L125-L127 |
Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/helpers/ValueInterpreter.java | ValueInterpreter.getStringValue | public static String getStringValue(@NonNull byte[] value, @IntRange(from = 0) int offset) {
"""
Return the string value interpreted from the passed byte array.
@param offset Offset at which the string value can be found.
@return The value at a given offset
"""
if (offset > value.length) {
... | java | public static String getStringValue(@NonNull byte[] value, @IntRange(from = 0) int offset) {
if (offset > value.length) {
RxBleLog.w("Passed offset that exceeds the length of the byte array - returning null");
return null;
}
byte[] strBytes = new byte[value.length - offse... | [
"public",
"static",
"String",
"getStringValue",
"(",
"@",
"NonNull",
"byte",
"[",
"]",
"value",
",",
"@",
"IntRange",
"(",
"from",
"=",
"0",
")",
"int",
"offset",
")",
"{",
"if",
"(",
"offset",
">",
"value",
".",
"length",
")",
"{",
"RxBleLog",
".",
... | Return the string value interpreted from the passed byte array.
@param offset Offset at which the string value can be found.
@return The value at a given offset | [
"Return",
"the",
"string",
"value",
"interpreted",
"from",
"the",
"passed",
"byte",
"array",
"."
] | train | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/helpers/ValueInterpreter.java#L163-L173 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ConsumerLogMessages.java | ConsumerLogMessages.logException | public static void logException(final Logger logger, final Exception e) {
"""
Logs an exception.
@param logger
reference to the logger
@param e
reference to the exception
"""
logger.logException(Level.ERROR, "Unexpected Exception", e);
} | java | public static void logException(final Logger logger, final Exception e)
{
logger.logException(Level.ERROR, "Unexpected Exception", e);
} | [
"public",
"static",
"void",
"logException",
"(",
"final",
"Logger",
"logger",
",",
"final",
"Exception",
"e",
")",
"{",
"logger",
".",
"logException",
"(",
"Level",
".",
"ERROR",
",",
"\"Unexpected Exception\"",
",",
"e",
")",
";",
"}"
] | Logs an exception.
@param logger
reference to the logger
@param e
reference to the exception | [
"Logs",
"an",
"exception",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ConsumerLogMessages.java#L67-L70 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java | AbstractExecutableMemberWriter.getErasureAnchor | protected String getErasureAnchor(ExecutableElement executableElement) {
"""
For backward compatibility, include an anchor using the erasures of the
parameters. NOTE: We won't need this method anymore after we fix
see tags so that they use the type instead of the erasure.
@param executableElement the Execut... | java | protected String getErasureAnchor(ExecutableElement executableElement) {
final StringBuilder buf = new StringBuilder(name(executableElement) + "(");
List<? extends VariableElement> parameters = executableElement.getParameters();
boolean foundTypeVariable = false;
for (int i = 0; i < para... | [
"protected",
"String",
"getErasureAnchor",
"(",
"ExecutableElement",
"executableElement",
")",
"{",
"final",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"name",
"(",
"executableElement",
")",
"+",
"\"(\"",
")",
";",
"List",
"<",
"?",
"extends",
"Va... | For backward compatibility, include an anchor using the erasures of the
parameters. NOTE: We won't need this method anymore after we fix
see tags so that they use the type instead of the erasure.
@param executableElement the ExecutableElement to anchor to.
@return the 1.4.x style anchor for the executable element. | [
"For",
"backward",
"compatibility",
"include",
"an",
"anchor",
"using",
"the",
"erasures",
"of",
"the",
"parameters",
".",
"NOTE",
":",
"We",
"won",
"t",
"need",
"this",
"method",
"anymore",
"after",
"we",
"fix",
"see",
"tags",
"so",
"that",
"they",
"use",... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java#L304-L350 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/BlockLeaf.java | BlockLeaf.writeCheckpointFull | void writeCheckpointFull(OutputStream os, int rowHead)
throws IOException {
"""
Writes the block to the checkpoint stream.
Because of timing, the requested rowHead might be for an older
checkpoint of the block, if new rows have arrived since the request.
<pre><code>
b16 - inline blob length (blobTail)
... | java | void writeCheckpointFull(OutputStream os, int rowHead)
throws IOException
{
BitsUtil.writeInt16(os, _blobTail);
os.write(_buffer, 0, _blobTail);
rowHead = Math.max(rowHead, _rowHead);
int rowLength = _buffer.length - rowHead;
BitsUtil.writeInt16(os, rowLength);
os.write(_buf... | [
"void",
"writeCheckpointFull",
"(",
"OutputStream",
"os",
",",
"int",
"rowHead",
")",
"throws",
"IOException",
"{",
"BitsUtil",
".",
"writeInt16",
"(",
"os",
",",
"_blobTail",
")",
";",
"os",
".",
"write",
"(",
"_buffer",
",",
"0",
",",
"_blobTail",
")",
... | Writes the block to the checkpoint stream.
Because of timing, the requested rowHead might be for an older
checkpoint of the block, if new rows have arrived since the request.
<pre><code>
b16 - inline blob length (blobTail)
<n> - inline blob data
b16 - row data length (block_size - row_head)
<m> - row data
</cod... | [
"Writes",
"the",
"block",
"to",
"the",
"checkpoint",
"stream",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/BlockLeaf.java#L698-L710 |
hypercube1024/firefly | firefly-db/src/main/java/com/firefly/db/init/ScriptUtils.java | ScriptUtils.readScript | public static String readScript(LineNumberReader lineNumberReader, String commentPrefix, String separator)
throws IOException {
"""
Read a script from the provided {@code LineNumberReader}, using the
supplied comment prefix and statement separator, and build a
{@code String} containing the lines.
<p... | java | public static String readScript(LineNumberReader lineNumberReader, String commentPrefix, String separator)
throws IOException {
String currentStatement = lineNumberReader.readLine();
StringBuilder scriptBuilder = new StringBuilder();
while (currentStatement != null) {
if... | [
"public",
"static",
"String",
"readScript",
"(",
"LineNumberReader",
"lineNumberReader",
",",
"String",
"commentPrefix",
",",
"String",
"separator",
")",
"throws",
"IOException",
"{",
"String",
"currentStatement",
"=",
"lineNumberReader",
".",
"readLine",
"(",
")",
... | Read a script from the provided {@code LineNumberReader}, using the
supplied comment prefix and statement separator, and build a
{@code String} containing the lines.
<p>
Lines <em>beginning</em> with the comment prefix are excluded from the
results; however, line comments anywhere else — for example, within
a sta... | [
"Read",
"a",
"script",
"from",
"the",
"provided",
"{",
"@code",
"LineNumberReader",
"}",
"using",
"the",
"supplied",
"comment",
"prefix",
"and",
"statement",
"separator",
"and",
"build",
"a",
"{",
"@code",
"String",
"}",
"containing",
"the",
"lines",
".",
"<... | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-db/src/main/java/com/firefly/db/init/ScriptUtils.java#L295-L311 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.getByResourceGroupAsync | public Observable<VirtualNetworkGatewayInner> getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayName) {
"""
Gets the specified virtual network gateway by resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual... | java | public Observable<VirtualNetworkGatewayInner> getByResourceGroupAsync(String resourceGroupName, String virtualNetworkGatewayName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1<ServiceResponse<VirtualNetworkGatewayInner>, VirtualNetworkGatewayInne... | [
"public",
"Observable",
"<",
"VirtualNetworkGatewayInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNe... | Gets the specified virtual network gateway by resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the VirtualNetworkGatewayI... | [
"Gets",
"the",
"specified",
"virtual",
"network",
"gateway",
"by",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L401-L408 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/env/PropertySourcePropertyResolver.java | PropertySourcePropertyResolver.addPropertySource | public PropertySourcePropertyResolver addPropertySource(String name, @Nullable Map<String, ? super Object> values) {
"""
Add a property source for the given map.
@param name The name of the property source
@param values The values
@return This environment
"""
if (CollectionUtils.isNotEmpty(value... | java | public PropertySourcePropertyResolver addPropertySource(String name, @Nullable Map<String, ? super Object> values) {
if (CollectionUtils.isNotEmpty(values)) {
return addPropertySource(PropertySource.of(name, values));
}
return this;
} | [
"public",
"PropertySourcePropertyResolver",
"addPropertySource",
"(",
"String",
"name",
",",
"@",
"Nullable",
"Map",
"<",
"String",
",",
"?",
"super",
"Object",
">",
"values",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isNotEmpty",
"(",
"values",
")",
")",
... | Add a property source for the given map.
@param name The name of the property source
@param values The values
@return This environment | [
"Add",
"a",
"property",
"source",
"for",
"the",
"given",
"map",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/env/PropertySourcePropertyResolver.java#L119-L124 |
digipost/sdp-shared | api-commons/src/main/java/no/digipost/api/interceptors/Wss4jInterceptor.java | Wss4jInterceptor.checkResults | protected void checkResults(final List<WSSecurityEngineResult> results, final List<Integer> validationActions) throws Wss4jSecurityValidationException {
"""
Checks whether the received headers match the configured validation actions. Subclasses could override this method
for custom verification behavior.
@para... | java | protected void checkResults(final List<WSSecurityEngineResult> results, final List<Integer> validationActions) throws Wss4jSecurityValidationException {
if (!handler.checkReceiverResultsAnyOrder(results, validationActions)) {
throw new Wss4jSecurityValidationException("Security processing failed (ac... | [
"protected",
"void",
"checkResults",
"(",
"final",
"List",
"<",
"WSSecurityEngineResult",
">",
"results",
",",
"final",
"List",
"<",
"Integer",
">",
"validationActions",
")",
"throws",
"Wss4jSecurityValidationException",
"{",
"if",
"(",
"!",
"handler",
".",
"check... | Checks whether the received headers match the configured validation actions. Subclasses could override this method
for custom verification behavior.
@param results the results of the validation function
@param validationActions the decoded validation actions
@throws Wss4jSecurityValidationException if the re... | [
"Checks",
"whether",
"the",
"received",
"headers",
"match",
"the",
"configured",
"validation",
"actions",
".",
"Subclasses",
"could",
"override",
"this",
"method",
"for",
"custom",
"verification",
"behavior",
"."
] | train | https://github.com/digipost/sdp-shared/blob/c34920a993b65ff0908dab9d9c92140ded7312bc/api-commons/src/main/java/no/digipost/api/interceptors/Wss4jInterceptor.java#L409-L413 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IntegerExtensions.java | IntegerExtensions.shiftLeft | @Pure
@Inline(value="($1 << $2)", constantExpression=true)
@Deprecated
public static int shiftLeft(int a, int distance) {
"""
The binary <code>signed left shift</code> operator. This is the equivalent to the java <code><<</code> operator.
Fills in a zero as the least significant bit.
@param a
an inte... | java | @Pure
@Inline(value="($1 << $2)", constantExpression=true)
@Deprecated
public static int shiftLeft(int a, int distance) {
return a << distance;
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"($1 << $2)\"",
",",
"constantExpression",
"=",
"true",
")",
"@",
"Deprecated",
"public",
"static",
"int",
"shiftLeft",
"(",
"int",
"a",
",",
"int",
"distance",
")",
"{",
"return",
"a",
"<<",
"distance",
"... | The binary <code>signed left shift</code> operator. This is the equivalent to the java <code><<</code> operator.
Fills in a zero as the least significant bit.
@param a
an integer.
@param distance
the number of times to shift.
@return <code>a<<distance</code>
@deprecated use {@link #operator_doubleLessThan(... | [
"The",
"binary",
"<code",
">",
"signed",
"left",
"shift<",
"/",
"code",
">",
"operator",
".",
"This",
"is",
"the",
"equivalent",
"to",
"the",
"java",
"<code",
">",
"<",
";",
"<",
";",
"<",
"/",
"code",
">",
"operator",
".",
"Fills",
"in",
"a",
... | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IntegerExtensions.java#L136-L141 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.deleteIterationAsync | public Observable<Void> deleteIterationAsync(UUID projectId, UUID iterationId) {
"""
Delete a specific iteration of a project.
@param projectId The project id
@param iterationId The iteration id
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} obje... | java | public Observable<Void> deleteIterationAsync(UUID projectId, UUID iterationId) {
return deleteIterationWithServiceResponseAsync(projectId, iterationId).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return respo... | [
"public",
"Observable",
"<",
"Void",
">",
"deleteIterationAsync",
"(",
"UUID",
"projectId",
",",
"UUID",
"iterationId",
")",
"{",
"return",
"deleteIterationWithServiceResponseAsync",
"(",
"projectId",
",",
"iterationId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
... | Delete a specific iteration of a project.
@param projectId The project id
@param iterationId The iteration id
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if successful. | [
"Delete",
"a",
"specific",
"iteration",
"of",
"a",
"project",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L1906-L1913 |
to2mbn/JMCCC | jmccc/src/main/java/org/to2mbn/jmccc/internal/org/json/JSONObject.java | JSONObject.optBigDecimal | public BigDecimal optBigDecimal(String key, BigDecimal defaultValue) {
"""
Get an optional BigDecimal associated with a key, or the defaultValue if
there is no such key or if its value is not a number. If the value is a
string, an attempt will be made to evaluate it as a number.
@param key A key string.
@par... | java | public BigDecimal optBigDecimal(String key, BigDecimal defaultValue) {
try {
return this.getBigDecimal(key);
} catch (Exception e) {
return defaultValue;
}
} | [
"public",
"BigDecimal",
"optBigDecimal",
"(",
"String",
"key",
",",
"BigDecimal",
"defaultValue",
")",
"{",
"try",
"{",
"return",
"this",
".",
"getBigDecimal",
"(",
"key",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"defaultValue",
"... | Get an optional BigDecimal associated with a key, or the defaultValue if
there is no such key or if its value is not a number. If the value is a
string, an attempt will be made to evaluate it as a number.
@param key A key string.
@param defaultValue The default.
@return An object which is the value. | [
"Get",
"an",
"optional",
"BigDecimal",
"associated",
"with",
"a",
"key",
"or",
"the",
"defaultValue",
"if",
"there",
"is",
"no",
"such",
"key",
"or",
"if",
"its",
"value",
"is",
"not",
"a",
"number",
".",
"If",
"the",
"value",
"is",
"a",
"string",
"an"... | train | https://github.com/to2mbn/JMCCC/blob/17e5b1b56ff18255cfd60976dca1a24598946647/jmccc/src/main/java/org/to2mbn/jmccc/internal/org/json/JSONObject.java#L863-L869 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache.monitor/src/com/ibm/ws/cache/stat/internal/CacheStatsModule.java | CacheStatsModule.updateCacheSizes | public void updateCacheSizes(long max, long current) {
"""
Updates statistics using two supplied arguments - maxInMemoryCacheSize and currentInMemoryCacheSize.
@param max
Maximum # of entries that can be stored in memory
@param current
Current # of in memory cache entries
"""
final String method... | java | public void updateCacheSizes(long max, long current) {
final String methodName = "updateCacheSizes()";
if (tc.isDebugEnabled() && null != _maxInMemoryCacheEntryCount && null != _inMemoryCacheEntryCount) {
if (max != _maxInMemoryCacheEntryCount.getCount() && _inMemoryCacheEntryCount.getCoun... | [
"public",
"void",
"updateCacheSizes",
"(",
"long",
"max",
",",
"long",
"current",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"updateCacheSizes()\"",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
"&&",
"null",
"!=",
"_maxInMemoryCacheEntryCount",
... | Updates statistics using two supplied arguments - maxInMemoryCacheSize and currentInMemoryCacheSize.
@param max
Maximum # of entries that can be stored in memory
@param current
Current # of in memory cache entries | [
"Updates",
"statistics",
"using",
"two",
"supplied",
"arguments",
"-",
"maxInMemoryCacheSize",
"and",
"currentInMemoryCacheSize",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache.monitor/src/com/ibm/ws/cache/stat/internal/CacheStatsModule.java#L635-L651 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAExEntityManager.java | JPAExEntityManager.parentHasSameExPc | private static final boolean parentHasSameExPc(JPAPuId parentPuIds[], JPAPuId puId) {
"""
Returns true if the caller and callee have declared the same @ PersistneceContext
in their components.
"""
for (JPAPuId parentPuId : parentPuIds)
{
if (parentPuId.equals(puId))
{
... | java | private static final boolean parentHasSameExPc(JPAPuId parentPuIds[], JPAPuId puId)
{
for (JPAPuId parentPuId : parentPuIds)
{
if (parentPuId.equals(puId))
{
return true;
}
}
return false;
} | [
"private",
"static",
"final",
"boolean",
"parentHasSameExPc",
"(",
"JPAPuId",
"parentPuIds",
"[",
"]",
",",
"JPAPuId",
"puId",
")",
"{",
"for",
"(",
"JPAPuId",
"parentPuId",
":",
"parentPuIds",
")",
"{",
"if",
"(",
"parentPuId",
".",
"equals",
"(",
"puId",
... | Returns true if the caller and callee have declared the same @ PersistneceContext
in their components. | [
"Returns",
"true",
"if",
"the",
"caller",
"and",
"callee",
"have",
"declared",
"the",
"same"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAExEntityManager.java#L762-L772 |
Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/helpers/ValueInterpreter.java | ValueInterpreter.getFloatValue | public static Float getFloatValue(@NonNull byte[] value, @FloatFormatType int formatType, @IntRange(from = 0) int offset) {
"""
Return the float value interpreted from the passed byte array.
@param value The byte array from which to interpret value.
@param formatType The format type used to interpret the value... | java | public static Float getFloatValue(@NonNull byte[] value, @FloatFormatType int formatType, @IntRange(from = 0) int offset) {
if ((offset + getTypeLen(formatType)) > value.length) {
RxBleLog.w(
"Float formatType (0x%x) is longer than remaining bytes (%d) - returning null", formatTy... | [
"public",
"static",
"Float",
"getFloatValue",
"(",
"@",
"NonNull",
"byte",
"[",
"]",
"value",
",",
"@",
"FloatFormatType",
"int",
"formatType",
",",
"@",
"IntRange",
"(",
"from",
"=",
"0",
")",
"int",
"offset",
")",
"{",
"if",
"(",
"(",
"offset",
"+",
... | Return the float value interpreted from the passed byte array.
@param value The byte array from which to interpret value.
@param formatType The format type used to interpret the value.
@param offset Offset at which the float value can be found.
@return The value at a given offset or null if the requested offset exceed... | [
"Return",
"the",
"float",
"value",
"interpreted",
"from",
"the",
"passed",
"byte",
"array",
"."
] | train | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/helpers/ValueInterpreter.java#L136-L155 |
apache/groovy | subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovydoc.java | Groovydoc.setPackagenames | public void setPackagenames(String packages) {
"""
Set the package names to be processed.
@param packages a comma separated list of packages specs
(may be wildcarded).
"""
StringTokenizer tok = new StringTokenizer(packages, ",");
while (tok.hasMoreTokens()) {
String packageName ... | java | public void setPackagenames(String packages) {
StringTokenizer tok = new StringTokenizer(packages, ",");
while (tok.hasMoreTokens()) {
String packageName = tok.nextToken();
packageNames.add(packageName);
}
} | [
"public",
"void",
"setPackagenames",
"(",
"String",
"packages",
")",
"{",
"StringTokenizer",
"tok",
"=",
"new",
"StringTokenizer",
"(",
"packages",
",",
"\",\"",
")",
";",
"while",
"(",
"tok",
".",
"hasMoreTokens",
"(",
")",
")",
"{",
"String",
"packageName"... | Set the package names to be processed.
@param packages a comma separated list of packages specs
(may be wildcarded). | [
"Set",
"the",
"package",
"names",
"to",
"be",
"processed",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovydoc.java#L183-L189 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/common/FrameworkProjectConfig.java | FrameworkProjectConfig.mergeProjectProperties | public void mergeProjectProperties(final Properties properties, final Set<String> removePrefixes) {
"""
Update the project properties file by setting updating the given properties, and removing
any properties that have a prefix in the removePrefixes set
@param properties new properties to put in the file
... | java | public void mergeProjectProperties(final Properties properties, final Set<String> removePrefixes) {
generateProjectPropertiesFile(getName(), propertyFile, true, properties, true, removePrefixes, false);
loadProperties();
} | [
"public",
"void",
"mergeProjectProperties",
"(",
"final",
"Properties",
"properties",
",",
"final",
"Set",
"<",
"String",
">",
"removePrefixes",
")",
"{",
"generateProjectPropertiesFile",
"(",
"getName",
"(",
")",
",",
"propertyFile",
",",
"true",
",",
"properties... | Update the project properties file by setting updating the given properties, and removing
any properties that have a prefix in the removePrefixes set
@param properties new properties to put in the file
@param removePrefixes prefixes of properties to remove from the file | [
"Update",
"the",
"project",
"properties",
"file",
"by",
"setting",
"updating",
"the",
"given",
"properties",
"and",
"removing",
"any",
"properties",
"that",
"have",
"a",
"prefix",
"in",
"the",
"removePrefixes",
"set"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/common/FrameworkProjectConfig.java#L128-L131 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/backup_policy.java | backup_policy.update | public static backup_policy update(nitro_service client, backup_policy resource) throws Exception {
"""
<pre>
Use this operation to modify the number of previous backups to retain.
</pre>
"""
resource.validate("modify");
return ((backup_policy[]) resource.update_resource(client))[0];
} | java | public static backup_policy update(nitro_service client, backup_policy resource) throws Exception
{
resource.validate("modify");
return ((backup_policy[]) resource.update_resource(client))[0];
} | [
"public",
"static",
"backup_policy",
"update",
"(",
"nitro_service",
"client",
",",
"backup_policy",
"resource",
")",
"throws",
"Exception",
"{",
"resource",
".",
"validate",
"(",
"\"modify\"",
")",
";",
"return",
"(",
"(",
"backup_policy",
"[",
"]",
")",
"res... | <pre>
Use this operation to modify the number of previous backups to retain.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"modify",
"the",
"number",
"of",
"previous",
"backups",
"to",
"retain",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/backup_policy.java#L115-L119 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/TransparentDataEncryptionsInner.java | TransparentDataEncryptionsInner.createOrUpdateAsync | public Observable<TransparentDataEncryptionInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName) {
"""
Creates or updates a database's transparent data encryption configuration.
@param resourceGroupName The name of the resource group that contains the resource. You can obt... | java | public Observable<TransparentDataEncryptionInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<TransparentDataEncryptionInner>, TransparentDataEncry... | [
"public",
"Observable",
"<",
"TransparentDataEncryptionInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Creates or updates a database's transparent data encryption configuration.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the datab... | [
"Creates",
"or",
"updates",
"a",
"database",
"s",
"transparent",
"data",
"encryption",
"configuration",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/TransparentDataEncryptionsInner.java#L105-L112 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.beginStringConversion | public static void beginStringConversion(Builder methodBuilder, ModelProperty property) {
"""
generate begin string to translate in code to used in content value or parameter need to be converted in string through String.valueOf
@param methodBuilder
the method builder
@param property
the property
"""
T... | java | public static void beginStringConversion(Builder methodBuilder, ModelProperty property) {
TypeName modelType = typeName(property.getElement().asType());
beginStringConversion(methodBuilder, modelType);
} | [
"public",
"static",
"void",
"beginStringConversion",
"(",
"Builder",
"methodBuilder",
",",
"ModelProperty",
"property",
")",
"{",
"TypeName",
"modelType",
"=",
"typeName",
"(",
"property",
".",
"getElement",
"(",
")",
".",
"asType",
"(",
")",
")",
";",
"beginS... | generate begin string to translate in code to used in content value or parameter need to be converted in string through String.valueOf
@param methodBuilder
the method builder
@param property
the property | [
"generate",
"begin",
"string",
"to",
"translate",
"in",
"code",
"to",
"used",
"in",
"content",
"value",
"or",
"parameter",
"need",
"to",
"be",
"converted",
"in",
"string",
"through",
"String",
".",
"valueOf"
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L376-L380 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/ParameterEditManager.java | ParameterEditManager.applyAndUpdateParmEditSet | static void applyAndUpdateParmEditSet(Document plf, Document ilf, IntegrationResult result) {
"""
Get the parm edit set if any from the plf and process each edit command removing any that
fail from the set so that the set is self cleaning.
@throws Exception
"""
Element pSet = null;
try {
... | java | static void applyAndUpdateParmEditSet(Document plf, Document ilf, IntegrationResult result) {
Element pSet = null;
try {
pSet = getParmEditSet(plf, null, false);
} catch (Exception e) {
LOG.error("Exception occurred while getting user's DLM " + "paramter-edit-set.", e);
... | [
"static",
"void",
"applyAndUpdateParmEditSet",
"(",
"Document",
"plf",
",",
"Document",
"ilf",
",",
"IntegrationResult",
"result",
")",
"{",
"Element",
"pSet",
"=",
"null",
";",
"try",
"{",
"pSet",
"=",
"getParmEditSet",
"(",
"plf",
",",
"null",
",",
"false"... | Get the parm edit set if any from the plf and process each edit command removing any that
fail from the set so that the set is self cleaning.
@throws Exception | [
"Get",
"the",
"parm",
"edit",
"set",
"if",
"any",
"from",
"the",
"plf",
"and",
"process",
"each",
"edit",
"command",
"removing",
"any",
"that",
"fail",
"from",
"the",
"set",
"so",
"that",
"the",
"set",
"is",
"self",
"cleaning",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/ParameterEditManager.java#L59-L85 |
mojohaus/webstart | webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/sign/SignConfig.java | SignConfig.createSignRequest | public JarSignerRequest createSignRequest( File jarToSign, File signedJar )
throws MojoExecutionException {
"""
Creates a jarsigner request to do a sign operation.
@param jarToSign the location of the jar to sign
@param signedJar the optional location of the signed jar to produce (if not set, will ... | java | public JarSignerRequest createSignRequest( File jarToSign, File signedJar )
throws MojoExecutionException
{
JarSignerSignRequest request = new JarSignerSignRequest();
request.setAlias( getAlias() );
request.setKeystore( getKeystore() );
request.setSigfile( getSigfile() );... | [
"public",
"JarSignerRequest",
"createSignRequest",
"(",
"File",
"jarToSign",
",",
"File",
"signedJar",
")",
"throws",
"MojoExecutionException",
"{",
"JarSignerSignRequest",
"request",
"=",
"new",
"JarSignerSignRequest",
"(",
")",
";",
"request",
".",
"setAlias",
"(",
... | Creates a jarsigner request to do a sign operation.
@param jarToSign the location of the jar to sign
@param signedJar the optional location of the signed jar to produce (if not set, will use the original location)
@return the jarsigner request
@throws MojoExecutionException if something wrong occurs | [
"Creates",
"a",
"jarsigner",
"request",
"to",
"do",
"a",
"sign",
"operation",
"."
] | train | https://github.com/mojohaus/webstart/blob/38fdd1d21f063f21716cfcd61ebeabd963487576/webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/sign/SignConfig.java#L318-L345 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java | FilesImpl.listFromComputeNodeNext | public PagedList<NodeFile> listFromComputeNodeNext(final String nextPageLink, final FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions) {
"""
Lists all of the files in task directories on the specified compute node.
@param nextPageLink The NextLink from the previous successful call to List op... | java | public PagedList<NodeFile> listFromComputeNodeNext(final String nextPageLink, final FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions) {
ServiceResponseWithHeaders<Page<NodeFile>, FileListFromComputeNodeHeaders> response = listFromComputeNodeNextSinglePageAsync(nextPageLink, fileListFromComp... | [
"public",
"PagedList",
"<",
"NodeFile",
">",
"listFromComputeNodeNext",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"FileListFromComputeNodeNextOptions",
"fileListFromComputeNodeNextOptions",
")",
"{",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"NodeFile",
">... | Lists all of the files in task directories on the specified compute node.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param fileListFromComputeNodeNextOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@th... | [
"Lists",
"all",
"of",
"the",
"files",
"in",
"task",
"directories",
"on",
"the",
"specified",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L2588-L2596 |
arakelian/more-commons | src/main/java/com/arakelian/core/utils/DateUtils.java | DateUtils.toZonedDateTimeUtc | private static ZonedDateTime toZonedDateTimeUtc(final long epochValue, final EpochUnits units) {
"""
Returns a <code>ZonedDateTime</code> from the given epoch value.
@param epoch
value in milliseconds
@return a <code>ZonedDateTime</code> or null if the date is not valid
"""
Preconditions.checkArgu... | java | private static ZonedDateTime toZonedDateTimeUtc(final long epochValue, final EpochUnits units) {
Preconditions.checkArgument(units != null, "units must be non-null");
final Instant instant = units.toInstant(epochValue);
return ZonedDateTime.ofInstant(instant, ZoneOffset.UTC);
} | [
"private",
"static",
"ZonedDateTime",
"toZonedDateTimeUtc",
"(",
"final",
"long",
"epochValue",
",",
"final",
"EpochUnits",
"units",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"units",
"!=",
"null",
",",
"\"units must be non-null\"",
")",
";",
"final",
... | Returns a <code>ZonedDateTime</code> from the given epoch value.
@param epoch
value in milliseconds
@return a <code>ZonedDateTime</code> or null if the date is not valid | [
"Returns",
"a",
"<code",
">",
"ZonedDateTime<",
"/",
"code",
">",
"from",
"the",
"given",
"epoch",
"value",
"."
] | train | https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/DateUtils.java#L640-L644 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.hosting_web_serviceName_upgrade_duration_POST | public OvhOrder hosting_web_serviceName_upgrade_duration_POST(String serviceName, String duration, net.minidev.ovh.api.hosting.web.OvhOfferEnum offer, Boolean waiveRetractationPeriod) throws IOException {
"""
Create order
REST: POST /order/hosting/web/{serviceName}/upgrade/{duration}
@param offer [required] Ne... | java | public OvhOrder hosting_web_serviceName_upgrade_duration_POST(String serviceName, String duration, net.minidev.ovh.api.hosting.web.OvhOfferEnum offer, Boolean waiveRetractationPeriod) throws IOException {
String qPath = "/order/hosting/web/{serviceName}/upgrade/{duration}";
StringBuilder sb = path(qPath, serviceNam... | [
"public",
"OvhOrder",
"hosting_web_serviceName_upgrade_duration_POST",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"hosting",
".",
"web",
".",
"OvhOfferEnum",
"offer",
",",
"Boolean",
"waiveRetr... | Create order
REST: POST /order/hosting/web/{serviceName}/upgrade/{duration}
@param offer [required] New offers for your hosting account
@param waiveRetractationPeriod [required] Indicates that order will be processed with waiving retractation period
@param serviceName [required] The internal name of your hosting
@para... | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L4962-L4970 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/segment/SegmentServiceImpl.java | SegmentServiceImpl.readMetaContinuation | private boolean readMetaContinuation(ReadStream is, int crc)
throws IOException {
"""
Continuation segment for the metadata.
Additional segments when the table/segment metadata doesn't fit.
"""
long value = BitsUtil.readLong(is);
crc = Crc32Caucho.generate(crc, value);
int crcFile = Bi... | java | private boolean readMetaContinuation(ReadStream is, int crc)
throws IOException
{
long value = BitsUtil.readLong(is);
crc = Crc32Caucho.generate(crc, value);
int crcFile = BitsUtil.readInt(is);
if (crcFile != crc) {
log.fine("meta-segment crc mismatch");
return false;
}
... | [
"private",
"boolean",
"readMetaContinuation",
"(",
"ReadStream",
"is",
",",
"int",
"crc",
")",
"throws",
"IOException",
"{",
"long",
"value",
"=",
"BitsUtil",
".",
"readLong",
"(",
"is",
")",
";",
"crc",
"=",
"Crc32Caucho",
".",
"generate",
"(",
"crc",
","... | Continuation segment for the metadata.
Additional segments when the table/segment metadata doesn't fit. | [
"Continuation",
"segment",
"for",
"the",
"metadata",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/segment/SegmentServiceImpl.java#L853-L884 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/api/common/operators/DualInputSemanticProperties.java | DualInputSemanticProperties.addForwardedField1 | public void addForwardedField1(int sourceField, FieldSet destinationFields) {
"""
Adds, to the existing information, a field that is forwarded directly
from the source record(s) in the first input to multiple fields in
the destination record(s).
@param sourceField the position in the source record(s)
@param ... | java | public void addForwardedField1(int sourceField, FieldSet destinationFields) {
FieldSet fs;
if((fs = this.forwardedFields1.get(sourceField)) != null) {
fs.addAll(destinationFields);
} else {
fs = new FieldSet(destinationFields);
this.forwardedFields1.put(sourceField, fs);
}
} | [
"public",
"void",
"addForwardedField1",
"(",
"int",
"sourceField",
",",
"FieldSet",
"destinationFields",
")",
"{",
"FieldSet",
"fs",
";",
"if",
"(",
"(",
"fs",
"=",
"this",
".",
"forwardedFields1",
".",
"get",
"(",
"sourceField",
")",
")",
"!=",
"null",
")... | Adds, to the existing information, a field that is forwarded directly
from the source record(s) in the first input to multiple fields in
the destination record(s).
@param sourceField the position in the source record(s)
@param destinationFields the position in the destination record(s) | [
"Adds",
"to",
"the",
"existing",
"information",
"a",
"field",
"that",
"is",
"forwarded",
"directly",
"from",
"the",
"source",
"record",
"(",
"s",
")",
"in",
"the",
"first",
"input",
"to",
"multiple",
"fields",
"in",
"the",
"destination",
"record",
"(",
"s"... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/api/common/operators/DualInputSemanticProperties.java#L83-L91 |
trajano/caliper | caliper/src/main/java/com/google/caliper/runner/StreamService.java | StreamService.readItem | StreamItem readItem(long timeout, TimeUnit unit) throws InterruptedException {
"""
Reads a {@link StreamItem} from one of the streams waiting for one to become available if
necessary.
"""
checkState(isRunning(), "Cannot read items from a %s StreamService", state());
StreamItem line = outputQueue.poll(... | java | StreamItem readItem(long timeout, TimeUnit unit) throws InterruptedException {
checkState(isRunning(), "Cannot read items from a %s StreamService", state());
StreamItem line = outputQueue.poll(timeout, unit);
if (line == EOF_ITEM) {
closeStream();
}
return (line == null) ? TIMEOUT_ITEM : line;... | [
"StreamItem",
"readItem",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"checkState",
"(",
"isRunning",
"(",
")",
",",
"\"Cannot read items from a %s StreamService\"",
",",
"state",
"(",
")",
")",
";",
"StreamItem",
"... | Reads a {@link StreamItem} from one of the streams waiting for one to become available if
necessary. | [
"Reads",
"a",
"{"
] | train | https://github.com/trajano/caliper/blob/a8bcfd84fa9d7b893b3edfadc3b13240ae5cd658/caliper/src/main/java/com/google/caliper/runner/StreamService.java#L196-L203 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.unmarshallPlanVersionSummary | public static PlanVersionSummaryBean unmarshallPlanVersionSummary(Map<String, Object> source) {
"""
Unmarshals the given map source into a bean.
@param source the source
@return the plan version summary
"""
if (source == null) {
return null;
}
PlanVersionSummaryBean bean =... | java | public static PlanVersionSummaryBean unmarshallPlanVersionSummary(Map<String, Object> source) {
if (source == null) {
return null;
}
PlanVersionSummaryBean bean = new PlanVersionSummaryBean();
bean.setDescription(asString(source.get("planDescription")));
bean.setId(as... | [
"public",
"static",
"PlanVersionSummaryBean",
"unmarshallPlanVersionSummary",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"PlanVersionSummaryBean",
"bean",
"=",
"ne... | Unmarshals the given map source into a bean.
@param source the source
@return the plan version summary | [
"Unmarshals",
"the",
"given",
"map",
"source",
"into",
"a",
"bean",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L885-L899 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java | AmazonS3Client.postProcessS3Object | private void postProcessS3Object(final S3Object s3Object, final boolean skipClientSideValidation,
final ProgressListener listener) {
"""
Post processing the {@link S3Object} downloaded from S3. It includes wrapping the data with wrapper input streams,
doing client side val... | java | private void postProcessS3Object(final S3Object s3Object, final boolean skipClientSideValidation,
final ProgressListener listener) {
InputStream is = s3Object.getObjectContent();
HttpRequestBase httpRequest = s3Object.getObjectContent().getHttpRequest();
... | [
"private",
"void",
"postProcessS3Object",
"(",
"final",
"S3Object",
"s3Object",
",",
"final",
"boolean",
"skipClientSideValidation",
",",
"final",
"ProgressListener",
"listener",
")",
"{",
"InputStream",
"is",
"=",
"s3Object",
".",
"getObjectContent",
"(",
")",
";",... | Post processing the {@link S3Object} downloaded from S3. It includes wrapping the data with wrapper input streams,
doing client side validation if possible etc. | [
"Post",
"processing",
"the",
"{"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L1502-L1546 |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/search/SearchBuilders.java | SearchBuilders.geoDistance | public static GeoDistanceConditionBuilder geoDistance(String field,
double longitude,
double latitude,
String maxDistance) {
"""
Returns a ne... | java | public static GeoDistanceConditionBuilder geoDistance(String field,
double longitude,
double latitude,
String maxDistance) {
return new Ge... | [
"public",
"static",
"GeoDistanceConditionBuilder",
"geoDistance",
"(",
"String",
"field",
",",
"double",
"longitude",
",",
"double",
"latitude",
",",
"String",
"maxDistance",
")",
"{",
"return",
"new",
"GeoDistanceConditionBuilder",
"(",
"field",
",",
"latitude",
",... | Returns a new {@link GeoDistanceConditionBuilder} with the specified field reference point.
@param field the name of the field to be matched
@param longitude The longitude of the reference point.
@param latitude The latitude of the reference point.
@param maxDistance The max allowed distance.
@return a new geo distanc... | [
"Returns",
"a",
"new",
"{",
"@link",
"GeoDistanceConditionBuilder",
"}",
"with",
"the",
"specified",
"field",
"reference",
"point",
"."
] | train | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/search/SearchBuilders.java#L236-L241 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java | MapUtil.getStr | public static String getStr(Map<?, ?> map, Object key) {
"""
获取Map指定key的值,并转换为字符串
@param map Map
@param key 键
@return 值
@since 4.0.6
"""
return get(map, key, String.class);
} | java | public static String getStr(Map<?, ?> map, Object key) {
return get(map, key, String.class);
} | [
"public",
"static",
"String",
"getStr",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"Object",
"key",
")",
"{",
"return",
"get",
"(",
"map",
",",
"key",
",",
"String",
".",
"class",
")",
";",
"}"
] | 获取Map指定key的值,并转换为字符串
@param map Map
@param key 键
@return 值
@since 4.0.6 | [
"获取Map指定key的值,并转换为字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L756-L758 |
XDean/Java-EX | src/main/java/xdean/jex/util/reflect/GenericUtil.java | GenericUtil.getActualType | private static Type getActualType(Map<TypeVariable<?>, Type> map, Type type) {
"""
Get actual type by the type map.
@param map
@param type
@return The actual type. Return itself if it's already the most explicit type.
"""
return TypeVisitor.of(type, b -> b
.onClass(c -> c)
.onTypeVa... | java | private static Type getActualType(Map<TypeVariable<?>, Type> map, Type type) {
return TypeVisitor.of(type, b -> b
.onClass(c -> c)
.onTypeVariable(tv -> map.containsKey(tv) ? getActualType(map, map.get(tv)) : tv)
.onParameterizedType(pt -> TypeVisitor.of(pt.getRawType(), bb -> bb
... | [
"private",
"static",
"Type",
"getActualType",
"(",
"Map",
"<",
"TypeVariable",
"<",
"?",
">",
",",
"Type",
">",
"map",
",",
"Type",
"type",
")",
"{",
"return",
"TypeVisitor",
".",
"of",
"(",
"type",
",",
"b",
"->",
"b",
".",
"onClass",
"(",
"c",
"-... | Get actual type by the type map.
@param map
@param type
@return The actual type. Return itself if it's already the most explicit type. | [
"Get",
"actual",
"type",
"by",
"the",
"type",
"map",
"."
] | train | https://github.com/XDean/Java-EX/blob/9208ba71c5b2af9f9bd979d01fab2ff5e433b3e7/src/main/java/xdean/jex/util/reflect/GenericUtil.java#L132-L145 |
landawn/AbacusUtil | src/com/landawn/abacus/util/CSVUtil.java | CSVUtil.exportCSV | public static long exportCSV(final Writer out, final ResultSet rs) throws UncheckedSQLException, UncheckedIOException {
"""
Exports the data from database to CVS. Title will be added at the first line and columns will be quoted.
@param out
@param rs
@return
"""
return exportCSV(out, rs, 0, Long.M... | java | public static long exportCSV(final Writer out, final ResultSet rs) throws UncheckedSQLException, UncheckedIOException {
return exportCSV(out, rs, 0, Long.MAX_VALUE, true, true);
} | [
"public",
"static",
"long",
"exportCSV",
"(",
"final",
"Writer",
"out",
",",
"final",
"ResultSet",
"rs",
")",
"throws",
"UncheckedSQLException",
",",
"UncheckedIOException",
"{",
"return",
"exportCSV",
"(",
"out",
",",
"rs",
",",
"0",
",",
"Long",
".",
"MAX_... | Exports the data from database to CVS. Title will be added at the first line and columns will be quoted.
@param out
@param rs
@return | [
"Exports",
"the",
"data",
"from",
"database",
"to",
"CVS",
".",
"Title",
"will",
"be",
"added",
"at",
"the",
"first",
"line",
"and",
"columns",
"will",
"be",
"quoted",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CSVUtil.java#L922-L924 |
osglworks/java-tool | src/main/java/org/osgl/Lang.java | F3.orElse | public F3<P1, P2, P3, R> orElse(final Func3<? super P1, ? super P2, ? super P3, ? extends R> fallback) {
"""
Returns a composed function that when applied, try to apply this function first, in case
a {@link NotAppliedException} is captured apply to the fallback function specified. This
method helps to implement ... | java | public F3<P1, P2, P3, R> orElse(final Func3<? super P1, ? super P2, ? super P3, ? extends R> fallback) {
final F3<P1, P2, P3, R> me = this;
return new F3<P1, P2, P3, R>() {
@Override
public R apply(P1 p1, P2 p2, P3 p3) {
try {
... | [
"public",
"F3",
"<",
"P1",
",",
"P2",
",",
"P3",
",",
"R",
">",
"orElse",
"(",
"final",
"Func3",
"<",
"?",
"super",
"P1",
",",
"?",
"super",
"P2",
",",
"?",
"super",
"P3",
",",
"?",
"extends",
"R",
">",
"fallback",
")",
"{",
"final",
"F3",
"<... | Returns a composed function that when applied, try to apply this function first, in case
a {@link NotAppliedException} is captured apply to the fallback function specified. This
method helps to implement partial function
@param fallback
the function to applied if this function doesn't apply to the parameter(s)
@return... | [
"Returns",
"a",
"composed",
"function",
"that",
"when",
"applied",
"try",
"to",
"apply",
"this",
"function",
"first",
"in",
"case",
"a",
"{",
"@link",
"NotAppliedException",
"}",
"is",
"captured",
"apply",
"to",
"the",
"fallback",
"function",
"specified",
".",... | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L1308-L1320 |
apache/incubator-shardingsphere | sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/adapter/AbstractConnectionAdapter.java | AbstractConnectionAdapter.getConnection | public final Connection getConnection(final String dataSourceName) throws SQLException {
"""
Get database connection.
@param dataSourceName data source name
@return database connection
@throws SQLException SQL exception
"""
return getConnections(ConnectionMode.MEMORY_STRICTLY, dataSourceName, 1).g... | java | public final Connection getConnection(final String dataSourceName) throws SQLException {
return getConnections(ConnectionMode.MEMORY_STRICTLY, dataSourceName, 1).get(0);
} | [
"public",
"final",
"Connection",
"getConnection",
"(",
"final",
"String",
"dataSourceName",
")",
"throws",
"SQLException",
"{",
"return",
"getConnections",
"(",
"ConnectionMode",
".",
"MEMORY_STRICTLY",
",",
"dataSourceName",
",",
"1",
")",
".",
"get",
"(",
"0",
... | Get database connection.
@param dataSourceName data source name
@return database connection
@throws SQLException SQL exception | [
"Get",
"database",
"connection",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/adapter/AbstractConnectionAdapter.java#L95-L97 |
networknt/light-4j | client/src/main/java/com/networknt/client/Http2Client.java | Http2Client.addAuthTokenTrace | public void addAuthTokenTrace(ClientRequest request, String token, String traceabilityId) {
"""
Add Authorization Code grant token the caller app gets from OAuth2 server and add traceabilityId
This is the method called from client like web server that want to have traceabilityId pass through.
@param request ... | java | public void addAuthTokenTrace(ClientRequest request, String token, String traceabilityId) {
if(token != null && !token.startsWith("Bearer ")) {
if(token.toUpperCase().startsWith("BEARER ")) {
// other cases of Bearer
token = "Bearer " + token.substring(7);
... | [
"public",
"void",
"addAuthTokenTrace",
"(",
"ClientRequest",
"request",
",",
"String",
"token",
",",
"String",
"traceabilityId",
")",
"{",
"if",
"(",
"token",
"!=",
"null",
"&&",
"!",
"token",
".",
"startsWith",
"(",
"\"Bearer \"",
")",
")",
"{",
"if",
"("... | Add Authorization Code grant token the caller app gets from OAuth2 server and add traceabilityId
This is the method called from client like web server that want to have traceabilityId pass through.
@param request the http request
@param token the bearer token
@param traceabilityId the traceability id | [
"Add",
"Authorization",
"Code",
"grant",
"token",
"the",
"caller",
"app",
"gets",
"from",
"OAuth2",
"server",
"and",
"add",
"traceabilityId"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/Http2Client.java#L294-L305 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java | ExceptionSoftening.visitCode | @Override
public void visitCode(Code obj) {
"""
overrides the visitor to look for methods that catch checked exceptions and
rethrow runtime exceptions
@param obj the context object of the currently parsed code block
"""
try {
Method method = getMethod();
if (method.isSyn... | java | @Override
public void visitCode(Code obj) {
try {
Method method = getMethod();
if (method.isSynthetic()) {
return;
}
isBooleanMethod = Type.BOOLEAN.equals(method.getReturnType());
if (isBooleanMethod || prescreen(method)) {
... | [
"@",
"Override",
"public",
"void",
"visitCode",
"(",
"Code",
"obj",
")",
"{",
"try",
"{",
"Method",
"method",
"=",
"getMethod",
"(",
")",
";",
"if",
"(",
"method",
".",
"isSynthetic",
"(",
")",
")",
"{",
"return",
";",
"}",
"isBooleanMethod",
"=",
"T... | overrides the visitor to look for methods that catch checked exceptions and
rethrow runtime exceptions
@param obj the context object of the currently parsed code block | [
"overrides",
"the",
"visitor",
"to",
"look",
"for",
"methods",
"that",
"catch",
"checked",
"exceptions",
"and",
"rethrow",
"runtime",
"exceptions"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java#L120-L153 |
epierce/cas-server-extension-token | src/main/java/edu/clayton/cas/support/token/util/Crypto.java | Crypto.encryptWithKey | public static String encryptWithKey(String string, String key)
throws NoSuchPaddingException,
NoSuchAlgorithmException,
InvalidKeyException,
BadPaddingException,
IllegalBlockSizeException,
InvalidAlgorithmParameterException {
"""
Returns a {@link Base64} encoded encrypted string... | java | public static String encryptWithKey(String string, String key)
throws NoSuchPaddingException,
NoSuchAlgorithmException,
InvalidKeyException,
BadPaddingException,
IllegalBlockSizeException,
InvalidAlgorithmParameterException
{
String encryptedString;
byte[] encryptedStringD... | [
"public",
"static",
"String",
"encryptWithKey",
"(",
"String",
"string",
",",
"String",
"key",
")",
"throws",
"NoSuchPaddingException",
",",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
",",
"BadPaddingException",
",",
"IllegalBlockSizeException",
",",
"Invalid... | Returns a {@link Base64} encoded encrypted string.
@param string The string to encrypt.
@param key The key to use for encryption.
@return The encrypted encoded string.
@throws NoSuchPaddingException
@throws NoSuchAlgorithmException
@throws InvalidKeyException
@throws BadPaddingException
@throws IllegalBlockSizeExcepti... | [
"Returns",
"a",
"{",
"@link",
"Base64",
"}",
"encoded",
"encrypted",
"string",
"."
] | train | https://github.com/epierce/cas-server-extension-token/blob/b63399e6b516a25f624d09161466db87fcec974b/src/main/java/edu/clayton/cas/support/token/util/Crypto.java#L89-L122 |
alipay/sofa-rpc | extension-impl/remoting-bolt/src/main/java/com/alipay/sofa/rpc/transport/bolt/BoltClientTransport.java | BoltClientTransport.doInvokeSync | protected SofaResponse doInvokeSync(SofaRequest request, InvokeContext invokeContext, int timeoutMillis)
throws RemotingException, InterruptedException {
"""
同步调用
@param request 请求对象
@param invokeContext 调用上下文
@param timeoutMillis 超时时间(毫秒)
@return 返回对象
@throws RemotingException 远程调用异常
@thr... | java | protected SofaResponse doInvokeSync(SofaRequest request, InvokeContext invokeContext, int timeoutMillis)
throws RemotingException, InterruptedException {
return (SofaResponse) RPC_CLIENT.invokeSync(url, request, invokeContext, timeoutMillis);
} | [
"protected",
"SofaResponse",
"doInvokeSync",
"(",
"SofaRequest",
"request",
",",
"InvokeContext",
"invokeContext",
",",
"int",
"timeoutMillis",
")",
"throws",
"RemotingException",
",",
"InterruptedException",
"{",
"return",
"(",
"SofaResponse",
")",
"RPC_CLIENT",
".",
... | 同步调用
@param request 请求对象
@param invokeContext 调用上下文
@param timeoutMillis 超时时间(毫秒)
@return 返回对象
@throws RemotingException 远程调用异常
@throws InterruptedException 中断异常
@since 5.2.0 | [
"同步调用"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/remoting-bolt/src/main/java/com/alipay/sofa/rpc/transport/bolt/BoltClientTransport.java#L273-L276 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/tokens/ExpressionToken.java | ExpressionToken.listLookup | protected final Object listLookup(List list, int index) {
"""
Get the value in a {@link List} at <code>index</code>.
@param list the List
@param index the index
@return the value returned from <code>list.get(index)</code>
"""
LOGGER.trace("get value in List index " + index);
return list.get(... | java | protected final Object listLookup(List list, int index) {
LOGGER.trace("get value in List index " + index);
return list.get(index);
} | [
"protected",
"final",
"Object",
"listLookup",
"(",
"List",
"list",
",",
"int",
"index",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"get value in List index \"",
"+",
"index",
")",
";",
"return",
"list",
".",
"get",
"(",
"index",
")",
";",
"}"
] | Get the value in a {@link List} at <code>index</code>.
@param list the List
@param index the index
@return the value returned from <code>list.get(index)</code> | [
"Get",
"the",
"value",
"in",
"a",
"{"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/tokens/ExpressionToken.java#L72-L75 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.removeGroup | private Group removeGroup(Session session, Group group, boolean broadcast) throws Exception {
"""
Removes group and all related membership entities. Throws exception if children exist.
"""
if (group == null)
{
throw new OrganizationServiceException("Can not remove group, since it is null")... | java | private Group removeGroup(Session session, Group group, boolean broadcast) throws Exception
{
if (group == null)
{
throw new OrganizationServiceException("Can not remove group, since it is null");
}
Node groupNode = utils.getGroupNode(session, group);
// need to minus one bec... | [
"private",
"Group",
"removeGroup",
"(",
"Session",
"session",
",",
"Group",
"group",
",",
"boolean",
"broadcast",
")",
"throws",
"Exception",
"{",
"if",
"(",
"group",
"==",
"null",
")",
"{",
"throw",
"new",
"OrganizationServiceException",
"(",
"\"Can not remove ... | Removes group and all related membership entities. Throws exception if children exist. | [
"Removes",
"group",
"and",
"all",
"related",
"membership",
"entities",
".",
"Throws",
"exception",
"if",
"children",
"exist",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L358-L393 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spy1st | public static <T> Consumer<T> spy1st(Consumer<T> consumer, Box<T> param) {
"""
Proxies a binary consumer spying for first parameter.
@param <T> the consumer parameter type
@param consumer the consumer that will be spied
@param param a box that will be containing the spied parameter
@return the proxied consum... | java | public static <T> Consumer<T> spy1st(Consumer<T> consumer, Box<T> param) {
return spy(consumer, param);
} | [
"public",
"static",
"<",
"T",
">",
"Consumer",
"<",
"T",
">",
"spy1st",
"(",
"Consumer",
"<",
"T",
">",
"consumer",
",",
"Box",
"<",
"T",
">",
"param",
")",
"{",
"return",
"spy",
"(",
"consumer",
",",
"param",
")",
";",
"}"
] | Proxies a binary consumer spying for first parameter.
@param <T> the consumer parameter type
@param consumer the consumer that will be spied
@param param a box that will be containing the spied parameter
@return the proxied consumer | [
"Proxies",
"a",
"binary",
"consumer",
"spying",
"for",
"first",
"parameter",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L387-L389 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.writeHistoryProject | public void writeHistoryProject(CmsDbContext dbc, int publishTag, long publishDate) throws CmsDataAccessException {
"""
Creates an historical entry of the current project.<p>
@param dbc the current database context
@param publishTag the version
@param publishDate the date of publishing
@throws CmsDataAcces... | java | public void writeHistoryProject(CmsDbContext dbc, int publishTag, long publishDate) throws CmsDataAccessException {
getHistoryDriver(dbc).writeProject(dbc, publishTag, publishDate);
} | [
"public",
"void",
"writeHistoryProject",
"(",
"CmsDbContext",
"dbc",
",",
"int",
"publishTag",
",",
"long",
"publishDate",
")",
"throws",
"CmsDataAccessException",
"{",
"getHistoryDriver",
"(",
"dbc",
")",
".",
"writeProject",
"(",
"dbc",
",",
"publishTag",
",",
... | Creates an historical entry of the current project.<p>
@param dbc the current database context
@param publishTag the version
@param publishDate the date of publishing
@throws CmsDataAccessException if operation was not successful | [
"Creates",
"an",
"historical",
"entry",
"of",
"the",
"current",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9870-L9873 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/validator/CommonsValidatorGenerator.java | CommonsValidatorGenerator.getJavascriptBegin | protected String getJavascriptBegin(String jsFormName, String methods) {
"""
Returns the opening script element and some initial javascript.
"""
StringBuffer sb = new StringBuffer();
String name = jsFormName.replace('/', '_'); // remove any '/' characters
name = jsFormName.substring(0, 1).toUpperCase()
... | java | protected String getJavascriptBegin(String jsFormName, String methods) {
StringBuffer sb = new StringBuffer();
String name = jsFormName.replace('/', '_'); // remove any '/' characters
name = jsFormName.substring(0, 1).toUpperCase()
+ jsFormName.substring(1, jsFormName.length());
sb.append("\n var bCanc... | [
"protected",
"String",
"getJavascriptBegin",
"(",
"String",
"jsFormName",
",",
"String",
"methods",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"String",
"name",
"=",
"jsFormName",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'"... | Returns the opening script element and some initial javascript. | [
"Returns",
"the",
"opening",
"script",
"element",
"and",
"some",
"initial",
"javascript",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/validator/CommonsValidatorGenerator.java#L282-L312 |
mapbox/mapbox-navigation-android | libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/map/NavigationMapboxMap.java | NavigationMapboxMap.saveStateWith | public void saveStateWith(String key, Bundle outState) {
"""
Can be used to store the current state of the map in
{@link android.support.v4.app.FragmentActivity#onSaveInstanceState(Bundle, PersistableBundle)}.
<p>
This method uses {@link NavigationMapboxMapInstanceState}, stored with the provided key. This key... | java | public void saveStateWith(String key, Bundle outState) {
settings.updateCurrentPadding(mapPaddingAdjustor.retrieveCurrentPadding());
settings.updateShouldUseDefaultPadding(mapPaddingAdjustor.isUsingDefault());
settings.updateCameraTrackingMode(mapCamera.getCameraTrackingMode());
settings.updateLocationF... | [
"public",
"void",
"saveStateWith",
"(",
"String",
"key",
",",
"Bundle",
"outState",
")",
"{",
"settings",
".",
"updateCurrentPadding",
"(",
"mapPaddingAdjustor",
".",
"retrieveCurrentPadding",
"(",
")",
")",
";",
"settings",
".",
"updateShouldUseDefaultPadding",
"("... | Can be used to store the current state of the map in
{@link android.support.v4.app.FragmentActivity#onSaveInstanceState(Bundle, PersistableBundle)}.
<p>
This method uses {@link NavigationMapboxMapInstanceState}, stored with the provided key. This key
can also later be used to extract the {@link NavigationMapboxMapInst... | [
"Can",
"be",
"used",
"to",
"store",
"the",
"current",
"state",
"of",
"the",
"map",
"in",
"{",
"@link",
"android",
".",
"support",
".",
"v4",
".",
"app",
".",
"FragmentActivity#onSaveInstanceState",
"(",
"Bundle",
"PersistableBundle",
")",
"}",
".",
"<p",
"... | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/map/NavigationMapboxMap.java#L295-L302 |
Pixplicity/EasyPrefs | library/src/main/java/com/pixplicity/easyprefs/library/Prefs.java | Prefs.getStringSet | @SuppressWarnings("WeakerAccess")
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static Set<String> getStringSet(final String key, final Set<String> defValue) {
"""
Retrieves a Set of Strings as stored by {@link #putStringSet(String, Set)}. On Honeycomb and
later this will call the native implementation... | java | @SuppressWarnings("WeakerAccess")
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static Set<String> getStringSet(final String key, final Set<String> defValue) {
SharedPreferences prefs = getPreferences();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
return prefs.ge... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"public",
"static",
"Set",
"<",
"String",
">",
"getStringSet",
"(",
"final",
"String",
"key",
",",
"final",
"Set",
"<",
"Strin... | Retrieves a Set of Strings as stored by {@link #putStringSet(String, Set)}. On Honeycomb and
later this will call the native implementation in SharedPreferences, on older SDKs this will
call {@link #getOrderedStringSet(String, Set)}.
<strong>Note that the native implementation of {@link SharedPreferences#getStringSet(S... | [
"Retrieves",
"a",
"Set",
"of",
"Strings",
"as",
"stored",
"by",
"{",
"@link",
"#putStringSet",
"(",
"String",
"Set",
")",
"}",
".",
"On",
"Honeycomb",
"and",
"later",
"this",
"will",
"call",
"the",
"native",
"implementation",
"in",
"SharedPreferences",
"on",... | train | https://github.com/Pixplicity/EasyPrefs/blob/0ca13a403bf099019a13d68b38edcf55fca5a653/library/src/main/java/com/pixplicity/easyprefs/library/Prefs.java#L230-L240 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/Matrix.java | Matrix.getColumn | public Vec getColumn(int j) {
"""
Creates a vector that has a copy of the values in column <i>j</i> of this
matrix. Altering it will not effect the values in <i>this</i> matrix
@param j the column to copy
@return a clone of the column as a {@link Vec}
"""
if(j < 0 || j >= cols())
throw n... | java | public Vec getColumn(int j)
{
if(j < 0 || j >= cols())
throw new ArithmeticException("Column was not a valid value " + j + " not in [0," + (cols()-1) + "]");
DenseVector c = new DenseVector(rows());
for(int i =0; i < rows(); i++)
c.set(i, get(i, j));
return c;... | [
"public",
"Vec",
"getColumn",
"(",
"int",
"j",
")",
"{",
"if",
"(",
"j",
"<",
"0",
"||",
"j",
">=",
"cols",
"(",
")",
")",
"throw",
"new",
"ArithmeticException",
"(",
"\"Column was not a valid value \"",
"+",
"j",
"+",
"\" not in [0,\"",
"+",
"(",
"cols"... | Creates a vector that has a copy of the values in column <i>j</i> of this
matrix. Altering it will not effect the values in <i>this</i> matrix
@param j the column to copy
@return a clone of the column as a {@link Vec} | [
"Creates",
"a",
"vector",
"that",
"has",
"a",
"copy",
"of",
"the",
"values",
"in",
"column",
"<i",
">",
"j<",
"/",
"i",
">",
"of",
"this",
"matrix",
".",
"Altering",
"it",
"will",
"not",
"effect",
"the",
"values",
"in",
"<i",
">",
"this<",
"/",
"i"... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L610-L618 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.getMarkerAnchor | public Content getMarkerAnchor(String anchorName, Content anchorContent) {
"""
Get the marker anchor which will be added to the documentation tree.
@param anchorName the anchor name attribute
@param anchorContent the content that should be added to the anchor
@return a content tree for the marker anchor
"... | java | public Content getMarkerAnchor(String anchorName, Content anchorContent) {
if (anchorContent == null)
anchorContent = new Comment(" ");
Content markerAnchor = HtmlTree.A_NAME(anchorName, anchorContent);
return markerAnchor;
} | [
"public",
"Content",
"getMarkerAnchor",
"(",
"String",
"anchorName",
",",
"Content",
"anchorContent",
")",
"{",
"if",
"(",
"anchorContent",
"==",
"null",
")",
"anchorContent",
"=",
"new",
"Comment",
"(",
"\" \"",
")",
";",
"Content",
"markerAnchor",
"=",
"Html... | Get the marker anchor which will be added to the documentation tree.
@param anchorName the anchor name attribute
@param anchorContent the content that should be added to the anchor
@return a content tree for the marker anchor | [
"Get",
"the",
"marker",
"anchor",
"which",
"will",
"be",
"added",
"to",
"the",
"documentation",
"tree",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L902-L907 |
wildfly/wildfly-core | protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java | AbstractMessageHandler.handleMessage | @Override
public void handleMessage(final Channel channel, final DataInput input, final ManagementProtocolHeader header) throws IOException {
"""
Handle a message.
@param channel the channel
@param input the message
@param header the management protocol header
@throws IOException
"""
final by... | java | @Override
public void handleMessage(final Channel channel, final DataInput input, final ManagementProtocolHeader header) throws IOException {
final byte type = header.getType();
if(type == ManagementProtocol.TYPE_RESPONSE) {
// Handle response to local requests
final Manageme... | [
"@",
"Override",
"public",
"void",
"handleMessage",
"(",
"final",
"Channel",
"channel",
",",
"final",
"DataInput",
"input",
",",
"final",
"ManagementProtocolHeader",
"header",
")",
"throws",
"IOException",
"{",
"final",
"byte",
"type",
"=",
"header",
".",
"getTy... | Handle a message.
@param channel the channel
@param input the message
@param header the management protocol header
@throws IOException | [
"Handle",
"a",
"message",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java#L221-L250 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java | SqlExecutor.queryAndClosePs | public static <T> T queryAndClosePs(PreparedStatement ps, RsHandler<T> rsh, Object... params) throws SQLException {
"""
执行查询语句并关闭PreparedStatement
@param <T> 处理结果类型
@param ps PreparedStatement
@param rsh 结果集处理对象
@param params 参数
@return 结果对象
@throws SQLException SQL执行异常
"""
try {
return query(ps, ... | java | public static <T> T queryAndClosePs(PreparedStatement ps, RsHandler<T> rsh, Object... params) throws SQLException {
try {
return query(ps, rsh, params);
} finally {
DbUtil.close(ps);
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"queryAndClosePs",
"(",
"PreparedStatement",
"ps",
",",
"RsHandler",
"<",
"T",
">",
"rsh",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"return",
"query",
"(",
"ps",
",",
"rsh",
... | 执行查询语句并关闭PreparedStatement
@param <T> 处理结果类型
@param ps PreparedStatement
@param rsh 结果集处理对象
@param params 参数
@return 结果对象
@throws SQLException SQL执行异常 | [
"执行查询语句并关闭PreparedStatement"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java#L327-L333 |
landawn/AbacusUtil | src/com/landawn/abacus/util/StringUtil.java | StringUtil.replaceAll | public static String replaceAll(final String str, final String target, final String replacement) {
"""
<p>
Replaces all occurrences of a String within another String.
</p>
<p>
A {@code null} reference passed to this method is a no-op.
</p>
<pre>
N.replaceAll(null, *, *) = null
N.replaceAll("", *... | java | public static String replaceAll(final String str, final String target, final String replacement) {
return replaceAll(str, 0, target, replacement);
} | [
"public",
"static",
"String",
"replaceAll",
"(",
"final",
"String",
"str",
",",
"final",
"String",
"target",
",",
"final",
"String",
"replacement",
")",
"{",
"return",
"replaceAll",
"(",
"str",
",",
"0",
",",
"target",
",",
"replacement",
")",
";",
"}"
] | <p>
Replaces all occurrences of a String within another String.
</p>
<p>
A {@code null} reference passed to this method is a no-op.
</p>
<pre>
N.replaceAll(null, *, *) = null
N.replaceAll("", *, *) = ""
N.replaceAll("any", null, *) = "any"
N.replaceAll("any", *, null) = "any"
N.replaceAll("any",... | [
"<p",
">",
"Replaces",
"all",
"occurrences",
"of",
"a",
"String",
"within",
"another",
"String",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/StringUtil.java#L985-L987 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/ServerDumpPackager.java | ServerDumpPackager.packageServerDumps | private ReturnCode packageServerDumps(File packageFile, List<String> javaDumps) {
"""
Creates an archive containing the server dumps, server configurations.
@param packageFile
@return
"""
DumpProcessor processor = new DumpProcessor(serverName, packageFile, bootProps, javaDumps);
return proc... | java | private ReturnCode packageServerDumps(File packageFile, List<String> javaDumps) {
DumpProcessor processor = new DumpProcessor(serverName, packageFile, bootProps, javaDumps);
return processor.execute();
} | [
"private",
"ReturnCode",
"packageServerDumps",
"(",
"File",
"packageFile",
",",
"List",
"<",
"String",
">",
"javaDumps",
")",
"{",
"DumpProcessor",
"processor",
"=",
"new",
"DumpProcessor",
"(",
"serverName",
",",
"packageFile",
",",
"bootProps",
",",
"javaDumps",... | Creates an archive containing the server dumps, server configurations.
@param packageFile
@return | [
"Creates",
"an",
"archive",
"containing",
"the",
"server",
"dumps",
"server",
"configurations",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/ServerDumpPackager.java#L354-L357 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.attributeAbsent | public static void attributeAbsent(Class<?> aClass,Attribute aField) {
"""
Thrown if the attribute doesn't exist in aClass.
@param aClass class that not contains aField
@param aField the missing field
"""
throw new XmlMappingAttributeDoesNotExistException(MSG.INSTANCE.message(xmlMappingAttributeDoesNotExi... | java | public static void attributeAbsent(Class<?> aClass,Attribute aField){
throw new XmlMappingAttributeDoesNotExistException(MSG.INSTANCE.message(xmlMappingAttributeDoesNotExistException2,aField.getName(),aClass.getSimpleName(),"API"));
} | [
"public",
"static",
"void",
"attributeAbsent",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"Attribute",
"aField",
")",
"{",
"throw",
"new",
"XmlMappingAttributeDoesNotExistException",
"(",
"MSG",
".",
"INSTANCE",
".",
"message",
"(",
"xmlMappingAttributeDoesNotExist... | Thrown if the attribute doesn't exist in aClass.
@param aClass class that not contains aField
@param aField the missing field | [
"Thrown",
"if",
"the",
"attribute",
"doesn",
"t",
"exist",
"in",
"aClass",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L499-L501 |
deeplearning4j/deeplearning4j | datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java | ArrowConverter.ndarrayVectorOf | public static VarBinaryVector ndarrayVectorOf(BufferAllocator allocator,String name,int length) {
"""
Create an ndarray vector that stores structs
of {@link INDArray}
based on the {@link org.apache.arrow.flatbuf.Tensor}
format
@param allocator the allocator to use
@param name the name of the vector
@param le... | java | public static VarBinaryVector ndarrayVectorOf(BufferAllocator allocator,String name,int length) {
VarBinaryVector ret = new VarBinaryVector(name,allocator);
ret.allocateNewSafe();
ret.setValueCount(length);
return ret;
} | [
"public",
"static",
"VarBinaryVector",
"ndarrayVectorOf",
"(",
"BufferAllocator",
"allocator",
",",
"String",
"name",
",",
"int",
"length",
")",
"{",
"VarBinaryVector",
"ret",
"=",
"new",
"VarBinaryVector",
"(",
"name",
",",
"allocator",
")",
";",
"ret",
".",
... | Create an ndarray vector that stores structs
of {@link INDArray}
based on the {@link org.apache.arrow.flatbuf.Tensor}
format
@param allocator the allocator to use
@param name the name of the vector
@param length the number of vectors to store
@return | [
"Create",
"an",
"ndarray",
"vector",
"that",
"stores",
"structs",
"of",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L943-L948 |
dbracewell/mango | src/main/java/com/davidbracewell/conversion/Val.java | Val.asMap | public <K, V> Map<K, V> asMap(@NonNull Class<?> mapClass, @NonNull Class<K> keyClass, @NonNull Class<V> valueClass) {
"""
Converts the object to a map
@param <K> the type parameter
@param <V> the type parameter
@param mapClass The map class
@param keyClass The key class
@param valueClass T... | java | public <K, V> Map<K, V> asMap(@NonNull Class<?> mapClass, @NonNull Class<K> keyClass, @NonNull Class<V> valueClass) {
return convert(toConvert, mapClass, keyClass, valueClass);
} | [
"public",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"asMap",
"(",
"@",
"NonNull",
"Class",
"<",
"?",
">",
"mapClass",
",",
"@",
"NonNull",
"Class",
"<",
"K",
">",
"keyClass",
",",
"@",
"NonNull",
"Class",
"<",
"V",
">",
"valueCla... | Converts the object to a map
@param <K> the type parameter
@param <V> the type parameter
@param mapClass The map class
@param keyClass The key class
@param valueClass The value class
@return the object as a map | [
"Converts",
"the",
"object",
"to",
"a",
"map"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/conversion/Val.java#L130-L132 |
grantland/android-autofittextview | library/src/main/java/me/grantland/widget/AutofitHelper.java | AutofitHelper.setMaxTextSize | public AutofitHelper setMaxTextSize(int unit, float size) {
"""
Set the maximum text size to a given unit and value. See TypedValue for the possible
dimension units.
@param unit The desired dimension unit.
@param size The desired size in the given units.
@attr ref android.R.styleable#TextView_textSize
... | java | public AutofitHelper setMaxTextSize(int unit, float size) {
Context context = mTextView.getContext();
Resources r = Resources.getSystem();
if (context != null) {
r = context.getResources();
}
setRawMaxTextSize(TypedValue.applyDimension(unit, size, r.getDisplayMetric... | [
"public",
"AutofitHelper",
"setMaxTextSize",
"(",
"int",
"unit",
",",
"float",
"size",
")",
"{",
"Context",
"context",
"=",
"mTextView",
".",
"getContext",
"(",
")",
";",
"Resources",
"r",
"=",
"Resources",
".",
"getSystem",
"(",
")",
";",
"if",
"(",
"co... | Set the maximum text size to a given unit and value. See TypedValue for the possible
dimension units.
@param unit The desired dimension unit.
@param size The desired size in the given units.
@attr ref android.R.styleable#TextView_textSize | [
"Set",
"the",
"maximum",
"text",
"size",
"to",
"a",
"given",
"unit",
"and",
"value",
".",
"See",
"TypedValue",
"for",
"the",
"possible",
"dimension",
"units",
"."
] | train | https://github.com/grantland/android-autofittextview/blob/5c565aa5c3ed62aaa31140440bb526e7435e7947/library/src/main/java/me/grantland/widget/AutofitHelper.java#L381-L391 |
citrusframework/citrus | modules/citrus-jms/src/main/java/com/consol/citrus/jms/endpoint/resolver/DynamicDestinationNameResolver.java | DynamicDestinationNameResolver.resolveEndpointUri | public String resolveEndpointUri(Message message, String defaultName) {
"""
Get the endpoint uri according to message header entry with fallback default uri.
"""
Map<String, Object> headers = message.getHeaders();
String destinationName;
if (headers.containsKey(DESTINATION_HEADER_NAME)... | java | public String resolveEndpointUri(Message message, String defaultName) {
Map<String, Object> headers = message.getHeaders();
String destinationName;
if (headers.containsKey(DESTINATION_HEADER_NAME)) {
destinationName = headers.get(DESTINATION_HEADER_NAME).toString();
} else i... | [
"public",
"String",
"resolveEndpointUri",
"(",
"Message",
"message",
",",
"String",
"defaultName",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
"=",
"message",
".",
"getHeaders",
"(",
")",
";",
"String",
"destinationName",
";",
"if",
"(",
... | Get the endpoint uri according to message header entry with fallback default uri. | [
"Get",
"the",
"endpoint",
"uri",
"according",
"to",
"message",
"header",
"entry",
"with",
"fallback",
"default",
"uri",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jms/src/main/java/com/consol/citrus/jms/endpoint/resolver/DynamicDestinationNameResolver.java#L42-L60 |
eurekaclinical/eurekaclinical-common | src/main/java/org/eurekaclinical/common/resource/AbstractResource.java | AbstractResource.getAny | @GET
@Path("/ {
"""
Gets the object with the given unique identifier.
@param inId the unique identifier. Cannot be <code>null</code>.
@param req the HTTP servlet request.
@return the object with the given unique identifier. Guaranteed not
<code>null</code>.
@throws HttpStatusException if there is no ... | java | @GET
@Path("/{id}")
@Produces(MediaType.APPLICATION_JSON)
public C getAny(@PathParam("id") Long inId, @Context HttpServletRequest req) {
E entity = this.dao.retrieve(inId);
if (entity == null) {
throw new HttpStatusException(Response.Status.NOT_FOUND);
} else if (isAuthor... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/{id}\"",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"C",
"getAny",
"(",
"@",
"PathParam",
"(",
"\"id\"",
")",
"Long",
"inId",
",",
"@",
"Context",
"HttpServletRequest",
"req",
")",
"{... | Gets the object with the given unique identifier.
@param inId the unique identifier. Cannot be <code>null</code>.
@param req the HTTP servlet request.
@return the object with the given unique identifier. Guaranteed not
<code>null</code>.
@throws HttpStatusException if there is no object with the given
unique identif... | [
"Gets",
"the",
"object",
"with",
"the",
"given",
"unique",
"identifier",
"."
] | train | https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/resource/AbstractResource.java#L137-L149 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java | KeyVaultClientCustomImpl.listCertificateVersionsAsync | public ServiceFuture<List<CertificateItem>> listCertificateVersionsAsync(final String vaultBaseUrl,
final String certificateName, final ListOperationCallback<CertificateItem> serviceCallback) {
"""
List the versions of a certificate.
@param vaultBaseUrl
The vault name, e.g. https://myvault.vault.az... | java | public ServiceFuture<List<CertificateItem>> listCertificateVersionsAsync(final String vaultBaseUrl,
final String certificateName, final ListOperationCallback<CertificateItem> serviceCallback) {
return getCertificateVersionsAsync(vaultBaseUrl, certificateName, serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"CertificateItem",
">",
">",
"listCertificateVersionsAsync",
"(",
"final",
"String",
"vaultBaseUrl",
",",
"final",
"String",
"certificateName",
",",
"final",
"ListOperationCallback",
"<",
"CertificateItem",
">",
"serviceCallb... | List the versions of a certificate.
@param vaultBaseUrl
The vault name, e.g. https://myvault.vault.azure.net
@param certificateName
The name of the certificate
@param serviceCallback
the async ServiceCallback to handle successful and failed
responses.
@return the {@link ServiceFuture} object | [
"List",
"the",
"versions",
"of",
"a",
"certificate",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java#L1561-L1564 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.writeString | public void writeString(OutputStream out, String value) throws IOException {
"""
Encode a String value as JSON. An array is used to wrap the value:
[ String ]
@param out The stream to write JSON to
@param value The String value to encode.
@throws IOException If an I/O error occurs
@see #readString(InputStre... | java | public void writeString(OutputStream out, String value) throws IOException {
writeStartArray(out);
writeStringInternal(out, value);
writeEndArray(out);
} | [
"public",
"void",
"writeString",
"(",
"OutputStream",
"out",
",",
"String",
"value",
")",
"throws",
"IOException",
"{",
"writeStartArray",
"(",
"out",
")",
";",
"writeStringInternal",
"(",
"out",
",",
"value",
")",
";",
"writeEndArray",
"(",
"out",
")",
";",... | Encode a String value as JSON. An array is used to wrap the value:
[ String ]
@param out The stream to write JSON to
@param value The String value to encode.
@throws IOException If an I/O error occurs
@see #readString(InputStream) | [
"Encode",
"a",
"String",
"value",
"as",
"JSON",
".",
"An",
"array",
"is",
"used",
"to",
"wrap",
"the",
"value",
":",
"[",
"String",
"]"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L746-L750 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ssl_certkey_policy.java | ns_ssl_certkey_policy.do_poll | public static ns_ssl_certkey_policy do_poll(nitro_service client, ns_ssl_certkey_policy resource) throws Exception {
"""
<pre>
Use this operation to poll all SSL certificates from all NetScalers and update the database.
</pre>
"""
return ((ns_ssl_certkey_policy[]) resource.perform_operation(client, "do_po... | java | public static ns_ssl_certkey_policy do_poll(nitro_service client, ns_ssl_certkey_policy resource) throws Exception
{
return ((ns_ssl_certkey_policy[]) resource.perform_operation(client, "do_poll"))[0];
} | [
"public",
"static",
"ns_ssl_certkey_policy",
"do_poll",
"(",
"nitro_service",
"client",
",",
"ns_ssl_certkey_policy",
"resource",
")",
"throws",
"Exception",
"{",
"return",
"(",
"(",
"ns_ssl_certkey_policy",
"[",
"]",
")",
"resource",
".",
"perform_operation",
"(",
... | <pre>
Use this operation to poll all SSL certificates from all NetScalers and update the database.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"poll",
"all",
"SSL",
"certificates",
"from",
"all",
"NetScalers",
"and",
"update",
"the",
"database",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ssl_certkey_policy.java#L106-L109 |
atteo/classindex | classindex/src/main/java/org/atteo/classindex/ClassIndex.java | ClassIndex.getPackageClasses | public static Iterable<Class<?>> getPackageClasses(String packageName) {
"""
Retrieves a list of classes from given package.
<p/>
<p>
The package must be annotated with {@link IndexSubclasses} for the classes inside
to be indexed at compile-time by {@link org.atteo.classindex.processor.ClassIndexProcessor}.
<... | java | public static Iterable<Class<?>> getPackageClasses(String packageName) {
return getPackageClasses(packageName, Thread.currentThread().getContextClassLoader());
} | [
"public",
"static",
"Iterable",
"<",
"Class",
"<",
"?",
">",
">",
"getPackageClasses",
"(",
"String",
"packageName",
")",
"{",
"return",
"getPackageClasses",
"(",
"packageName",
",",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
... | Retrieves a list of classes from given package.
<p/>
<p>
The package must be annotated with {@link IndexSubclasses} for the classes inside
to be indexed at compile-time by {@link org.atteo.classindex.processor.ClassIndexProcessor}.
</p>
@param packageName name of the package to search classes for
@return list of class... | [
"Retrieves",
"a",
"list",
"of",
"classes",
"from",
"given",
"package",
".",
"<p",
"/",
">",
"<p",
">",
"The",
"package",
"must",
"be",
"annotated",
"with",
"{",
"@link",
"IndexSubclasses",
"}",
"for",
"the",
"classes",
"inside",
"to",
"be",
"indexed",
"a... | train | https://github.com/atteo/classindex/blob/ad76c6bd8b4e84c594d94e48f466a095ffe2306a/classindex/src/main/java/org/atteo/classindex/ClassIndex.java#L173-L175 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.getStorageAccount | public StorageAccountInfoInner getStorageAccount(String resourceGroupName, String accountName, String storageAccountName) {
"""
Gets the specified Azure Storage account linked to the given Data Lake Analytics account.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Anal... | java | public StorageAccountInfoInner getStorageAccount(String resourceGroupName, String accountName, String storageAccountName) {
return getStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName).toBlocking().single().body();
} | [
"public",
"StorageAccountInfoInner",
"getStorageAccount",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"storageAccountName",
")",
"{",
"return",
"getStorageAccountWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",... | Gets the specified Azure Storage account linked to the given Data Lake Analytics account.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.
@param accountName The name of the Data Lake Analytics account from which to retrieve Azure storage account details.
@pa... | [
"Gets",
"the",
"specified",
"Azure",
"Storage",
"account",
"linked",
"to",
"the",
"given",
"Data",
"Lake",
"Analytics",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java#L192-L194 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/DateFormat.java | DateFormat.getDateTimeInstance | public final static DateFormat getDateTimeInstance(int dateStyle,
int timeStyle) {
"""
Gets the date/time formatter with the given date and time
formatting styles for the default locale.
@param dateStyle the given date formatting style. For example,
SHORT f... | java | public final static DateFormat getDateTimeInstance(int dateStyle,
int timeStyle)
{
return get(timeStyle, dateStyle, 3, Locale.getDefault(Locale.Category.FORMAT));
} | [
"public",
"final",
"static",
"DateFormat",
"getDateTimeInstance",
"(",
"int",
"dateStyle",
",",
"int",
"timeStyle",
")",
"{",
"return",
"get",
"(",
"timeStyle",
",",
"dateStyle",
",",
"3",
",",
"Locale",
".",
"getDefault",
"(",
"Locale",
".",
"Category",
"."... | Gets the date/time formatter with the given date and time
formatting styles for the default locale.
@param dateStyle the given date formatting style. For example,
SHORT for "M/d/yy" in the US locale.
@param timeStyle the given time formatting style. For example,
SHORT for "h:mm a" in the US locale.
@return a date/time ... | [
"Gets",
"the",
"date",
"/",
"time",
"formatter",
"with",
"the",
"given",
"date",
"and",
"time",
"formatting",
"styles",
"for",
"the",
"default",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/DateFormat.java#L532-L536 |
networknt/light-4j | config/src/main/java/com/networknt/config/CentralizedManagement.java | CentralizedManagement.convertMapToObj | private static Object convertMapToObj(Map<String, Object> map, Class clazz) {
"""
Method used to convert map to object based on the reference class provided
"""
ObjectMapper mapper = new ObjectMapper();
Object obj = mapper.convertValue(map, clazz);
return obj;
} | java | private static Object convertMapToObj(Map<String, Object> map, Class clazz) {
ObjectMapper mapper = new ObjectMapper();
Object obj = mapper.convertValue(map, clazz);
return obj;
} | [
"private",
"static",
"Object",
"convertMapToObj",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
",",
"Class",
"clazz",
")",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"Object",
"obj",
"=",
"mapper",
".",
"convertValue... | Method used to convert map to object based on the reference class provided | [
"Method",
"used",
"to",
"convert",
"map",
"to",
"object",
"based",
"on",
"the",
"reference",
"class",
"provided"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/config/src/main/java/com/networknt/config/CentralizedManagement.java#L81-L85 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAddressPersistenceImpl.java | CommerceAddressPersistenceImpl.findAll | @Override
public List<CommerceAddress> findAll(int start, int end) {
"""
Returns a range of all the commerce addresses.
<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.... | java | @Override
public List<CommerceAddress> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceAddress",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce addresses.
<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 set. Setting both <code>st... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"addresses",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAddressPersistenceImpl.java#L4215-L4218 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java | TopicsInner.listSharedAccessKeys | public TopicSharedAccessKeysInner listSharedAccessKeys(String resourceGroupName, String topicName) {
"""
List keys for a topic.
List the two keys used to publish to a topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param topicName Name of the topic
@throws Ille... | java | public TopicSharedAccessKeysInner listSharedAccessKeys(String resourceGroupName, String topicName) {
return listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, topicName).toBlocking().single().body();
} | [
"public",
"TopicSharedAccessKeysInner",
"listSharedAccessKeys",
"(",
"String",
"resourceGroupName",
",",
"String",
"topicName",
")",
"{",
"return",
"listSharedAccessKeysWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"topicName",
")",
".",
"toBlocking",
"(",
")",
... | List keys for a topic.
List the two keys used to publish to a topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param topicName Name of the topic
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejec... | [
"List",
"keys",
"for",
"a",
"topic",
".",
"List",
"the",
"two",
"keys",
"used",
"to",
"publish",
"to",
"a",
"topic",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java#L1076-L1078 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java | InternalService.uploadContent | public Observable<ComapiResult<UploadContentResponse>> uploadContent(@NonNull final String folder, @NonNull final ContentData data) {
"""
Upload content data.
@param folder Folder name to put the file in.
@param data Content data.
@return Observable emitting details of uploaded content.
"""
fin... | java | public Observable<ComapiResult<UploadContentResponse>> uploadContent(@NonNull final String folder, @NonNull final ContentData data) {
final String token = getToken();
if (sessionController.isCreatingSession()) {
return getTaskQueue().queueUploadContent(folder, data);
} else if (Tex... | [
"public",
"Observable",
"<",
"ComapiResult",
"<",
"UploadContentResponse",
">",
">",
"uploadContent",
"(",
"@",
"NonNull",
"final",
"String",
"folder",
",",
"@",
"NonNull",
"final",
"ContentData",
"data",
")",
"{",
"final",
"String",
"token",
"=",
"getToken",
... | Upload content data.
@param folder Folder name to put the file in.
@param data Content data.
@return Observable emitting details of uploaded content. | [
"Upload",
"content",
"data",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L763-L774 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.zipFile | public static void zipFile(File input, File output) throws IOException {
"""
Create a zip file from the given input file.
@param input the name of the file to compress.
@param output the name of the ZIP file to create.
@throws IOException when ziiping is failing.
@since 6.2
"""
try (FileOutputStream fo... | java | public static void zipFile(File input, File output) throws IOException {
try (FileOutputStream fos = new FileOutputStream(output)) {
zipFile(input, fos);
}
} | [
"public",
"static",
"void",
"zipFile",
"(",
"File",
"input",
",",
"File",
"output",
")",
"throws",
"IOException",
"{",
"try",
"(",
"FileOutputStream",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"output",
")",
")",
"{",
"zipFile",
"(",
"input",
",",
"fos",... | Create a zip file from the given input file.
@param input the name of the file to compress.
@param output the name of the ZIP file to create.
@throws IOException when ziiping is failing.
@since 6.2 | [
"Create",
"a",
"zip",
"file",
"from",
"the",
"given",
"input",
"file",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L2923-L2927 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java | CoverageUtilities.doubleArray2WritableRaster | public static WritableRaster doubleArray2WritableRaster( double[] array, int width, int height ) {
"""
Transforms an array of values into a {@link WritableRaster}.
@param array the values to transform.
@param divide the factor by which to divide the values.
@param width the width of the resulting image.
@par... | java | public static WritableRaster doubleArray2WritableRaster( double[] array, int width, int height ) {
WritableRaster writableRaster = createWritableRaster(width, height, null, null, null);
int index = 0;;
for( int x = 0; x < width; x++ ) {
for( int y = 0; y < height; y++ ) {
... | [
"public",
"static",
"WritableRaster",
"doubleArray2WritableRaster",
"(",
"double",
"[",
"]",
"array",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"WritableRaster",
"writableRaster",
"=",
"createWritableRaster",
"(",
"width",
",",
"height",
",",
"null",
... | Transforms an array of values into a {@link WritableRaster}.
@param array the values to transform.
@param divide the factor by which to divide the values.
@param width the width of the resulting image.
@param height the height of the resulting image.
@return the raster. | [
"Transforms",
"an",
"array",
"of",
"values",
"into",
"a",
"{",
"@link",
"WritableRaster",
"}",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L1133-L1142 |
EdwardRaff/JSAT | JSAT/src/jsat/distributions/Normal.java | Normal.logPdf | public static double logPdf(double x, double mu, double sigma) {
"""
Computes the log probability of a given value
@param x the value to the get log(pdf) of
@param mu the mean of the distribution
@param sigma the standard deviation of the distribution
@return the log probability
"""
return -0.5*log... | java | public static double logPdf(double x, double mu, double sigma)
{
return -0.5*log(2*PI) - log(sigma) + -pow(x-mu,2)/(2*sigma*sigma);
} | [
"public",
"static",
"double",
"logPdf",
"(",
"double",
"x",
",",
"double",
"mu",
",",
"double",
"sigma",
")",
"{",
"return",
"-",
"0.5",
"*",
"log",
"(",
"2",
"*",
"PI",
")",
"-",
"log",
"(",
"sigma",
")",
"+",
"-",
"pow",
"(",
"x",
"-",
"mu",
... | Computes the log probability of a given value
@param x the value to the get log(pdf) of
@param mu the mean of the distribution
@param sigma the standard deviation of the distribution
@return the log probability | [
"Computes",
"the",
"log",
"probability",
"of",
"a",
"given",
"value"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/Normal.java#L152-L155 |
facebook/fresco | samples/zoomable/src/main/java/com/facebook/samples/zoomable/DefaultZoomableController.java | DefaultZoomableController.limitTranslation | private boolean limitTranslation(Matrix transform, @LimitFlag int limitTypes) {
"""
Limits the translation so that there are no empty spaces on the sides if possible.
<p> The image is attempted to be centered within the view bounds if the transformed image is
smaller. There will be no empty spaces within the v... | java | private boolean limitTranslation(Matrix transform, @LimitFlag int limitTypes) {
if (!shouldLimit(limitTypes, LIMIT_TRANSLATION_X | LIMIT_TRANSLATION_Y)) {
return false;
}
RectF b = mTempRect;
b.set(mImageBounds);
transform.mapRect(b);
float offsetLeft = shouldLimit(limitTypes, LIMIT_TRANSL... | [
"private",
"boolean",
"limitTranslation",
"(",
"Matrix",
"transform",
",",
"@",
"LimitFlag",
"int",
"limitTypes",
")",
"{",
"if",
"(",
"!",
"shouldLimit",
"(",
"limitTypes",
",",
"LIMIT_TRANSLATION_X",
"|",
"LIMIT_TRANSLATION_Y",
")",
")",
"{",
"return",
"false"... | Limits the translation so that there are no empty spaces on the sides if possible.
<p> The image is attempted to be centered within the view bounds if the transformed image is
smaller. There will be no empty spaces within the view bounds if the transformed image is
bigger. This applies to each dimension (horizontal an... | [
"Limits",
"the",
"translation",
"so",
"that",
"there",
"are",
"no",
"empty",
"spaces",
"on",
"the",
"sides",
"if",
"possible",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/samples/zoomable/src/main/java/com/facebook/samples/zoomable/DefaultZoomableController.java#L523-L539 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationBuilder.java | CollationBuilder.insertNodeBetween | private int insertNodeBetween(int index, int nextIndex, long node) {
"""
Inserts a new node into the list, between list-adjacent items.
The node's previous and next indexes must not be set yet.
@return the new node's index
"""
assert(previousIndexFromNode(node) == 0);
assert(nextIndexFromNode... | java | private int insertNodeBetween(int index, int nextIndex, long node) {
assert(previousIndexFromNode(node) == 0);
assert(nextIndexFromNode(node) == 0);
assert(nextIndexFromNode(nodes.elementAti(index)) == nextIndex);
// Append the new node and link it to the existing nodes.
int newI... | [
"private",
"int",
"insertNodeBetween",
"(",
"int",
"index",
",",
"int",
"nextIndex",
",",
"long",
"node",
")",
"{",
"assert",
"(",
"previousIndexFromNode",
"(",
"node",
")",
"==",
"0",
")",
";",
"assert",
"(",
"nextIndexFromNode",
"(",
"node",
")",
"==",
... | Inserts a new node into the list, between list-adjacent items.
The node's previous and next indexes must not be set yet.
@return the new node's index | [
"Inserts",
"a",
"new",
"node",
"into",
"the",
"list",
"between",
"list",
"-",
"adjacent",
"items",
".",
"The",
"node",
"s",
"previous",
"and",
"next",
"indexes",
"must",
"not",
"be",
"set",
"yet",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationBuilder.java#L728-L745 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/alg/InputSanityCheck.java | InputSanityCheck.checkReshape | public static void checkReshape(ImageBase<?> imgA, ImageBase<?> imgB) {
"""
Throws exception if two images are the same instance. Otherwise reshapes B to match A
"""
if( imgA == imgB )
throw new IllegalArgumentException("Image's can't be the same instance");
imgB.reshape(imgA.width,imgA.height);
} | java | public static void checkReshape(ImageBase<?> imgA, ImageBase<?> imgB) {
if( imgA == imgB )
throw new IllegalArgumentException("Image's can't be the same instance");
imgB.reshape(imgA.width,imgA.height);
} | [
"public",
"static",
"void",
"checkReshape",
"(",
"ImageBase",
"<",
"?",
">",
"imgA",
",",
"ImageBase",
"<",
"?",
">",
"imgB",
")",
"{",
"if",
"(",
"imgA",
"==",
"imgB",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Image's can't be the same instance... | Throws exception if two images are the same instance. Otherwise reshapes B to match A | [
"Throws",
"exception",
"if",
"two",
"images",
"are",
"the",
"same",
"instance",
".",
"Otherwise",
"reshapes",
"B",
"to",
"match",
"A"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/alg/InputSanityCheck.java#L84-L88 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/util/BooleanExpressionParser.java | BooleanExpressionParser.evaluateExpressionStack | private static String evaluateExpressionStack(final Deque<String> operators, final Deque<String> values) {
"""
This method takes stacks of operators and values and evaluates possible expressions
This is done by popping one operator and two values, applying the operator to the values and pushing the result back on... | java | private static String evaluateExpressionStack(final Deque<String> operators, final Deque<String> values) {
while (!operators.isEmpty()) {
values.push(getBooleanResultAsString(operators.pop(), values.pop(), values.pop()));
}
return replaceIntegerStringByBooleanRepresentation(values.po... | [
"private",
"static",
"String",
"evaluateExpressionStack",
"(",
"final",
"Deque",
"<",
"String",
">",
"operators",
",",
"final",
"Deque",
"<",
"String",
">",
"values",
")",
"{",
"while",
"(",
"!",
"operators",
".",
"isEmpty",
"(",
")",
")",
"{",
"values",
... | This method takes stacks of operators and values and evaluates possible expressions
This is done by popping one operator and two values, applying the operator to the values and pushing the result back onto the value stack
@param operators Operators to apply
@param values Values
@return The final result popped of th... | [
"This",
"method",
"takes",
"stacks",
"of",
"operators",
"and",
"values",
"and",
"evaluates",
"possible",
"expressions",
"This",
"is",
"done",
"by",
"popping",
"one",
"operator",
"and",
"two",
"values",
"applying",
"the",
"operator",
"to",
"the",
"values",
"and... | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/util/BooleanExpressionParser.java#L147-L152 |
Coveros/selenified | src/main/java/com/coveros/selenified/element/check/wait/WaitForEquals.java | WaitForEquals.clazz | public void clazz(String expectedClass, double seconds) {
"""
Waits for the element's class equals the provided expected class. If
the element isn't present, this will constitute a failure, same as a
mismatch. The provided wait time will be used and if the element doesn't
have the desired match count at that ti... | java | public void clazz(String expectedClass, double seconds) {
double end = System.currentTimeMillis() + (seconds * 1000);
try {
elementPresent(seconds);
while (!(expectedClass == null ? element.get().attribute(CLASS) == null : expectedClass.equals(element.get().attribute(CLASS))) && ... | [
"public",
"void",
"clazz",
"(",
"String",
"expectedClass",
",",
"double",
"seconds",
")",
"{",
"double",
"end",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"(",
"seconds",
"*",
"1000",
")",
";",
"try",
"{",
"elementPresent",
"(",
"seconds",
"... | Waits for the element's class equals the provided expected class. If
the element isn't present, this will constitute a failure, same as a
mismatch. The provided wait time will be used and if the element doesn't
have the desired match count at that time, it will fail, and log
the issue with a screenshot for traceability... | [
"Waits",
"for",
"the",
"element",
"s",
"class",
"equals",
"the",
"provided",
"expected",
"class",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"this",
"will",
"constitute",
"a",
"failure",
"same",
"as",
"a",
"mismatch",
".",
"The",
"provided",
"wait... | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/check/wait/WaitForEquals.java#L313-L323 |
atomix/copycat | server/src/main/java/io/atomix/copycat/server/state/LeaderAppender.java | LeaderAppender.updateHeartbeatTime | private void updateHeartbeatTime(MemberState member, Throwable error) {
"""
Sets a commit time or fails the commit if a quorum of successful responses cannot be achieved.
"""
if (heartbeatFuture == null) {
return;
}
if (error != null && member.getHeartbeatStartTime() == heartbeatTime) {
... | java | private void updateHeartbeatTime(MemberState member, Throwable error) {
if (heartbeatFuture == null) {
return;
}
if (error != null && member.getHeartbeatStartTime() == heartbeatTime) {
int votingMemberSize = context.getClusterState().getActiveMemberStates().size() + (context.getCluster().member... | [
"private",
"void",
"updateHeartbeatTime",
"(",
"MemberState",
"member",
",",
"Throwable",
"error",
")",
"{",
"if",
"(",
"heartbeatFuture",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"error",
"!=",
"null",
"&&",
"member",
".",
"getHeartbeatStartTi... | Sets a commit time or fails the commit if a quorum of successful responses cannot be achieved. | [
"Sets",
"a",
"commit",
"time",
"or",
"fails",
"the",
"commit",
"if",
"a",
"quorum",
"of",
"successful",
"responses",
"cannot",
"be",
"achieved",
"."
] | train | https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/server/src/main/java/io/atomix/copycat/server/state/LeaderAppender.java#L243-L269 |
phax/peppol-directory | peppol-directory-indexer/src/main/java/com/helger/pd/indexer/storage/PDStorageManager.java | PDStorageManager.searchAllDocuments | public void searchAllDocuments (@Nonnull final Query aQuery,
@CheckForSigned final int nMaxResultCount,
@Nonnull final Consumer <? super PDStoredBusinessEntity> aConsumer) throws IOException {
"""
Search all documents matching the passed query and... | java | public void searchAllDocuments (@Nonnull final Query aQuery,
@CheckForSigned final int nMaxResultCount,
@Nonnull final Consumer <? super PDStoredBusinessEntity> aConsumer) throws IOException
{
ValueEnforcer.notNull (aQuery, "Query");
ValueEnf... | [
"public",
"void",
"searchAllDocuments",
"(",
"@",
"Nonnull",
"final",
"Query",
"aQuery",
",",
"@",
"CheckForSigned",
"final",
"int",
"nMaxResultCount",
",",
"@",
"Nonnull",
"final",
"Consumer",
"<",
"?",
"super",
"PDStoredBusinessEntity",
">",
"aConsumer",
")",
... | Search all documents matching the passed query and pass the result on to
the provided {@link Consumer}.
@param aQuery
Query to execute. May not be <code>null</code>-
@param nMaxResultCount
Maximum number of results. Values ≤ 0 mean all.
@param aConsumer
The consumer of the {@link PDStoredBusinessEntity} objects.
@t... | [
"Search",
"all",
"documents",
"matching",
"the",
"passed",
"query",
"and",
"pass",
"the",
"result",
"on",
"to",
"the",
"provided",
"{",
"@link",
"Consumer",
"}",
"."
] | train | https://github.com/phax/peppol-directory/blob/98da26da29fb7178371d6b029516cbf01be223fb/peppol-directory-indexer/src/main/java/com/helger/pd/indexer/storage/PDStorageManager.java#L457-L486 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribeSiftCommon.java | DescribeSiftCommon.normalizeDescriptor | public static void normalizeDescriptor(TupleDesc_F64 descriptor , double maxDescriptorElementValue ) {
"""
Adjusts the descriptor. This adds lighting invariance and reduces the affects of none-affine changes
in lighting.
1) Apply L2 normalization
2) Clip using max descriptor value
3) Apply L2 normalization ... | java | public static void normalizeDescriptor(TupleDesc_F64 descriptor , double maxDescriptorElementValue ) {
// normalize descriptor to unit length
UtilFeature.normalizeL2(descriptor);
// clip the values
for (int i = 0; i < descriptor.size(); i++) {
double value = descriptor.value[i];
if( value > maxDescriptor... | [
"public",
"static",
"void",
"normalizeDescriptor",
"(",
"TupleDesc_F64",
"descriptor",
",",
"double",
"maxDescriptorElementValue",
")",
"{",
"// normalize descriptor to unit length",
"UtilFeature",
".",
"normalizeL2",
"(",
"descriptor",
")",
";",
"// clip the values",
"for"... | Adjusts the descriptor. This adds lighting invariance and reduces the affects of none-affine changes
in lighting.
1) Apply L2 normalization
2) Clip using max descriptor value
3) Apply L2 normalization again | [
"Adjusts",
"the",
"descriptor",
".",
"This",
"adds",
"lighting",
"invariance",
"and",
"reduces",
"the",
"affects",
"of",
"none",
"-",
"affine",
"changes",
"in",
"lighting",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribeSiftCommon.java#L84-L98 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.createKey | public KeyBundle createKey(String vaultBaseUrl, String keyName, JsonWebKeyType kty) {
"""
Creates a new key, stores it, then returns key parameters and attributes to the client.
The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates... | java | public KeyBundle createKey(String vaultBaseUrl, String keyName, JsonWebKeyType kty) {
return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty).toBlocking().single().body();
} | [
"public",
"KeyBundle",
"createKey",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"JsonWebKeyType",
"kty",
")",
"{",
"return",
"createKeyWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"keyName",
",",
"kty",
")",
".",
"toBlocking",
"(",
")",
... | Creates a new key, stores it, then returns key parameters and attributes to the client.
The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission.
@param vaultBaseUrl The vaul... | [
"Creates",
"a",
"new",
"key",
"stores",
"it",
"then",
"returns",
"key",
"parameters",
"and",
"attributes",
"to",
"the",
"client",
".",
"The",
"create",
"key",
"operation",
"can",
"be",
"used",
"to",
"create",
"any",
"key",
"type",
"in",
"Azure",
"Key",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L651-L653 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/internal/DatabaseURIHelper.java | DatabaseURIHelper.attachmentUri | public URI attachmentUri(String documentId, String revId, String attachmentId) {
"""
Returns URI for Attachment having {@code attachmentId} for {@code documentId}
and {@code revId}.
"""
return this.documentId(documentId).revId(revId).attachmentId(attachmentId).build();
} | java | public URI attachmentUri(String documentId, String revId, String attachmentId) {
return this.documentId(documentId).revId(revId).attachmentId(attachmentId).build();
} | [
"public",
"URI",
"attachmentUri",
"(",
"String",
"documentId",
",",
"String",
"revId",
",",
"String",
"attachmentId",
")",
"{",
"return",
"this",
".",
"documentId",
"(",
"documentId",
")",
".",
"revId",
"(",
"revId",
")",
".",
"attachmentId",
"(",
"attachmen... | Returns URI for Attachment having {@code attachmentId} for {@code documentId}
and {@code revId}. | [
"Returns",
"URI",
"for",
"Attachment",
"having",
"{"
] | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/internal/DatabaseURIHelper.java#L156-L158 |
apache/flink | flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java | MetricConfig.getInteger | public int getInteger(String key, int defaultValue) {
"""
Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if the proper... | java | public int getInteger(String key, int defaultValue) {
String argument = getProperty(key, null);
return argument == null
? defaultValue
: Integer.parseInt(argument);
} | [
"public",
"int",
"getInteger",
"(",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"String",
"argument",
"=",
"getProperty",
"(",
"key",
",",
"null",
")",
";",
"return",
"argument",
"==",
"null",
"?",
"defaultValue",
":",
"Integer",
".",
"parseInt"... | Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if the property is not found.
@param key the hashtable key.
@param de... | [
"Searches",
"for",
"the",
"property",
"with",
"the",
"specified",
"key",
"in",
"this",
"property",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"this",
"property",
"list",
"the",
"default",
"property",
"list",
"and",
"its",
"defaults",
"rec... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java#L42-L47 |
aoindustries/semanticcms-openfile-servlet | src/main/java/com/semanticcms/openfile/servlet/OpenFile.java | OpenFile.addFileOpener | public static void addFileOpener(ServletContext servletContext, FileOpener fileOpener, String ... extensions) {
"""
Registers a file opener.
@param extensions The simple extensions, in lowercase, not including the dot, such as "dia"
"""
synchronized(fileOpenersLock) {
@SuppressWarnings("unchecked")
... | java | public static void addFileOpener(ServletContext servletContext, FileOpener fileOpener, String ... extensions) {
synchronized(fileOpenersLock) {
@SuppressWarnings("unchecked")
Map<String,FileOpener> fileOpeners = (Map<String,FileOpener>)servletContext.getAttribute(FILE_OPENERS_REQUEST_ATTRIBUTE_NAME);
if(file... | [
"public",
"static",
"void",
"addFileOpener",
"(",
"ServletContext",
"servletContext",
",",
"FileOpener",
"fileOpener",
",",
"String",
"...",
"extensions",
")",
"{",
"synchronized",
"(",
"fileOpenersLock",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",... | Registers a file opener.
@param extensions The simple extensions, in lowercase, not including the dot, such as "dia" | [
"Registers",
"a",
"file",
"opener",
"."
] | train | https://github.com/aoindustries/semanticcms-openfile-servlet/blob/d22b2580b57708311949ac1088e3275355774921/src/main/java/com/semanticcms/openfile/servlet/OpenFile.java#L115-L128 |
eclipse/hawkbit | hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpAuthenticationMessageHandler.java | AmqpAuthenticationMessageHandler.checkIfArtifactIsAssignedToTarget | private void checkIfArtifactIsAssignedToTarget(final DmfTenantSecurityToken secruityToken, final String sha1Hash) {
"""
check action for this download purposes, the method will throw an
EntityNotFoundException in case the controller is not allowed to download
this file because it's not assigned to an action and ... | java | private void checkIfArtifactIsAssignedToTarget(final DmfTenantSecurityToken secruityToken, final String sha1Hash) {
if (secruityToken.getControllerId() != null) {
checkByControllerId(sha1Hash, secruityToken.getControllerId());
} else if (secruityToken.getTargetId() != null) {
ch... | [
"private",
"void",
"checkIfArtifactIsAssignedToTarget",
"(",
"final",
"DmfTenantSecurityToken",
"secruityToken",
",",
"final",
"String",
"sha1Hash",
")",
"{",
"if",
"(",
"secruityToken",
".",
"getControllerId",
"(",
")",
"!=",
"null",
")",
"{",
"checkByControllerId",
... | check action for this download purposes, the method will throw an
EntityNotFoundException in case the controller is not allowed to download
this file because it's not assigned to an action and not assigned to this
controller. Otherwise no controllerId is set = anonymous download
@param secruityToken
the security token... | [
"check",
"action",
"for",
"this",
"download",
"purposes",
"the",
"method",
"will",
"throw",
"an",
"EntityNotFoundException",
"in",
"case",
"the",
"controller",
"is",
"not",
"allowed",
"to",
"download",
"this",
"file",
"because",
"it",
"s",
"not",
"assigned",
"... | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpAuthenticationMessageHandler.java#L128-L138 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/ManagementResources.java | ManagementResources.reinstateUser | @PUT
@Path("/reinstateuser")
@Produces(MediaType.APPLICATION_JSON)
@Description("Reinstates a suspended user.")
public Response reinstateUser(@Context HttpServletRequest req,
@FormParam("username") String userName,
@FormParam("subsystem") SubSystem subSystem) {
"""
Reinstates the sp... | java | @PUT
@Path("/reinstateuser")
@Produces(MediaType.APPLICATION_JSON)
@Description("Reinstates a suspended user.")
public Response reinstateUser(@Context HttpServletRequest req,
@FormParam("username") String userName,
@FormParam("subsystem") SubSystem subSystem) {
if (userName == nu... | [
"@",
"PUT",
"@",
"Path",
"(",
"\"/reinstateuser\"",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Description",
"(",
"\"Reinstates a suspended user.\"",
")",
"public",
"Response",
"reinstateUser",
"(",
"@",
"Context",
"HttpServletReques... | Reinstates the specified sub system to the user.
@param req The HTTP request.
@param userName The user whom the sub system to be reinstated. Cannot be null or empty.
@param subSystem The subsystem to be reinstated. Cannot be null.
@return Response object indicating whether the operation was successfu... | [
"Reinstates",
"the",
"specified",
"sub",
"system",
"to",
"the",
"user",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/ManagementResources.java#L155-L177 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Transaction.java | Transaction.addInput | public TransactionInput addInput(Sha256Hash spendTxHash, long outputIndex, Script script) {
"""
Creates and adds an input to this transaction, with no checking that it's valid.
@return the newly created input.
"""
return addInput(new TransactionInput(params, this, script.getProgram(), new TransactionO... | java | public TransactionInput addInput(Sha256Hash spendTxHash, long outputIndex, Script script) {
return addInput(new TransactionInput(params, this, script.getProgram(), new TransactionOutPoint(params, outputIndex, spendTxHash)));
} | [
"public",
"TransactionInput",
"addInput",
"(",
"Sha256Hash",
"spendTxHash",
",",
"long",
"outputIndex",
",",
"Script",
"script",
")",
"{",
"return",
"addInput",
"(",
"new",
"TransactionInput",
"(",
"params",
",",
"this",
",",
"script",
".",
"getProgram",
"(",
... | Creates and adds an input to this transaction, with no checking that it's valid.
@return the newly created input. | [
"Creates",
"and",
"adds",
"an",
"input",
"to",
"this",
"transaction",
"with",
"no",
"checking",
"that",
"it",
"s",
"valid",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Transaction.java#L947-L949 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuStringUtil.java | GosuStringUtil.startsWithAny | public static boolean startsWithAny(String string, String[] searchStrings) {
"""
<p>Check if a String starts with any of an array of specified strings.</p>
<pre>
GosuStringUtil.startsWithAny(null, null) = false
GosuStringUtil.startsWithAny(null, new String[] {"abc"}) = false
GosuStringUtil.startsWithAn... | java | public static boolean startsWithAny(String string, String[] searchStrings) {
if (isEmpty(string) || searchStrings == null) {
return false;
}
for (int i = 0; i < searchStrings.length; i++) {
String searchString = searchStrings[i];
if ( GosuStringUtil.startsWith(string, sea... | [
"public",
"static",
"boolean",
"startsWithAny",
"(",
"String",
"string",
",",
"String",
"[",
"]",
"searchStrings",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"string",
")",
"||",
"searchStrings",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",... | <p>Check if a String starts with any of an array of specified strings.</p>
<pre>
GosuStringUtil.startsWithAny(null, null) = false
GosuStringUtil.startsWithAny(null, new String[] {"abc"}) = false
GosuStringUtil.startsWithAny("abcxyz", null) = false
GosuStringUtil.startsWithAny("abcxyz", new String[] {""}) = f... | [
"<p",
">",
"Check",
"if",
"a",
"String",
"starts",
"with",
"any",
"of",
"an",
"array",
"of",
"specified",
"strings",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuStringUtil.java#L5838-L5849 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java | AtlasRelationshipDefStoreV1.preUpdateCheck | public static void preUpdateCheck(AtlasRelationshipDef newRelationshipDef, AtlasRelationshipDef existingRelationshipDef) throws AtlasBaseException {
"""
Check ends are the same and relationshipCategory is the same.
We do this by comparing 2 relationshipDefs to avoid exposing the AtlasVertex to unit testing.
... | java | public static void preUpdateCheck(AtlasRelationshipDef newRelationshipDef, AtlasRelationshipDef existingRelationshipDef) throws AtlasBaseException {
// do not allow renames of the Def.
String existingName = existingRelationshipDef.getName();
String newName = newRelationshipDef.getName();
... | [
"public",
"static",
"void",
"preUpdateCheck",
"(",
"AtlasRelationshipDef",
"newRelationshipDef",
",",
"AtlasRelationshipDef",
"existingRelationshipDef",
")",
"throws",
"AtlasBaseException",
"{",
"// do not allow renames of the Def.",
"String",
"existingName",
"=",
"existingRelati... | Check ends are the same and relationshipCategory is the same.
We do this by comparing 2 relationshipDefs to avoid exposing the AtlasVertex to unit testing.
@param newRelationshipDef
@param existingRelationshipDef
@throws AtlasBaseException | [
"Check",
"ends",
"are",
"the",
"same",
"and",
"relationshipCategory",
"is",
"the",
"same",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java#L442-L476 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java | AbstractCasView.prepareCasResponseAttributesForViewModel | protected void prepareCasResponseAttributesForViewModel(final Map<String, Object> model) {
"""
Prepare cas response attributes for view model.
@param model the model
"""
val service = authenticationRequestServiceSelectionStrategies.resolveService(getServiceFrom(model));
val registeredService... | java | protected void prepareCasResponseAttributesForViewModel(final Map<String, Object> model) {
val service = authenticationRequestServiceSelectionStrategies.resolveService(getServiceFrom(model));
val registeredService = this.servicesManager.findServiceBy(service);
val principalAttributes = getCasPr... | [
"protected",
"void",
"prepareCasResponseAttributesForViewModel",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"model",
")",
"{",
"val",
"service",
"=",
"authenticationRequestServiceSelectionStrategies",
".",
"resolveService",
"(",
"getServiceFrom",
"(",
"mode... | Prepare cas response attributes for view model.
@param model the model | [
"Prepare",
"cas",
"response",
"attributes",
"for",
"view",
"model",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java#L232-L245 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deleteClosedListAsync | public Observable<OperationStatus> deleteClosedListAsync(UUID appId, String versionId, UUID clEntityId) {
"""
Deletes a closed list model from the application.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list model ID.
@throws IllegalArgumentException thrown... | java | public Observable<OperationStatus> deleteClosedListAsync(UUID appId, String versionId, UUID clEntityId) {
return deleteClosedListWithServiceResponseAsync(appId, versionId, clEntityId).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
public OperationStatus ca... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"deleteClosedListAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"clEntityId",
")",
"{",
"return",
"deleteClosedListWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"clEntityId"... | Deletes a closed list model from the application.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list model ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatus object | [
"Deletes",
"a",
"closed",
"list",
"model",
"from",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L4625-L4632 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Assert.java | Assert.isFalse | public static void isFalse(boolean expression, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
"""
断言是否为假,如果为 {@code true} 抛出 {@code IllegalArgumentException} 异常<br>
<pre class="code">
Assert.isFalse(i < 0, "The value must be greater than zero");
</pre>
@param expression 波尔值... | java | public static void isFalse(boolean expression, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
if (expression) {
throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params));
}
} | [
"public",
"static",
"void",
"isFalse",
"(",
"boolean",
"expression",
",",
"String",
"errorMsgTemplate",
",",
"Object",
"...",
"params",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"expression",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"... | 断言是否为假,如果为 {@code true} 抛出 {@code IllegalArgumentException} 异常<br>
<pre class="code">
Assert.isFalse(i < 0, "The value must be greater than zero");
</pre>
@param expression 波尔值
@param errorMsgTemplate 错误抛出异常附带的消息模板,变量用{}代替
@param params 参数列表
@throws IllegalArgumentException if expression is {@code false} | [
"断言是否为假,如果为",
"{",
"@code",
"true",
"}",
"抛出",
"{",
"@code",
"IllegalArgumentException",
"}",
"异常<br",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java#L63-L67 |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/databinding/BindingHelper.java | BindingHelper.setVariantForView | @Nullable
public static String setVariantForView(@NonNull View view, @Nullable String variant) {
"""
Associates programmatically a view with a variant.
@param view any existing view.
@return the previous variant for this view, if any.
"""
String previousVariant = null;
String previousAt... | java | @Nullable
public static String setVariantForView(@NonNull View view, @Nullable String variant) {
String previousVariant = null;
String previousAttribute = null;
for (Map.Entry<String, HashMap<Integer, String>> entry : bindings.entrySet()) {
if (entry.getValue().containsKey(view.g... | [
"@",
"Nullable",
"public",
"static",
"String",
"setVariantForView",
"(",
"@",
"NonNull",
"View",
"view",
",",
"@",
"Nullable",
"String",
"variant",
")",
"{",
"String",
"previousVariant",
"=",
"null",
";",
"String",
"previousAttribute",
"=",
"null",
";",
"for",... | Associates programmatically a view with a variant.
@param view any existing view.
@return the previous variant for this view, if any. | [
"Associates",
"programmatically",
"a",
"view",
"with",
"a",
"variant",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/databinding/BindingHelper.java#L119-L133 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/av/FFmpegMuxer.java | FFmpegMuxer.packageH264Keyframe | private void packageH264Keyframe(ByteBuffer encodedData, MediaCodec.BufferInfo bufferInfo) {
"""
Adds the SPS + PPS data to the ByteBuffer containing a h264 keyframe
@param encodedData
@param bufferInfo
"""
mH264Keyframe.position(mH264MetaSize);
mH264Keyframe.put(encodedData); // BufferOver... | java | private void packageH264Keyframe(ByteBuffer encodedData, MediaCodec.BufferInfo bufferInfo) {
mH264Keyframe.position(mH264MetaSize);
mH264Keyframe.put(encodedData); // BufferOverflow
} | [
"private",
"void",
"packageH264Keyframe",
"(",
"ByteBuffer",
"encodedData",
",",
"MediaCodec",
".",
"BufferInfo",
"bufferInfo",
")",
"{",
"mH264Keyframe",
".",
"position",
"(",
"mH264MetaSize",
")",
";",
"mH264Keyframe",
".",
"put",
"(",
"encodedData",
")",
";",
... | Adds the SPS + PPS data to the ByteBuffer containing a h264 keyframe
@param encodedData
@param bufferInfo | [
"Adds",
"the",
"SPS",
"+",
"PPS",
"data",
"to",
"the",
"ByteBuffer",
"containing",
"a",
"h264",
"keyframe"
] | train | https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/FFmpegMuxer.java#L313-L316 |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java | ModeledUser.setUnrestrictedAttributes | private void setUnrestrictedAttributes(Map<String, String> attributes) {
"""
Stores all unrestricted (unprivileged) attributes within the underlying
user model, pulling the values of those attributes from the given Map.
@param attributes
The Map to pull all unrestricted attributes from.
"""
// Tr... | java | private void setUnrestrictedAttributes(Map<String, String> attributes) {
// Translate full name attribute
getModel().setFullName(TextField.parse(attributes.get(User.Attribute.FULL_NAME)));
// Translate email address attribute
getModel().setEmailAddress(TextField.parse(attributes.get(Us... | [
"private",
"void",
"setUnrestrictedAttributes",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"// Translate full name attribute",
"getModel",
"(",
")",
".",
"setFullName",
"(",
"TextField",
".",
"parse",
"(",
"attributes",
".",
"get",
"(... | Stores all unrestricted (unprivileged) attributes within the underlying
user model, pulling the values of those attributes from the given Map.
@param attributes
The Map to pull all unrestricted attributes from. | [
"Stores",
"all",
"unrestricted",
"(",
"unprivileged",
")",
"attributes",
"within",
"the",
"underlying",
"user",
"model",
"pulling",
"the",
"values",
"of",
"those",
"attributes",
"from",
"the",
"given",
"Map",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java#L467-L481 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.referencesThis | static boolean referencesThis(Node n) {
"""
Returns true if the shallow scope contains references to 'this' keyword
"""
if (n.isFunction()) {
return referencesThis(NodeUtil.getFunctionParameters(n))
|| referencesThis(NodeUtil.getFunctionBody(n));
} else {
return has(n, Node::isThi... | java | static boolean referencesThis(Node n) {
if (n.isFunction()) {
return referencesThis(NodeUtil.getFunctionParameters(n))
|| referencesThis(NodeUtil.getFunctionBody(n));
} else {
return has(n, Node::isThis, MATCH_ANYTHING_BUT_NON_ARROW_FUNCTION);
}
} | [
"static",
"boolean",
"referencesThis",
"(",
"Node",
"n",
")",
"{",
"if",
"(",
"n",
".",
"isFunction",
"(",
")",
")",
"{",
"return",
"referencesThis",
"(",
"NodeUtil",
".",
"getFunctionParameters",
"(",
"n",
")",
")",
"||",
"referencesThis",
"(",
"NodeUtil"... | Returns true if the shallow scope contains references to 'this' keyword | [
"Returns",
"true",
"if",
"the",
"shallow",
"scope",
"contains",
"references",
"to",
"this",
"keyword"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L2344-L2351 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/api/DRUMSInstantiator.java | DRUMSInstantiator.openTable | public static <Data extends AbstractKVStorable> DRUMS<Data> openTable(AccessMode accessMode,
DRUMSParameterSet<Data> gp) throws IOException {
"""
Opens an existing table.
@param accessMode
the AccessMode, how to access the DRUMS
@param gp
pointer to the {@link DRUMSParameterSet} used by the {@lin... | java | public static <Data extends AbstractKVStorable> DRUMS<Data> openTable(AccessMode accessMode,
DRUMSParameterSet<Data> gp) throws IOException {
AbstractHashFunction hashFunction;
try {
hashFunction = readHashFunction(gp);
} catch (ClassNotFoundException e) {
thr... | [
"public",
"static",
"<",
"Data",
"extends",
"AbstractKVStorable",
">",
"DRUMS",
"<",
"Data",
">",
"openTable",
"(",
"AccessMode",
"accessMode",
",",
"DRUMSParameterSet",
"<",
"Data",
">",
"gp",
")",
"throws",
"IOException",
"{",
"AbstractHashFunction",
"hashFuncti... | Opens an existing table.
@param accessMode
the AccessMode, how to access the DRUMS
@param gp
pointer to the {@link DRUMSParameterSet} used by the {@link DRUMS} to open
@return the table
@throws IOException | [
"Opens",
"an",
"existing",
"table",
"."
] | train | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/api/DRUMSInstantiator.java#L103-L112 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java | BuildsInner.updateAsync | public Observable<BuildInner> updateAsync(String resourceGroupName, String registryName, String buildId) {
"""
Patch the build properties.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildId The... | java | public Observable<BuildInner> updateAsync(String resourceGroupName, String registryName, String buildId) {
return updateWithServiceResponseAsync(resourceGroupName, registryName, buildId).map(new Func1<ServiceResponse<BuildInner>, BuildInner>() {
@Override
public BuildInner call(ServiceRe... | [
"public",
"Observable",
"<",
"BuildInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"buildId",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
",",
"build... | Patch the build properties.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildId The build ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the requ... | [
"Patch",
"the",
"build",
"properties",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java#L480-L487 |
m-m-m/util | contenttype/src/main/java/net/sf/mmm/util/contenttype/base/AbstractContentTypeManager.java | AbstractContentTypeManager.addContentType | protected void addContentType(ContentType contentType) throws DuplicateObjectException {
"""
This method registers the given {@code contentType} in this {@link ContentTypeManager}.
@see #getContentType(String)
@param contentType is the {@link ContentType} to add.
@throws DuplicateObjectException if a {@link... | java | protected void addContentType(ContentType contentType) throws DuplicateObjectException {
String id = contentType.getId();
if (this.id2contentTypeMap.containsKey(id)) {
throw new DuplicateObjectException(contentType, id);
}
this.id2contentTypeMap.put(id, contentType);
} | [
"protected",
"void",
"addContentType",
"(",
"ContentType",
"contentType",
")",
"throws",
"DuplicateObjectException",
"{",
"String",
"id",
"=",
"contentType",
".",
"getId",
"(",
")",
";",
"if",
"(",
"this",
".",
"id2contentTypeMap",
".",
"containsKey",
"(",
"id",... | This method registers the given {@code contentType} in this {@link ContentTypeManager}.
@see #getContentType(String)
@param contentType is the {@link ContentType} to add.
@throws DuplicateObjectException if a {@link ContentType} with the same {@link ContentType#getId() ID} has already
been registered. | [
"This",
"method",
"registers",
"the",
"given",
"{",
"@code",
"contentType",
"}",
"in",
"this",
"{",
"@link",
"ContentTypeManager",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/contenttype/src/main/java/net/sf/mmm/util/contenttype/base/AbstractContentTypeManager.java#L46-L53 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.