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 |
|---|---|---|---|---|---|---|---|---|---|---|
Appendium/objectlabkit | utils/src/main/java/net/objectlab/kit/util/ObjectUtil.java | ObjectUtil.equalsValue | public static boolean equalsValue(final Object o1, final Object o2) {
"""
Return true if o1 equals (according to {@link Object#equals(Object)}) o2.
Also returns true if o1 is null and o2 is null! Is safe on either o1 or o2 being null.
"""
if (o1 == null) {
return o2 == null;
}
... | java | public static boolean equalsValue(final Object o1, final Object o2) {
if (o1 == null) {
return o2 == null;
}
return o1.equals(o2);
} | [
"public",
"static",
"boolean",
"equalsValue",
"(",
"final",
"Object",
"o1",
",",
"final",
"Object",
"o2",
")",
"{",
"if",
"(",
"o1",
"==",
"null",
")",
"{",
"return",
"o2",
"==",
"null",
";",
"}",
"return",
"o1",
".",
"equals",
"(",
"o2",
")",
";",... | Return true if o1 equals (according to {@link Object#equals(Object)}) o2.
Also returns true if o1 is null and o2 is null! Is safe on either o1 or o2 being null. | [
"Return",
"true",
"if",
"o1",
"equals",
"(",
"according",
"to",
"{"
] | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/utils/src/main/java/net/objectlab/kit/util/ObjectUtil.java#L69-L74 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java | JschUtil.openChannel | public static Channel openChannel(Session session, ChannelType channelType) {
"""
打开Channel连接
@param session Session会话
@param channelType 通道类型,可以是shell或sftp等,见{@link ChannelType}
@return {@link Channel}
@since 4.5.2
"""
final Channel channel = createChannel(session, channelType);
try {
channel.... | java | public static Channel openChannel(Session session, ChannelType channelType) {
final Channel channel = createChannel(session, channelType);
try {
channel.connect();
} catch (JSchException e) {
throw new JschRuntimeException(e);
}
return channel;
} | [
"public",
"static",
"Channel",
"openChannel",
"(",
"Session",
"session",
",",
"ChannelType",
"channelType",
")",
"{",
"final",
"Channel",
"channel",
"=",
"createChannel",
"(",
"session",
",",
"channelType",
")",
";",
"try",
"{",
"channel",
".",
"connect",
"(",... | 打开Channel连接
@param session Session会话
@param channelType 通道类型,可以是shell或sftp等,见{@link ChannelType}
@return {@link Channel}
@since 4.5.2 | [
"打开Channel连接"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java#L218-L226 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/trustmanager/UnsupportedCriticalExtensionChecker.java | UnsupportedCriticalExtensionChecker.invoke | public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException {
"""
Method that checks if there are unsupported critical extension. Supported
ones are only BasicConstrains, KeyUsage, Proxy Certificate (old and new)
@param cert The certificate to validate.... | java | public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException {
Set<String> criticalExtensionOids =
cert.getCriticalExtensionOIDs();
if (criticalExtensionOids == null) {
return;
}
for (String criticalExtensio... | [
"public",
"void",
"invoke",
"(",
"X509Certificate",
"cert",
",",
"GSIConstants",
".",
"CertificateType",
"certType",
")",
"throws",
"CertPathValidatorException",
"{",
"Set",
"<",
"String",
">",
"criticalExtensionOids",
"=",
"cert",
".",
"getCriticalExtensionOIDs",
"("... | Method that checks if there are unsupported critical extension. Supported
ones are only BasicConstrains, KeyUsage, Proxy Certificate (old and new)
@param cert The certificate to validate.
@param certType The type of certificate to validate.
@throws CertPathValidatorException If any critical extension that is not s... | [
"Method",
"that",
"checks",
"if",
"there",
"are",
"unsupported",
"critical",
"extension",
".",
"Supported",
"ones",
"are",
"only",
"BasicConstrains",
"KeyUsage",
"Proxy",
"Certificate",
"(",
"old",
"and",
"new",
")"
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/trustmanager/UnsupportedCriticalExtensionChecker.java#L44-L53 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/ByteBuffer.java | ByteBuffer.toArray | public void toArray(int offset, int length, byte[] targetBuffer, int targetOffset) {
"""
Will copy data from this ByteBuffer's buffer into the targetBuffer. This
method requires the targetBuffer to already be allocated with enough capacity
to hold this ByteBuffer's data.
@param offset The offset within the Byt... | java | public void toArray(int offset, int length, byte[] targetBuffer, int targetOffset) {
// validate the offset, length are ok
ByteBuffer.checkOffsetLength(size(), offset, length);
// validate the offset, length are ok
ByteBuffer.checkOffsetLength(targetBuffer.length, targetOffset, length)... | [
"public",
"void",
"toArray",
"(",
"int",
"offset",
",",
"int",
"length",
",",
"byte",
"[",
"]",
"targetBuffer",
",",
"int",
"targetOffset",
")",
"{",
"// validate the offset, length are ok",
"ByteBuffer",
".",
"checkOffsetLength",
"(",
"size",
"(",
")",
",",
"... | Will copy data from this ByteBuffer's buffer into the targetBuffer. This
method requires the targetBuffer to already be allocated with enough capacity
to hold this ByteBuffer's data.
@param offset The offset within the ByteBuffer to start copy from
@param length The length from the offset to copy
@param targetBuffer T... | [
"Will",
"copy",
"data",
"from",
"this",
"ByteBuffer",
"s",
"buffer",
"into",
"the",
"targetBuffer",
".",
"This",
"method",
"requires",
"the",
"targetBuffer",
"to",
"already",
"be",
"allocated",
"with",
"enough",
"capacity",
"to",
"hold",
"this",
"ByteBuffer",
... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/ByteBuffer.java#L804-L847 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.droti | @Override
protected void droti(long N, INDArray X, DataBuffer indexes, INDArray Y, double c, double s) {
"""
Applies Givens rotation to sparse vectors one of which is in compressed form.
@param N The number of elements in vectors X and Y
@param X a double sparse vector
@param indexes The indexes of the sp... | java | @Override
protected void droti(long N, INDArray X, DataBuffer indexes, INDArray Y, double c, double s) {
cblas_droti((int) N, (DoublePointer) X.data().addressPointer(), (IntPointer) indexes.addressPointer(),
(DoublePointer) Y.data().addressPointer(), c, s);
} | [
"@",
"Override",
"protected",
"void",
"droti",
"(",
"long",
"N",
",",
"INDArray",
"X",
",",
"DataBuffer",
"indexes",
",",
"INDArray",
"Y",
",",
"double",
"c",
",",
"double",
"s",
")",
"{",
"cblas_droti",
"(",
"(",
"int",
")",
"N",
",",
"(",
"DoublePo... | Applies Givens rotation to sparse vectors one of which is in compressed form.
@param N The number of elements in vectors X and Y
@param X a double sparse vector
@param indexes The indexes of the sparse vector
@param Y a double full-storage vector
@param c a scalar
@param s a scalar | [
"Applies",
"Givens",
"rotation",
"to",
"sparse",
"vectors",
"one",
"of",
"which",
"is",
"in",
"compressed",
"form",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L232-L236 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java | TransactionBroadcast.setProgressCallback | public void setProgressCallback(ProgressCallback callback, @Nullable Executor executor) {
"""
Sets the given callback for receiving progress values, which will run on the given executor. If the executor
is null then the callback will run on a network thread and may be invoked multiple times in parallel. You
prob... | java | public void setProgressCallback(ProgressCallback callback, @Nullable Executor executor) {
boolean shouldInvoke;
int num;
boolean mined;
synchronized (this) {
this.callback = callback;
this.progressCallbackExecutor = executor;
num = this.numSeemPeers;
... | [
"public",
"void",
"setProgressCallback",
"(",
"ProgressCallback",
"callback",
",",
"@",
"Nullable",
"Executor",
"executor",
")",
"{",
"boolean",
"shouldInvoke",
";",
"int",
"num",
";",
"boolean",
"mined",
";",
"synchronized",
"(",
"this",
")",
"{",
"this",
"."... | Sets the given callback for receiving progress values, which will run on the given executor. If the executor
is null then the callback will run on a network thread and may be invoked multiple times in parallel. You
probably want to provide your UI thread or Threading.USER_THREAD for the second parameter. If the broadca... | [
"Sets",
"the",
"given",
"callback",
"for",
"receiving",
"progress",
"values",
"which",
"will",
"run",
"on",
"the",
"given",
"executor",
".",
"If",
"the",
"executor",
"is",
"null",
"then",
"the",
"callback",
"will",
"run",
"on",
"a",
"network",
"thread",
"a... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java#L279-L292 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java | AmazonDynamoDBClient.updateItem | public UpdateItemResult updateItem(UpdateItemRequest updateItemRequest)
throws AmazonServiceException, AmazonClientException {
"""
<p>
Edits an existing item's attributes.
</p>
<p>
You can perform a conditional update (insert a new attribute
name-value pair if it doesn't exist, or replace an exist... | java | public UpdateItemResult updateItem(UpdateItemRequest updateItemRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(updateItemRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
... | [
"public",
"UpdateItemResult",
"updateItem",
"(",
"UpdateItemRequest",
"updateItemRequest",
")",
"throws",
"AmazonServiceException",
",",
"AmazonClientException",
"{",
"ExecutionContext",
"executionContext",
"=",
"createExecutionContext",
"(",
"updateItemRequest",
")",
";",
"A... | <p>
Edits an existing item's attributes.
</p>
<p>
You can perform a conditional update (insert a new attribute
name-value pair if it doesn't exist, or replace an existing name-value
pair if it has certain expected attribute values).
</p>
@param updateItemRequest Container for the necessary parameters to
execute the Up... | [
"<p",
">",
"Edits",
"an",
"existing",
"item",
"s",
"attributes",
".",
"<",
"/",
"p",
">",
"<p",
">",
"You",
"can",
"perform",
"a",
"conditional",
"update",
"(",
"insert",
"a",
"new",
"attribute",
"name",
"-",
"value",
"pair",
"if",
"it",
"doesn",
"t"... | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java#L501-L513 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/SubscriptionMessageHandler.java | SubscriptionMessageHandler.addSubscriptionToMessage | protected void addSubscriptionToMessage(MESubscription subscription, boolean isLocalBus) {
"""
Adds a subscription to the proxy message that is to be sent.
This will either be a delete or reset message.
Reset will add messages to the list to resync with the Neighbour
and the Delete will send it on due to rece... | java | protected void addSubscriptionToMessage(MESubscription subscription, boolean isLocalBus)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "addSubscriptionToMessage", new Object[]{subscription, new Boolean(isLocalBus)});
// Add the subscription related information.
iTopics.add(subscription.getTopic());
... | [
"protected",
"void",
"addSubscriptionToMessage",
"(",
"MESubscription",
"subscription",
",",
"boolean",
"isLocalBus",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"addSubscriptionToMessage\"",
",",
"ne... | Adds a subscription to the proxy message that is to be sent.
This will either be a delete or reset message.
Reset will add messages to the list to resync with the Neighbour
and the Delete will send it on due to receiving a Reset.
@param subscription The MESubscription to add to the message.
@param isLocalBus The me... | [
"Adds",
"a",
"subscription",
"to",
"the",
"proxy",
"message",
"that",
"is",
"to",
"be",
"sent",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/SubscriptionMessageHandler.java#L328-L355 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.listRecordings | public ListRecordingsResponse listRecordings() {
"""
List all your live recording presets.
@return The list of all your live recording preset.
"""
GetRecordingRequest request = new GetRecordingRequest();
InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, RECORDING);... | java | public ListRecordingsResponse listRecordings() {
GetRecordingRequest request = new GetRecordingRequest();
InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, RECORDING);
return invokeHttpClient(internalRequest, ListRecordingsResponse.class);
} | [
"public",
"ListRecordingsResponse",
"listRecordings",
"(",
")",
"{",
"GetRecordingRequest",
"request",
"=",
"new",
"GetRecordingRequest",
"(",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"createRequest",
"(",
"HttpMethodName",
".",
"GET",
",",
"request",
",",... | List all your live recording presets.
@return The list of all your live recording preset. | [
"List",
"all",
"your",
"live",
"recording",
"presets",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1137-L1141 |
BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/lookup/SoftTFIDFDictionary.java | SoftTFIDFDictionary.put | public void put(String string,Object value) {
"""
Insert a string into the dictionary, and associate it with the
given value.
"""
if (frozen) throw new IllegalStateException("can't add new values to a frozen dictionary");
Set valset = (Set)valueMap.get(string);
if (valset==null) val... | java | public void put(String string,Object value)
{
if (frozen) throw new IllegalStateException("can't add new values to a frozen dictionary");
Set valset = (Set)valueMap.get(string);
if (valset==null) valueMap.put(string, (valset=new HashSet()));
valset.add( value );
} | [
"public",
"void",
"put",
"(",
"String",
"string",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"frozen",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"can't add new values to a frozen dictionary\"",
")",
";",
"Set",
"valset",
"=",
"(",
"Set",
")",
"val... | Insert a string into the dictionary, and associate it with the
given value. | [
"Insert",
"a",
"string",
"into",
"the",
"dictionary",
"and",
"associate",
"it",
"with",
"the",
"given",
"value",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/lookup/SoftTFIDFDictionary.java#L347-L353 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.importCertificate | public CertificateBundle importCertificate(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map<String, String> tags) {
"""
Imports a certificate into a specified key vault.
Imports an e... | java | public CertificateBundle importCertificate(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map<String, String> tags) {
return importCertificateWithServiceResponseAsync(vaultBaseUrl, c... | [
"public",
"CertificateBundle",
"importCertificate",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"String",
"base64EncodedCertificate",
",",
"String",
"password",
",",
"CertificatePolicy",
"certificatePolicy",
",",
"CertificateAttributes",
"certificate... | Imports a certificate into a specified key vault.
Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation r... | [
"Imports",
"a",
"certificate",
"into",
"a",
"specified",
"key",
"vault",
".",
"Imports",
"an",
"existing",
"valid",
"certificate",
"containing",
"a",
"private",
"key",
"into",
"Azure",
"Key",
"Vault",
".",
"The",
"certificate",
"to",
"be",
"imported",
"can",
... | 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#L6786-L6788 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.metrics/src/com/ibm/ws/microprofile/metrics/impl/MetricRegistryImpl.java | MetricRegistryImpl.getGauges | @Override
public SortedMap<String, Gauge> getGauges(MetricFilter filter) {
"""
Returns a map of all the gauges in the registry and their names which match the given filter.
@param filter the metric filter to match
@return all the gauges in the registry
"""
return getMetrics(Gauge.class, filter)... | java | @Override
public SortedMap<String, Gauge> getGauges(MetricFilter filter) {
return getMetrics(Gauge.class, filter);
} | [
"@",
"Override",
"public",
"SortedMap",
"<",
"String",
",",
"Gauge",
">",
"getGauges",
"(",
"MetricFilter",
"filter",
")",
"{",
"return",
"getMetrics",
"(",
"Gauge",
".",
"class",
",",
"filter",
")",
";",
"}"
] | Returns a map of all the gauges in the registry and their names which match the given filter.
@param filter the metric filter to match
@return all the gauges in the registry | [
"Returns",
"a",
"map",
"of",
"all",
"the",
"gauges",
"in",
"the",
"registry",
"and",
"their",
"names",
"which",
"match",
"the",
"given",
"filter",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.metrics/src/com/ibm/ws/microprofile/metrics/impl/MetricRegistryImpl.java#L340-L343 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java | ExpressRoutePortsInner.beginUpdateTagsAsync | public Observable<ExpressRoutePortInner> beginUpdateTagsAsync(String resourceGroupName, String expressRoutePortName) {
"""
Update ExpressRoutePort tags.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of the ExpressRoutePort resource.
@throws IllegalArgumentExcept... | java | public Observable<ExpressRoutePortInner> beginUpdateTagsAsync(String resourceGroupName, String expressRoutePortName) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName).map(new Func1<ServiceResponse<ExpressRoutePortInner>, ExpressRoutePortInner>() {
@Override
... | [
"public",
"Observable",
"<",
"ExpressRoutePortInner",
">",
"beginUpdateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRoutePortName",
")",
"{",
"return",
"beginUpdateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"expressRoutePortName",
... | Update ExpressRoutePort tags.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of the ExpressRoutePort resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ExpressRoutePortInner object | [
"Update",
"ExpressRoutePort",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java#L697-L704 |
UrielCh/ovh-java-sdk | ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java | ApiOvhCaasregistry.serviceName_serviceInfos_PUT | public void serviceName_serviceInfos_PUT(String serviceName, net.minidev.ovh.api.services.OvhService body) throws IOException {
"""
Alter this object properties
REST: PUT /caas/registry/{serviceName}/serviceInfos
@param body [required] New object properties
@param serviceName [required] The internal ID of you... | java | public void serviceName_serviceInfos_PUT(String serviceName, net.minidev.ovh.api.services.OvhService body) throws IOException {
String qPath = "/caas/registry/{serviceName}/serviceInfos";
StringBuilder sb = path(qPath, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_serviceInfos_PUT",
"(",
"String",
"serviceName",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"services",
".",
"OvhService",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/caas/registry/{serviceNam... | Alter this object properties
REST: PUT /caas/registry/{serviceName}/serviceInfos
@param body [required] New object properties
@param serviceName [required] The internal ID of your project
API beta | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java#L185-L189 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/font/effects/OutlineEffect.java | OutlineEffect.getStroke | public Stroke getStroke() {
"""
Get the stroke being used to draw the outline
@return The stroke being used to draw the outline
"""
if (stroke == null) {
return new BasicStroke(width, BasicStroke.CAP_SQUARE, join);
}
return stroke;
} | java | public Stroke getStroke() {
if (stroke == null) {
return new BasicStroke(width, BasicStroke.CAP_SQUARE, join);
}
return stroke;
} | [
"public",
"Stroke",
"getStroke",
"(",
")",
"{",
"if",
"(",
"stroke",
"==",
"null",
")",
"{",
"return",
"new",
"BasicStroke",
"(",
"width",
",",
"BasicStroke",
".",
"CAP_SQUARE",
",",
"join",
")",
";",
"}",
"return",
"stroke",
";",
"}"
] | Get the stroke being used to draw the outline
@return The stroke being used to draw the outline | [
"Get",
"the",
"stroke",
"being",
"used",
"to",
"draw",
"the",
"outline"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/font/effects/OutlineEffect.java#L113-L119 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/lock/NullResourceLocksHolder.java | NullResourceLocksHolder.checkLock | public void checkLock(Session session, String path, List<String> tokens) throws LockException {
"""
Checks if the node can be unlocked using current tokens.
@param session current session
@param path node path
@param tokens tokens
@throws LockException {@link LockException}
"""
String repoPath = s... | java | public void checkLock(Session session, String path, List<String> tokens) throws LockException
{
String repoPath = session.getRepository().hashCode() + "/" + session.getWorkspace().getName() + "/" + path;
String currentToken = nullResourceLocks.get(repoPath);
if (currentToken == null)
... | [
"public",
"void",
"checkLock",
"(",
"Session",
"session",
",",
"String",
"path",
",",
"List",
"<",
"String",
">",
"tokens",
")",
"throws",
"LockException",
"{",
"String",
"repoPath",
"=",
"session",
".",
"getRepository",
"(",
")",
".",
"hashCode",
"(",
")"... | Checks if the node can be unlocked using current tokens.
@param session current session
@param path node path
@param tokens tokens
@throws LockException {@link LockException} | [
"Checks",
"if",
"the",
"node",
"can",
"be",
"unlocked",
"using",
"current",
"tokens",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/lock/NullResourceLocksHolder.java#L123-L146 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/util/POIUtils.java | POIUtils.getDataFormatIndex | public static short getDataFormatIndex(final Sheet sheet, final String pattern) {
"""
指定した書式のインデックス番号を取得する。シートに存在しない場合は、新しく作成する。
@param sheet シート
@param pattern 作成する書式のパターン
@return 書式のインデックス番号。
@throws IllegalArgumentException {@literal sheet == null.}
@throws IllegalArgumentException {@literal pattern == nul... | java | public static short getDataFormatIndex(final Sheet sheet, final String pattern) {
ArgUtils.notNull(sheet, "sheet");
ArgUtils.notEmpty(pattern, "pattern");
return sheet.getWorkbook().getCreationHelper().createDataFormat().getFormat(pattern);
} | [
"public",
"static",
"short",
"getDataFormatIndex",
"(",
"final",
"Sheet",
"sheet",
",",
"final",
"String",
"pattern",
")",
"{",
"ArgUtils",
".",
"notNull",
"(",
"sheet",
",",
"\"sheet\"",
")",
";",
"ArgUtils",
".",
"notEmpty",
"(",
"pattern",
",",
"\"pattern... | 指定した書式のインデックス番号を取得する。シートに存在しない場合は、新しく作成する。
@param sheet シート
@param pattern 作成する書式のパターン
@return 書式のインデックス番号。
@throws IllegalArgumentException {@literal sheet == null.}
@throws IllegalArgumentException {@literal pattern == null || pattern.isEmpty().} | [
"指定した書式のインデックス番号を取得する。シートに存在しない場合は、新しく作成する。"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/POIUtils.java#L294-L300 |
Steveice10/OpenNBT | src/main/java/com/github/steveice10/opennbt/NBTIO.java | NBTIO.writeFile | public static void writeFile(CompoundTag tag, String path) throws IOException {
"""
Writes the given root CompoundTag to the given file, compressed and in big endian.
@param tag Tag to write.
@param path Path to write to.
@throws java.io.IOException If an I/O error occurs.
"""
writeFile(tag, new ... | java | public static void writeFile(CompoundTag tag, String path) throws IOException {
writeFile(tag, new File(path));
} | [
"public",
"static",
"void",
"writeFile",
"(",
"CompoundTag",
"tag",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"writeFile",
"(",
"tag",
",",
"new",
"File",
"(",
"path",
")",
")",
";",
"}"
] | Writes the given root CompoundTag to the given file, compressed and in big endian.
@param tag Tag to write.
@param path Path to write to.
@throws java.io.IOException If an I/O error occurs. | [
"Writes",
"the",
"given",
"root",
"CompoundTag",
"to",
"the",
"given",
"file",
"compressed",
"and",
"in",
"big",
"endian",
"."
] | train | https://github.com/Steveice10/OpenNBT/blob/9bf4adb2afd206a21bc4309c85d642494d1fb536/src/main/java/com/github/steveice10/opennbt/NBTIO.java#L93-L95 |
lucee/Lucee | core/src/main/java/lucee/runtime/text/xml/XMLCaster.java | XMLCaster.toText | public static Text toText(Document doc, Object o) throws PageException {
"""
casts a value to a XML Text
@param doc XML Document
@param o Object to cast
@return XML Text Object
@throws PageException
"""
if (o instanceof Text) return (Text) o;
else if (o instanceof CharacterData) return doc.createTextNo... | java | public static Text toText(Document doc, Object o) throws PageException {
if (o instanceof Text) return (Text) o;
else if (o instanceof CharacterData) return doc.createTextNode(((CharacterData) o).getData());
return doc.createTextNode(Caster.toString(o));
} | [
"public",
"static",
"Text",
"toText",
"(",
"Document",
"doc",
",",
"Object",
"o",
")",
"throws",
"PageException",
"{",
"if",
"(",
"o",
"instanceof",
"Text",
")",
"return",
"(",
"Text",
")",
"o",
";",
"else",
"if",
"(",
"o",
"instanceof",
"CharacterData",... | casts a value to a XML Text
@param doc XML Document
@param o Object to cast
@return XML Text Object
@throws PageException | [
"casts",
"a",
"value",
"to",
"a",
"XML",
"Text"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/text/xml/XMLCaster.java#L86-L90 |
google/Accessibility-Test-Framework-for-Android | src/main/java/com/googlecode/eyesfree/utils/LogUtils.java | LogUtils.wtf | public static void wtf(Object source, String format, Object... args) {
"""
Logs a string to the console using the source object's name as the log tag at the assert level.
If the source object is null, the default tag (see {@link LogUtils#TAG}) is used.
@param source The object that generated the log event.
@p... | java | public static void wtf(Object source, String format, Object... args) {
log(source, Log.ASSERT, format, args);
} | [
"public",
"static",
"void",
"wtf",
"(",
"Object",
"source",
",",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"log",
"(",
"source",
",",
"Log",
".",
"ASSERT",
",",
"format",
",",
"args",
")",
";",
"}"
] | Logs a string to the console using the source object's name as the log tag at the assert level.
If the source object is null, the default tag (see {@link LogUtils#TAG}) is used.
@param source The object that generated the log event.
@param format A format string, see {@link String#format(String, Object...)}.
@param ar... | [
"Logs",
"a",
"string",
"to",
"the",
"console",
"using",
"the",
"source",
"object",
"s",
"name",
"as",
"the",
"log",
"tag",
"at",
"the",
"assert",
"level",
".",
"If",
"the",
"source",
"object",
"is",
"null",
"the",
"default",
"tag",
"(",
"see",
"{",
"... | train | https://github.com/google/Accessibility-Test-Framework-for-Android/blob/a6117fe0059c82dd764fa628d3817d724570f69e/src/main/java/com/googlecode/eyesfree/utils/LogUtils.java#L240-L242 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_portability_id_document_documentId_GET | public OvhPortabilityDocument billingAccount_portability_id_document_documentId_GET(String billingAccount, Long id, Long documentId) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/portability/{id}/document/{documentId}
@param billingAccount [required] The name of your... | java | public OvhPortabilityDocument billingAccount_portability_id_document_documentId_GET(String billingAccount, Long id, Long documentId) throws IOException {
String qPath = "/telephony/{billingAccount}/portability/{id}/document/{documentId}";
StringBuilder sb = path(qPath, billingAccount, id, documentId);
String resp... | [
"public",
"OvhPortabilityDocument",
"billingAccount_portability_id_document_documentId_GET",
"(",
"String",
"billingAccount",
",",
"Long",
"id",
",",
"Long",
"documentId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/portability/{id}... | Get this object properties
REST: GET /telephony/{billingAccount}/portability/{id}/document/{documentId}
@param billingAccount [required] The name of your billingAccount
@param id [required] The ID of the portability
@param documentId [required] Identifier of the document | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L271-L276 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java | SegmentIntersection.parallelSideEffect | private static boolean parallelSideEffect(
final double pXA, final double pYA, final double pXB, final double pYB,
final double pXC, final double pYC, final double pXD, final double pYD,
final PointL pIntersection
) {
"""
When the segments are parallels and overlap, the midd... | java | private static boolean parallelSideEffect(
final double pXA, final double pYA, final double pXB, final double pYB,
final double pXC, final double pYC, final double pXD, final double pYD,
final PointL pIntersection
) {
if (pXA == pXB) {
return parallelSideEffec... | [
"private",
"static",
"boolean",
"parallelSideEffect",
"(",
"final",
"double",
"pXA",
",",
"final",
"double",
"pYA",
",",
"final",
"double",
"pXB",
",",
"final",
"double",
"pYB",
",",
"final",
"double",
"pXC",
",",
"final",
"double",
"pYC",
",",
"final",
"d... | When the segments are parallels and overlap, the middle of the overlap is considered as the intersection | [
"When",
"the",
"segments",
"are",
"parallels",
"and",
"overlap",
"the",
"middle",
"of",
"the",
"overlap",
"is",
"considered",
"as",
"the",
"intersection"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java#L47-L72 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContent.java | CmsXmlContent.addBookmarkForValue | protected void addBookmarkForValue(I_CmsXmlContentValue value, String path, Locale locale, boolean enabled) {
"""
Adds a bookmark for the given value.<p>
@param value the value to bookmark
@param path the lookup path to use for the bookmark
@param locale the locale to use for the bookmark
@param enabled if t... | java | protected void addBookmarkForValue(I_CmsXmlContentValue value, String path, Locale locale, boolean enabled) {
addBookmark(path, locale, enabled, value);
} | [
"protected",
"void",
"addBookmarkForValue",
"(",
"I_CmsXmlContentValue",
"value",
",",
"String",
"path",
",",
"Locale",
"locale",
",",
"boolean",
"enabled",
")",
"{",
"addBookmark",
"(",
"path",
",",
"locale",
",",
"enabled",
",",
"value",
")",
";",
"}"
] | Adds a bookmark for the given value.<p>
@param value the value to bookmark
@param path the lookup path to use for the bookmark
@param locale the locale to use for the bookmark
@param enabled if true, the value is enabled, if false it is disabled | [
"Adds",
"a",
"bookmark",
"for",
"the",
"given",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContent.java#L847-L850 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java | AbstractValidate.exclusiveBetween | public <T, V extends Comparable<T>> V exclusiveBetween(final T start, final T end, final V value) {
"""
<p>Validate that the specified argument object fall between the two exclusive values specified; otherwise, throws an exception.</p>
<pre>Validate.exclusiveBetween(0, 2, 1);</pre>
@param <T>
the type of the ... | java | public <T, V extends Comparable<T>> V exclusiveBetween(final T start, final T end, final V value) {
if (value.compareTo(start) <= 0 || value.compareTo(end) >= 0) {
fail(String.format(DEFAULT_EXCLUSIVE_BETWEEN_EX_MESSAGE, value, start, end));
}
return value;
} | [
"public",
"<",
"T",
",",
"V",
"extends",
"Comparable",
"<",
"T",
">",
">",
"V",
"exclusiveBetween",
"(",
"final",
"T",
"start",
",",
"final",
"T",
"end",
",",
"final",
"V",
"value",
")",
"{",
"if",
"(",
"value",
".",
"compareTo",
"(",
"start",
")",... | <p>Validate that the specified argument object fall between the two exclusive values specified; otherwise, throws an exception.</p>
<pre>Validate.exclusiveBetween(0, 2, 1);</pre>
@param <T>
the type of the argument start and end values
@param <V>
the type of the value
@param start
the exclusive start value, not null
@... | [
"<p",
">",
"Validate",
"that",
"the",
"specified",
"argument",
"object",
"fall",
"between",
"the",
"two",
"exclusive",
"values",
"specified",
";",
"otherwise",
"throws",
"an",
"exception",
".",
"<",
"/",
"p",
">",
"<pre",
">",
"Validate",
".",
"exclusiveBetw... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java#L1387-L1392 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/RestClient.java | RestClient.getAttachmentMetaData | public Attachment getAttachmentMetaData(String assetId, String attachmentId) throws IOException, BadVersionException, RequestFailureException {
"""
Returns the meta data about an attachment
@param assetId
The ID of the asset owning the attachment
@param attachmentId
The ID of the attachment
@return The atta... | java | public Attachment getAttachmentMetaData(String assetId, String attachmentId) throws IOException, BadVersionException, RequestFailureException {
// At the moment can only get all attachments
Asset ass = getAsset(assetId);
List<Attachment> allAttachments = ass.getAttachments();
for (Attach... | [
"public",
"Attachment",
"getAttachmentMetaData",
"(",
"String",
"assetId",
",",
"String",
"attachmentId",
")",
"throws",
"IOException",
",",
"BadVersionException",
",",
"RequestFailureException",
"{",
"// At the moment can only get all attachments",
"Asset",
"ass",
"=",
"ge... | Returns the meta data about an attachment
@param assetId
The ID of the asset owning the attachment
@param attachmentId
The ID of the attachment
@return The attachment meta data
@throws IOException
@throws RequestFailureException | [
"Returns",
"the",
"meta",
"data",
"about",
"an",
"attachment"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/RestClient.java#L503-L515 |
kiegroup/jbpm | jbpm-runtime-manager/src/main/java/org/jbpm/runtime/manager/impl/RuntimeEnvironmentBuilder.java | RuntimeEnvironmentBuilder.getDefault | public static RuntimeEnvironmentBuilder getDefault(String groupId, String artifactId, String version, String kbaseName, String ksessionName) {
"""
Provides default configuration of <code>RuntimeEnvironmentBuilder</code> that is based on:
<ul>
<li>DefaultRuntimeEnvironment</li>
</ul>
This one is tailored to wor... | java | public static RuntimeEnvironmentBuilder getDefault(String groupId, String artifactId, String version, String kbaseName, String ksessionName) {
KieServices ks = KieServices.Factory.get();
return getDefault(ks.newReleaseId(groupId, artifactId, version), kbaseName, ksessionName);
} | [
"public",
"static",
"RuntimeEnvironmentBuilder",
"getDefault",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"version",
",",
"String",
"kbaseName",
",",
"String",
"ksessionName",
")",
"{",
"KieServices",
"ks",
"=",
"KieServices",
".",
"Fact... | Provides default configuration of <code>RuntimeEnvironmentBuilder</code> that is based on:
<ul>
<li>DefaultRuntimeEnvironment</li>
</ul>
This one is tailored to works smoothly with kjars as the notion of kbase and ksessions
@param groupId group id of kjar
@param artifactId artifact id of kjar
@param version version num... | [
"Provides",
"default",
"configuration",
"of",
"<code",
">",
"RuntimeEnvironmentBuilder<",
"/",
"code",
">",
"that",
"is",
"based",
"on",
":",
"<ul",
">",
"<li",
">",
"DefaultRuntimeEnvironment<",
"/",
"li",
">",
"<",
"/",
"ul",
">",
"This",
"one",
"is",
"t... | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-runtime-manager/src/main/java/org/jbpm/runtime/manager/impl/RuntimeEnvironmentBuilder.java#L163-L166 |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/reflect/Property.java | Property.get | public Object get(Object obj) throws ReflectionException {
"""
Returns the value of the representation of this property from the specified object.
<p> The underlying property's value is obtained trying to invoke the {@code readMethod}.
<p> If this {@link Property} object has no public {@code readMethod},
it... | java | public Object get(Object obj) throws ReflectionException {
try {
if (isPublic(readMethod)) {
return readMethod.invoke(obj);
} else {
throw new ReflectionException("Cannot get the value of " + this + ", as it is write-only.");
}
} catch ... | [
"public",
"Object",
"get",
"(",
"Object",
"obj",
")",
"throws",
"ReflectionException",
"{",
"try",
"{",
"if",
"(",
"isPublic",
"(",
"readMethod",
")",
")",
"{",
"return",
"readMethod",
".",
"invoke",
"(",
"obj",
")",
";",
"}",
"else",
"{",
"throw",
"ne... | Returns the value of the representation of this property from the specified object.
<p> The underlying property's value is obtained trying to invoke the {@code readMethod}.
<p> If this {@link Property} object has no public {@code readMethod},
it is considered write-only, and the action will be prevented throwing
a {@... | [
"Returns",
"the",
"value",
"of",
"the",
"representation",
"of",
"this",
"property",
"from",
"the",
"specified",
"object",
"."
] | train | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/reflect/Property.java#L403-L413 |
minio/minio-java | api/src/main/java/io/minio/ServerSideEncryption.java | ServerSideEncryption.withManagedKeys | public static ServerSideEncryption withManagedKeys(String keyId, Map<String,String> context)
throws InvalidArgumentException, UnsupportedEncodingException {
"""
Create a new server-side-encryption object for encryption using a KMS (a.k.a. SSE-KMS).
@param keyId specifies the customer-master-key (CMK) and... | java | public static ServerSideEncryption withManagedKeys(String keyId, Map<String,String> context)
throws InvalidArgumentException, UnsupportedEncodingException {
if (keyId == null) {
throw new InvalidArgumentException("The key-ID cannot be null");
}
if (context == null) {
return new ServerSideEn... | [
"public",
"static",
"ServerSideEncryption",
"withManagedKeys",
"(",
"String",
"keyId",
",",
"Map",
"<",
"String",
",",
"String",
">",
"context",
")",
"throws",
"InvalidArgumentException",
",",
"UnsupportedEncodingException",
"{",
"if",
"(",
"keyId",
"==",
"null",
... | Create a new server-side-encryption object for encryption using a KMS (a.k.a. SSE-KMS).
@param keyId specifies the customer-master-key (CMK) and must not be null.
@param context is the encryption context. If the context is null no context is used.
@return an instance of ServerSideEncryption implementing SSE-KMS. | [
"Create",
"a",
"new",
"server",
"-",
"side",
"-",
"encryption",
"object",
"for",
"encryption",
"using",
"a",
"KMS",
"(",
"a",
".",
"k",
".",
"a",
".",
"SSE",
"-",
"KMS",
")",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/ServerSideEncryption.java#L142-L169 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/argumentselectiondefects/Parameter.java | Parameter.isAssignableTo | boolean isAssignableTo(Parameter target, VisitorState state) {
"""
Return true if this parameter is assignable to the target parameter. This will consider
subclassing, autoboxing and null.
"""
if (state.getTypes().isSameType(type(), Type.noType)
|| state.getTypes().isSameType(target.type(), Type.n... | java | boolean isAssignableTo(Parameter target, VisitorState state) {
if (state.getTypes().isSameType(type(), Type.noType)
|| state.getTypes().isSameType(target.type(), Type.noType)) {
return false;
}
try {
return state.getTypes().isAssignable(type(), target.type());
} catch (CompletionFail... | [
"boolean",
"isAssignableTo",
"(",
"Parameter",
"target",
",",
"VisitorState",
"state",
")",
"{",
"if",
"(",
"state",
".",
"getTypes",
"(",
")",
".",
"isSameType",
"(",
"type",
"(",
")",
",",
"Type",
".",
"noType",
")",
"||",
"state",
".",
"getTypes",
"... | Return true if this parameter is assignable to the target parameter. This will consider
subclassing, autoboxing and null. | [
"Return",
"true",
"if",
"this",
"parameter",
"is",
"assignable",
"to",
"the",
"target",
"parameter",
".",
"This",
"will",
"consider",
"subclassing",
"autoboxing",
"and",
"null",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/argumentselectiondefects/Parameter.java#L115-L128 |
aws/aws-sdk-java | aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/UpdateElasticsearchDomainConfigRequest.java | UpdateElasticsearchDomainConfigRequest.withAdvancedOptions | public UpdateElasticsearchDomainConfigRequest withAdvancedOptions(java.util.Map<String, String> advancedOptions) {
"""
<p>
Modifies the advanced option to allow references to indices in an HTTP request body. Must be <code>false</code>
when configuring access to individual sub-resources. By default, the value is ... | java | public UpdateElasticsearchDomainConfigRequest withAdvancedOptions(java.util.Map<String, String> advancedOptions) {
setAdvancedOptions(advancedOptions);
return this;
} | [
"public",
"UpdateElasticsearchDomainConfigRequest",
"withAdvancedOptions",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"advancedOptions",
")",
"{",
"setAdvancedOptions",
"(",
"advancedOptions",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Modifies the advanced option to allow references to indices in an HTTP request body. Must be <code>false</code>
when configuring access to individual sub-resources. By default, the value is <code>true</code>. See <a href=
"http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains... | [
"<p",
">",
"Modifies",
"the",
"advanced",
"option",
"to",
"allow",
"references",
"to",
"indices",
"in",
"an",
"HTTP",
"request",
"body",
".",
"Must",
"be",
"<code",
">",
"false<",
"/",
"code",
">",
"when",
"configuring",
"access",
"to",
"individual",
"sub"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/UpdateElasticsearchDomainConfigRequest.java#L415-L418 |
alibaba/canal | client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/service/ESSyncService.java | ESSyncService.mainTableInsert | private void mainTableInsert(ESSyncConfig config, Dml dml, Map<String, Object> data) {
"""
主表(单表)复杂字段insert
@param config es配置
@param dml dml信息
@param data 单行dml数据
"""
ESMapping mapping = config.getEsMapping();
String sql = mapping.getSql();
String condition = ESSyncUtil.pkConditio... | java | private void mainTableInsert(ESSyncConfig config, Dml dml, Map<String, Object> data) {
ESMapping mapping = config.getEsMapping();
String sql = mapping.getSql();
String condition = ESSyncUtil.pkConditionSql(mapping, data);
sql = ESSyncUtil.appendCondition(sql, condition);
DataSour... | [
"private",
"void",
"mainTableInsert",
"(",
"ESSyncConfig",
"config",
",",
"Dml",
"dml",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
")",
"{",
"ESMapping",
"mapping",
"=",
"config",
".",
"getEsMapping",
"(",
")",
";",
"String",
"sql",
"=",
"map... | 主表(单表)复杂字段insert
@param config es配置
@param dml dml信息
@param data 单行dml数据 | [
"主表",
"(",
"单表",
")",
"复杂字段insert"
] | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/service/ESSyncService.java#L455-L489 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ParsedScheduleExpression.java | ParsedScheduleExpression.getNextTimeout | public long getNextTimeout(long lastTimeout) {
"""
Determines the next timeout for the schedule expression.
@param lastTimeout the last timeout in milliseconds
@return the next timeout in milliseconds, or -1 if there are no more
future timeouts for the expression
@throws IllegalArgumentException if lastTimeo... | java | public long getNextTimeout(long lastTimeout)
{
// Perform basic validation of lastTimeout, which should be a value that
// was previously returned from getFirstTimeout.
if (lastTimeout < start)
{
throw new IllegalArgumentException("last timeout " + lastTimeout + " is bef... | [
"public",
"long",
"getNextTimeout",
"(",
"long",
"lastTimeout",
")",
"{",
"// Perform basic validation of lastTimeout, which should be a value that",
"// was previously returned from getFirstTimeout.",
"if",
"(",
"lastTimeout",
"<",
"start",
")",
"{",
"throw",
"new",
"IllegalAr... | Determines the next timeout for the schedule expression.
@param lastTimeout the last timeout in milliseconds
@return the next timeout in milliseconds, or -1 if there are no more
future timeouts for the expression
@throws IllegalArgumentException if lastTimeout is before the start time
of the expression | [
"Determines",
"the",
"next",
"timeout",
"for",
"the",
"schedule",
"expression",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ParsedScheduleExpression.java#L466-L487 |
dnsjava/dnsjava | org/xbill/DNS/TSIG.java | TSIG.verify | private static boolean
verify(Mac mac, byte [] signature, boolean truncation_ok) {
"""
Verifies the data (computes the secure hash and compares it to the input)
@param mac The HMAC generator
@param signature The signature to compare against
@param truncation_ok If true, the signature may be truncated; only the
... | java | private static boolean
verify(Mac mac, byte [] signature, boolean truncation_ok) {
byte [] expected = mac.doFinal();
if (truncation_ok && signature.length < expected.length) {
byte [] truncated = new byte[signature.length];
System.arraycopy(expected, 0, truncated, 0, trun... | [
"private",
"static",
"boolean",
"verify",
"(",
"Mac",
"mac",
",",
"byte",
"[",
"]",
"signature",
",",
"boolean",
"truncation_ok",
")",
"{",
"byte",
"[",
"]",
"expected",
"=",
"mac",
".",
"doFinal",
"(",
")",
";",
"if",
"(",
"truncation_ok",
"&&",
"sign... | Verifies the data (computes the secure hash and compares it to the input)
@param mac The HMAC generator
@param signature The signature to compare against
@param truncation_ok If true, the signature may be truncated; only the
number of bytes in the provided signature are compared.
@return true if the signature matches, ... | [
"Verifies",
"the",
"data",
"(",
"computes",
"the",
"secure",
"hash",
"and",
"compares",
"it",
"to",
"the",
"input",
")"
] | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/TSIG.java#L109-L118 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneMaximizeButtonPainter.java | TitlePaneMaximizeButtonPainter.paintMaximizeHover | private void paintMaximizeHover(Graphics2D g, JComponent c, int width, int height) {
"""
Paint the foreground maximized button mouse-over state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component... | java | private void paintMaximizeHover(Graphics2D g, JComponent c, int width, int height) {
maximizePainter.paintHover(g, c, width, height);
} | [
"private",
"void",
"paintMaximizeHover",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"maximizePainter",
".",
"paintHover",
"(",
"g",
",",
"c",
",",
"width",
",",
"height",
")",
";",
"}"
] | Paint the foreground maximized button mouse-over state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component. | [
"Paint",
"the",
"foreground",
"maximized",
"button",
"mouse",
"-",
"over",
"state",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneMaximizeButtonPainter.java#L185-L187 |
apache/groovy | src/main/groovy/groovy/util/Node.java | Node.breadthFirst | public void breadthFirst(Map<String, Object> options, Closure c) {
"""
Calls the provided closure for all the nodes in the tree
using a breadth-first traversal.
A boolean 'preorder' options is supported.
@param options map containing options
@param c the closure to run for each node (a one or two parameter c... | java | public void breadthFirst(Map<String, Object> options, Closure c) {
boolean preorder = Boolean.valueOf(options.get("preorder").toString());
if (preorder) callClosureForNode(c, this, 1);
breadthFirstRest(preorder, 2, c);
if (!preorder) callClosureForNode(c, this, 1);
} | [
"public",
"void",
"breadthFirst",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
",",
"Closure",
"c",
")",
"{",
"boolean",
"preorder",
"=",
"Boolean",
".",
"valueOf",
"(",
"options",
".",
"get",
"(",
"\"preorder\"",
")",
".",
"toString",
"(",
... | Calls the provided closure for all the nodes in the tree
using a breadth-first traversal.
A boolean 'preorder' options is supported.
@param options map containing options
@param c the closure to run for each node (a one or two parameter can be used; if one parameter is given the
closure will be passed the node, for a ... | [
"Calls",
"the",
"provided",
"closure",
"for",
"all",
"the",
"nodes",
"in",
"the",
"tree",
"using",
"a",
"breadth",
"-",
"first",
"traversal",
".",
"A",
"boolean",
"preorder",
"options",
"is",
"supported",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L711-L716 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ServletStartedListener.java | ServletStartedListener.updateSecurityMetadataWithRunAs | public void updateSecurityMetadataWithRunAs(SecurityMetadata securityMetadataFromDD, IServletConfig servletConfig) {
"""
Updates the security metadata object (which at this time only has the deployment descriptor info)
with the runAs roles defined in the servlet. The sources are the web.xml, static annotations,
... | java | public void updateSecurityMetadataWithRunAs(SecurityMetadata securityMetadataFromDD, IServletConfig servletConfig) {
String runAs = servletConfig.getRunAsRole();
if (runAs != null) {
String servletName = servletConfig.getServletName();
//only add if there is no run-as entry in we... | [
"public",
"void",
"updateSecurityMetadataWithRunAs",
"(",
"SecurityMetadata",
"securityMetadataFromDD",
",",
"IServletConfig",
"servletConfig",
")",
"{",
"String",
"runAs",
"=",
"servletConfig",
".",
"getRunAsRole",
"(",
")",
";",
"if",
"(",
"runAs",
"!=",
"null",
"... | Updates the security metadata object (which at this time only has the deployment descriptor info)
with the runAs roles defined in the servlet. The sources are the web.xml, static annotations,
and dynamic annotations.
@param securityMetadataFromDD the security metadata processed from the deployment descriptor
@param se... | [
"Updates",
"the",
"security",
"metadata",
"object",
"(",
"which",
"at",
"this",
"time",
"only",
"has",
"the",
"deployment",
"descriptor",
"info",
")",
"with",
"the",
"runAs",
"roles",
"defined",
"in",
"the",
"servlet",
".",
"The",
"sources",
"are",
"the",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ServletStartedListener.java#L230-L247 |
Daytron/SimpleDialogFX | src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java | Dialog.setDetailsFont | public void setDetailsFont(String font_family, int font_size) {
"""
Sets both details label's font family and size.
@param font_family Font family in <code>Strings</code>
@param font_size Font size in <code>integer</code> (pixels)
"""
this.detailsLabel
.setStyle("-fx-font-family: \"... | java | public void setDetailsFont(String font_family, int font_size) {
this.detailsLabel
.setStyle("-fx-font-family: \"" + font_family + "\";"
+ "-fx-font-size:" + Integer.toString(font_size) + "px;");
} | [
"public",
"void",
"setDetailsFont",
"(",
"String",
"font_family",
",",
"int",
"font_size",
")",
"{",
"this",
".",
"detailsLabel",
".",
"setStyle",
"(",
"\"-fx-font-family: \\\"\"",
"+",
"font_family",
"+",
"\"\\\";\"",
"+",
"\"-fx-font-size:\"",
"+",
"Integer",
".... | Sets both details label's font family and size.
@param font_family Font family in <code>Strings</code>
@param font_size Font size in <code>integer</code> (pixels) | [
"Sets",
"both",
"details",
"label",
"s",
"font",
"family",
"and",
"size",
"."
] | train | https://github.com/Daytron/SimpleDialogFX/blob/54e813dbb0ebabad8e0a81b6b5f05e518747611e/src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java#L870-L874 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java | Ftp.download | public void download(String path, String fileName, File outFile) {
"""
下载文件
@param path 文件路径
@param fileName 文件名
@param outFile 输出文件或目录
"""
if (outFile.isDirectory()) {
outFile = new File(outFile, fileName);
}
if (false == outFile.exists()) {
FileUtil.touch(outFile);
}
try (OutputSt... | java | public void download(String path, String fileName, File outFile) {
if (outFile.isDirectory()) {
outFile = new File(outFile, fileName);
}
if (false == outFile.exists()) {
FileUtil.touch(outFile);
}
try (OutputStream out = FileUtil.getOutputStream(outFile)) {
download(path, fileName, out);
}... | [
"public",
"void",
"download",
"(",
"String",
"path",
",",
"String",
"fileName",
",",
"File",
"outFile",
")",
"{",
"if",
"(",
"outFile",
".",
"isDirectory",
"(",
")",
")",
"{",
"outFile",
"=",
"new",
"File",
"(",
"outFile",
",",
"fileName",
")",
";",
... | 下载文件
@param path 文件路径
@param fileName 文件名
@param outFile 输出文件或目录 | [
"下载文件"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java#L447-L459 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java | DevicesInner.createOrUpdateAsync | public Observable<DataBoxEdgeDeviceInner> createOrUpdateAsync(String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) {
"""
Creates or updates a Data Box Edge/Gateway resource.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param dataBoxEdg... | java | public Observable<DataBoxEdgeDeviceInner> createOrUpdateAsync(String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) {
return createOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, dataBoxEdgeDevice).map(new Func1<ServiceResponse<DataBoxEdgeDeviceInner>, DataBoxEdg... | [
"public",
"Observable",
"<",
"DataBoxEdgeDeviceInner",
">",
"createOrUpdateAsync",
"(",
"String",
"deviceName",
",",
"String",
"resourceGroupName",
",",
"DataBoxEdgeDeviceInner",
"dataBoxEdgeDevice",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"deviceNa... | Creates or updates a Data Box Edge/Gateway resource.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param dataBoxEdgeDevice The resource object.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Creates",
"or",
"updates",
"a",
"Data",
"Box",
"Edge",
"/",
"Gateway",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L730-L737 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java | UserAttrs.setFloatAttribute | public static final void setFloatAttribute(Path path, String attribute, float value, LinkOption... options) throws IOException {
"""
Set user-defined-attribute
@param path
@param attribute user:attribute name. user: can be omitted.
@param value
@param options
@throws IOException
"""
attribute = a... | java | public static final void setFloatAttribute(Path path, String attribute, float value, LinkOption... options) throws IOException
{
attribute = attribute.startsWith("user:") ? attribute : "user:"+attribute;
Files.setAttribute(path, attribute, Primitives.writeFloat(value), options);
} | [
"public",
"static",
"final",
"void",
"setFloatAttribute",
"(",
"Path",
"path",
",",
"String",
"attribute",
",",
"float",
"value",
",",
"LinkOption",
"...",
"options",
")",
"throws",
"IOException",
"{",
"attribute",
"=",
"attribute",
".",
"startsWith",
"(",
"\"... | Set user-defined-attribute
@param path
@param attribute user:attribute name. user: can be omitted.
@param value
@param options
@throws IOException | [
"Set",
"user",
"-",
"defined",
"-",
"attribute"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java#L79-L83 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/CorruptReplicasMap.java | CorruptReplicasMap.isReplicaCorrupt | boolean isReplicaCorrupt(Block blk, DatanodeDescriptor node) {
"""
Check if replica belonging to Datanode is corrupt
@param blk Block to check
@param node DatanodeDescriptor which holds the replica
@return true if replica is corrupt, false if does not exists in this map
"""
Collection<DatanodeDescript... | java | boolean isReplicaCorrupt(Block blk, DatanodeDescriptor node) {
Collection<DatanodeDescriptor> nodes = getNodes(blk);
return ((nodes != null) && (nodes.contains(node)));
} | [
"boolean",
"isReplicaCorrupt",
"(",
"Block",
"blk",
",",
"DatanodeDescriptor",
"node",
")",
"{",
"Collection",
"<",
"DatanodeDescriptor",
">",
"nodes",
"=",
"getNodes",
"(",
"blk",
")",
";",
"return",
"(",
"(",
"nodes",
"!=",
"null",
")",
"&&",
"(",
"nodes... | Check if replica belonging to Datanode is corrupt
@param blk Block to check
@param node DatanodeDescriptor which holds the replica
@return true if replica is corrupt, false if does not exists in this map | [
"Check",
"if",
"replica",
"belonging",
"to",
"Datanode",
"is",
"corrupt"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/CorruptReplicasMap.java#L121-L124 |
BlueBrain/bluima | modules/bluima_lexica/src/main/java/ch/epfl/bbp/uima/obo/OBOOntology.java | OBOOntology.directIsA | public boolean directIsA(String hypoID, String hyperID) {
"""
Tests whether there is a direct is_a (or has_role) relationship between
two IDs.
@param hypoID
The potential hyponym (child term).
@param hyperID
The potential hypernym (parent term).
@return Whether that direct relationship exists.
"""
... | java | public boolean directIsA(String hypoID, String hyperID) {
if (!terms.containsKey(hypoID))
return false;
OntologyTerm term = terms.get(hypoID);
if (term.getIsA().contains(hyperID))
return true;
return false;
} | [
"public",
"boolean",
"directIsA",
"(",
"String",
"hypoID",
",",
"String",
"hyperID",
")",
"{",
"if",
"(",
"!",
"terms",
".",
"containsKey",
"(",
"hypoID",
")",
")",
"return",
"false",
";",
"OntologyTerm",
"term",
"=",
"terms",
".",
"get",
"(",
"hypoID",
... | Tests whether there is a direct is_a (or has_role) relationship between
two IDs.
@param hypoID
The potential hyponym (child term).
@param hyperID
The potential hypernym (parent term).
@return Whether that direct relationship exists. | [
"Tests",
"whether",
"there",
"is",
"a",
"direct",
"is_a",
"(",
"or",
"has_role",
")",
"relationship",
"between",
"two",
"IDs",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_lexica/src/main/java/ch/epfl/bbp/uima/obo/OBOOntology.java#L322-L329 |
cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java | ElmBaseVisitor.visitInstanceElement | public T visitInstanceElement(InstanceElement elm, C context) {
"""
Visit a InstanceElement. This method will be called for
every node in the tree that is a InstanceElement.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result
"""
visitElement(el... | java | public T visitInstanceElement(InstanceElement elm, C context) {
visitElement(elm.getValue(), context);
return null;
} | [
"public",
"T",
"visitInstanceElement",
"(",
"InstanceElement",
"elm",
",",
"C",
"context",
")",
"{",
"visitElement",
"(",
"elm",
".",
"getValue",
"(",
")",
",",
"context",
")",
";",
"return",
"null",
";",
"}"
] | Visit a InstanceElement. This method will be called for
every node in the tree that is a InstanceElement.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"a",
"InstanceElement",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"InstanceElement",
"."
] | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L483-L486 |
google/error-prone-javac | src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java | ArgTokenizer.whitespaceChars | private void whitespaceChars(int low, int hi) {
"""
Specifies that all characters <i>c</i> in the range
<code>low <= <i>c</i> <= high</code>
are white space characters. White space characters serve only to
separate tokens in the input stream.
<p>Any other attribute settings for the ... | java | private void whitespaceChars(int low, int hi) {
if (low < 0)
low = 0;
if (hi >= ctype.length)
hi = ctype.length - 1;
while (low <= hi)
ctype[low++] = CT_WHITESPACE;
} | [
"private",
"void",
"whitespaceChars",
"(",
"int",
"low",
",",
"int",
"hi",
")",
"{",
"if",
"(",
"low",
"<",
"0",
")",
"low",
"=",
"0",
";",
"if",
"(",
"hi",
">=",
"ctype",
".",
"length",
")",
"hi",
"=",
"ctype",
".",
"length",
"-",
"1",
";",
... | Specifies that all characters <i>c</i> in the range
<code>low <= <i>c</i> <= high</code>
are white space characters. White space characters serve only to
separate tokens in the input stream.
<p>Any other attribute settings for the characters in the specified
range are cleared.
@param low ... | [
"Specifies",
"that",
"all",
"characters",
"<i",
">",
"c<",
"/",
"i",
">",
"in",
"the",
"range",
"<code",
">",
"low ",
";",
"<",
";",
"=",
" ",
";",
"<i",
">",
"c<",
"/",
"i",
">",
" ",
";",
"<",
";",
"=",
" ",
";",
"high<",
... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java#L220-L227 |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java | AmqpClient.closeConnection | AmqpClient closeConnection(int replyCode, String replyText, int classId, int methodId1) {
"""
Closes the Amqp Server connection.
@param replyCode
@param replyText
@param classId
@param methodId1
@return AmqpClient
"""
this.closeConnection(replyCode, replyText, classId, methodId1, null, null);
... | java | AmqpClient closeConnection(int replyCode, String replyText, int classId, int methodId1) {
this.closeConnection(replyCode, replyText, classId, methodId1, null, null);
return this;
} | [
"AmqpClient",
"closeConnection",
"(",
"int",
"replyCode",
",",
"String",
"replyText",
",",
"int",
"classId",
",",
"int",
"methodId1",
")",
"{",
"this",
".",
"closeConnection",
"(",
"replyCode",
",",
"replyText",
",",
"classId",
",",
"methodId1",
",",
"null",
... | Closes the Amqp Server connection.
@param replyCode
@param replyText
@param classId
@param methodId1
@return AmqpClient | [
"Closes",
"the",
"Amqp",
"Server",
"connection",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java#L882-L885 |
Erudika/para | para-core/src/main/java/com/erudika/para/utils/Utils.java | Utils.stripAndTrim | public static String stripAndTrim(String str, String replaceWith, boolean asciiOnly) {
"""
Strips all symbols, punctuation, whitespace and control chars from a string.
@param str a dirty string
@param replaceWith a string to replace spaces with
@param asciiOnly if true, all non-ASCII characters will be stripped... | java | public static String stripAndTrim(String str, String replaceWith, boolean asciiOnly) {
if (StringUtils.isBlank(str)) {
return "";
}
String s = str;
if (asciiOnly) {
s = str.replaceAll("[^\\p{ASCII}]", "");
}
return s.replaceAll("[\\p{S}\\p{P}\\p{C}]", replaceWith).replaceAll("\\p{Z}+", " ").trim();
} | [
"public",
"static",
"String",
"stripAndTrim",
"(",
"String",
"str",
",",
"String",
"replaceWith",
",",
"boolean",
"asciiOnly",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"str",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"String",
"s",
"=",
... | Strips all symbols, punctuation, whitespace and control chars from a string.
@param str a dirty string
@param replaceWith a string to replace spaces with
@param asciiOnly if true, all non-ASCII characters will be stripped
@return a clean string | [
"Strips",
"all",
"symbols",
"punctuation",
"whitespace",
"and",
"control",
"chars",
"from",
"a",
"string",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/utils/Utils.java#L347-L356 |
fcrepo3/fcrepo | fcrepo-webapp/fcrepo-webapp-fop/src/main/java/org/fcrepo/localservices/fop/FOPServlet.java | FOPServlet.renderXML | protected void renderXML(String xml, String xslt, HttpServletResponse response)
throws FOPException, TransformerException, IOException {
"""
Renders an XML file into a PDF file by applying a stylesheet
that converts the XML to XSL-FO. The PDF is written to a byte array
that is returned as the met... | java | protected void renderXML(String xml, String xslt, HttpServletResponse response)
throws FOPException, TransformerException, IOException {
//Setup sources
Source xmlSrc = convertString2Source(xml);
Source xsltSrc = convertString2Source(xslt);
//Setup the XSL transformatio... | [
"protected",
"void",
"renderXML",
"(",
"String",
"xml",
",",
"String",
"xslt",
",",
"HttpServletResponse",
"response",
")",
"throws",
"FOPException",
",",
"TransformerException",
",",
"IOException",
"{",
"//Setup sources",
"Source",
"xmlSrc",
"=",
"convertString2Sourc... | Renders an XML file into a PDF file by applying a stylesheet
that converts the XML to XSL-FO. The PDF is written to a byte array
that is returned as the method's result.
@param xml the XML file
@param xslt the XSLT file
@param response HTTP response object
@throws FOPException If an error occurs during the rendering of... | [
"Renders",
"an",
"XML",
"file",
"into",
"a",
"PDF",
"file",
"by",
"applying",
"a",
"stylesheet",
"that",
"converts",
"the",
"XML",
"to",
"XSL",
"-",
"FO",
".",
"The",
"PDF",
"is",
"written",
"to",
"a",
"byte",
"array",
"that",
"is",
"returned",
"as",
... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-webapp/fcrepo-webapp-fop/src/main/java/org/fcrepo/localservices/fop/FOPServlet.java#L166-L179 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/util/WindowUtil.java | WindowUtil.isScrolledIntoView | public static boolean isScrolledIntoView (Widget target, int minPixels) {
"""
Returns true if the target widget is vertically scrolled into view.
@param minPixels the minimum number of pixels that must be visible to count as "in view".
"""
int wtop = Window.getScrollTop(), wheight = Window.getClient... | java | public static boolean isScrolledIntoView (Widget target, int minPixels)
{
int wtop = Window.getScrollTop(), wheight = Window.getClientHeight();
int ttop = target.getAbsoluteTop();
if (ttop > wtop) {
return (wtop + wheight - ttop > minPixels);
} else {
return (... | [
"public",
"static",
"boolean",
"isScrolledIntoView",
"(",
"Widget",
"target",
",",
"int",
"minPixels",
")",
"{",
"int",
"wtop",
"=",
"Window",
".",
"getScrollTop",
"(",
")",
",",
"wheight",
"=",
"Window",
".",
"getClientHeight",
"(",
")",
";",
"int",
"ttop... | Returns true if the target widget is vertically scrolled into view.
@param minPixels the minimum number of pixels that must be visible to count as "in view". | [
"Returns",
"true",
"if",
"the",
"target",
"widget",
"is",
"vertically",
"scrolled",
"into",
"view",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/WindowUtil.java#L133-L142 |
motown-io/motown | chargingstation-configuration/app/src/main/java/io/motown/chargingstationconfiguration/app/ConfigurationEventListener.java | ConfigurationEventListener.onEvent | @EventHandler
protected void onEvent(UnconfiguredChargingStationBootedEvent event) {
"""
Handles {@code UnconfiguredChargingStationBootedEvent}s by requesting the domainService for information about
the vendor and model code which should be present in the event attributes.
@param event the event to handle.... | java | @EventHandler
protected void onEvent(UnconfiguredChargingStationBootedEvent event) {
LOG.info("Handling UnconfiguredChargingStationBootedEvent");
Map<String, String> attributes = event.getAttributes();
Set<Evse> evses = domainService.getEvses(attributes.get(AttributeMapKeys.VENDOR_ID), attr... | [
"@",
"EventHandler",
"protected",
"void",
"onEvent",
"(",
"UnconfiguredChargingStationBootedEvent",
"event",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Handling UnconfiguredChargingStationBootedEvent\"",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
"="... | Handles {@code UnconfiguredChargingStationBootedEvent}s by requesting the domainService for information about
the vendor and model code which should be present in the event attributes.
@param event the event to handle. | [
"Handles",
"{",
"@code",
"UnconfiguredChargingStationBootedEvent",
"}",
"s",
"by",
"requesting",
"the",
"domainService",
"for",
"information",
"about",
"the",
"vendor",
"and",
"model",
"code",
"which",
"should",
"be",
"present",
"in",
"the",
"event",
"attributes",
... | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/chargingstation-configuration/app/src/main/java/io/motown/chargingstationconfiguration/app/ConfigurationEventListener.java#L48-L65 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java | DeploymentsInner.validateAsync | public Observable<DeploymentValidateResultInner> validateAsync(String resourceGroupName, String deploymentName, DeploymentProperties properties) {
"""
Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
@param resourceGroupName The name of the resou... | java | public Observable<DeploymentValidateResultInner> validateAsync(String resourceGroupName, String deploymentName, DeploymentProperties properties) {
return validateWithServiceResponseAsync(resourceGroupName, deploymentName, properties).map(new Func1<ServiceResponse<DeploymentValidateResultInner>, DeploymentValida... | [
"public",
"Observable",
"<",
"DeploymentValidateResultInner",
">",
"validateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"deploymentName",
",",
"DeploymentProperties",
"properties",
")",
"{",
"return",
"validateWithServiceResponseAsync",
"(",
"resourceGroupName"... | Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
@param resourceGroupName The name of the resource group the template will be deployed to. The name is case insensitive.
@param deploymentName The name of the deployment.
@param properties The deployment p... | [
"Validates",
"whether",
"the",
"specified",
"template",
"is",
"syntactically",
"correct",
"and",
"will",
"be",
"accepted",
"by",
"Azure",
"Resource",
"Manager",
".."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java#L761-L768 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.unpackEntry | public static boolean unpackEntry(ZipFile zf, String name, File file) {
"""
Unpacks a single file from a ZIP archive to a file.
@param zf
ZIP file.
@param name
entry name.
@param file
target file to be created or overwritten.
@return <code>true</code> if the entry was found and unpacked,
<code>false</cod... | java | public static boolean unpackEntry(ZipFile zf, String name, File file) {
try {
return doUnpackEntry(zf, name, file);
}
catch (IOException e) {
throw ZipExceptionUtil.rethrow(e);
}
} | [
"public",
"static",
"boolean",
"unpackEntry",
"(",
"ZipFile",
"zf",
",",
"String",
"name",
",",
"File",
"file",
")",
"{",
"try",
"{",
"return",
"doUnpackEntry",
"(",
"zf",
",",
"name",
",",
"file",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
... | Unpacks a single file from a ZIP archive to a file.
@param zf
ZIP file.
@param name
entry name.
@param file
target file to be created or overwritten.
@return <code>true</code> if the entry was found and unpacked,
<code>false</code> if the entry was not found. | [
"Unpacks",
"a",
"single",
"file",
"from",
"a",
"ZIP",
"archive",
"to",
"a",
"file",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L368-L375 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/labeled/textfield/LabeledDateTimeFieldPanel.java | LabeledDateTimeFieldPanel.newDateTimeField | protected DateTimeField newDateTimeField(final String id, final IModel<M> model) {
"""
Factory method for create the new {@link DateTimeField}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a new {@link DateTimeField}.
@param... | java | protected DateTimeField newDateTimeField(final String id, final IModel<M> model)
{
final IModel<Date> textFieldModel = new PropertyModel<>(model.getObject(), getId());
return ComponentFactory.newDateTimeField(id, textFieldModel);
} | [
"protected",
"DateTimeField",
"newDateTimeField",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"M",
">",
"model",
")",
"{",
"final",
"IModel",
"<",
"Date",
">",
"textFieldModel",
"=",
"new",
"PropertyModel",
"<>",
"(",
"model",
".",
"getObject"... | Factory method for create the new {@link DateTimeField}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a new {@link DateTimeField}.
@param id
the id
@param model
the model
@return the new {@link DateTimeField} | [
"Factory",
"method",
"for",
"create",
"the",
"new",
"{",
"@link",
"DateTimeField",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide"... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/labeled/textfield/LabeledDateTimeFieldPanel.java#L93-L97 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java | InternalService.createConversation | public Observable<ComapiResult<ConversationDetails>> createConversation(@NonNull final ConversationCreate request) {
"""
Returns observable to create a conversation.
@param request Request with conversation details to create.
@return Observable to to create a conversation.
"""
final String token =... | java | public Observable<ComapiResult<ConversationDetails>> createConversation(@NonNull final ConversationCreate request) {
final String token = getToken();
if (sessionController.isCreatingSession()) {
return getTaskQueue().queueCreateConversation(request);
} else if (TextUtils.isEmpty(to... | [
"public",
"Observable",
"<",
"ComapiResult",
"<",
"ConversationDetails",
">",
">",
"createConversation",
"(",
"@",
"NonNull",
"final",
"ConversationCreate",
"request",
")",
"{",
"final",
"String",
"token",
"=",
"getToken",
"(",
")",
";",
"if",
"(",
"sessionContr... | Returns observable to create a conversation.
@param request Request with conversation details to create.
@return Observable to to create a conversation. | [
"Returns",
"observable",
"to",
"create",
"a",
"conversation",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L414-L425 |
pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperServiceRunner.java | BookKeeperServiceRunner.resumeZooKeeper | public void resumeZooKeeper() throws Exception {
"""
Resumes ZooKeeper (if it had previously been suspended).
@throws Exception If an exception got thrown.
"""
val zk = new ZooKeeperServiceRunner(this.zkPort, this.secureZK, this.tLSKeyStore, this.tLSKeyStorePasswordPath, this.tlsTrustStore);
... | java | public void resumeZooKeeper() throws Exception {
val zk = new ZooKeeperServiceRunner(this.zkPort, this.secureZK, this.tLSKeyStore, this.tLSKeyStorePasswordPath, this.tlsTrustStore);
if (this.zkServer.compareAndSet(null, zk)) {
// Initialize ZK runner (since nobody else did it for us).
... | [
"public",
"void",
"resumeZooKeeper",
"(",
")",
"throws",
"Exception",
"{",
"val",
"zk",
"=",
"new",
"ZooKeeperServiceRunner",
"(",
"this",
".",
"zkPort",
",",
"this",
".",
"secureZK",
",",
"this",
".",
"tLSKeyStore",
",",
"this",
".",
"tLSKeyStorePasswordPath"... | Resumes ZooKeeper (if it had previously been suspended).
@throws Exception If an exception got thrown. | [
"Resumes",
"ZooKeeper",
"(",
"if",
"it",
"had",
"previously",
"been",
"suspended",
")",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperServiceRunner.java#L143-L156 |
jbundle/webapp | base/src/main/java/org/jbundle/util/webapp/base/BaseWebappServlet.java | BaseWebappServlet.copyStream | public static void copyStream(Reader inStream, Writer outStream, boolean ignoreErrors) {
"""
Copy the input stream to the output stream
@param inStream
@param outStream
@param ignoreErrors
"""
char[] data = new char[BUFFER];
int count;
try {
while((count = inStream.read(d... | java | public static void copyStream(Reader inStream, Writer outStream, boolean ignoreErrors)
{
char[] data = new char[BUFFER];
int count;
try {
while((count = inStream.read(data, 0, BUFFER)) != -1)
{
outStream.write(data, 0, count);
}
} c... | [
"public",
"static",
"void",
"copyStream",
"(",
"Reader",
"inStream",
",",
"Writer",
"outStream",
",",
"boolean",
"ignoreErrors",
")",
"{",
"char",
"[",
"]",
"data",
"=",
"new",
"char",
"[",
"BUFFER",
"]",
";",
"int",
"count",
";",
"try",
"{",
"while",
... | Copy the input stream to the output stream
@param inStream
@param outStream
@param ignoreErrors | [
"Copy",
"the",
"input",
"stream",
"to",
"the",
"output",
"stream"
] | train | https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/BaseWebappServlet.java#L165-L178 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractInput.java | AbstractInput.showIndicatorsForComponent | protected void showIndicatorsForComponent(final List<Diagnostic> diags, final int severity) {
"""
Iterates over the {@link Diagnostic}s and finds the diagnostics that related to the current component.
@param diags A List of Diagnostic objects.
@param severity A Diagnostic severity code. e.g. {@link Diagnostic#... | java | protected void showIndicatorsForComponent(final List<Diagnostic> diags, final int severity) {
InputModel model = getOrCreateComponentModel();
if (severity == Diagnostic.ERROR) {
model.errorDiagnostics.clear();
} else {
model.warningDiagnostics.clear();
}
UIContext uic = UIContextHolder.getCurrent();
f... | [
"protected",
"void",
"showIndicatorsForComponent",
"(",
"final",
"List",
"<",
"Diagnostic",
">",
"diags",
",",
"final",
"int",
"severity",
")",
"{",
"InputModel",
"model",
"=",
"getOrCreateComponentModel",
"(",
")",
";",
"if",
"(",
"severity",
"==",
"Diagnostic"... | Iterates over the {@link Diagnostic}s and finds the diagnostics that related to the current component.
@param diags A List of Diagnostic objects.
@param severity A Diagnostic severity code. e.g. {@link Diagnostic#ERROR} | [
"Iterates",
"over",
"the",
"{",
"@link",
"Diagnostic",
"}",
"s",
"and",
"finds",
"the",
"diagnostics",
"that",
"related",
"to",
"the",
"current",
"component",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractInput.java#L431-L450 |
stephanrauh/AngularFaces | AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/core/transformation/PuiAngularTransformer.java | PuiAngularTransformer.addResourceAfterAngularJS | public static void addResourceAfterAngularJS(String library, String resource) {
"""
Registers a JS file that needs to be include in the header of the HTML
file, but after jQuery and AngularJS.
@param library
The name of the sub-folder of the resources folder.
@param resource
The name of the resource file wi... | java | public static void addResourceAfterAngularJS(String library, String resource) {
FacesContext ctx = FacesContext.getCurrentInstance();
UIViewRoot v = ctx.getViewRoot();
Map<String, Object> viewMap = v.getViewMap();
@SuppressWarnings("unchecked")
Map<String, String> resourceMap = (Map<String, String>) viewMap.g... | [
"public",
"static",
"void",
"addResourceAfterAngularJS",
"(",
"String",
"library",
",",
"String",
"resource",
")",
"{",
"FacesContext",
"ctx",
"=",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
";",
"UIViewRoot",
"v",
"=",
"ctx",
".",
"getViewRoot",
"(",
... | Registers a JS file that needs to be include in the header of the HTML
file, but after jQuery and AngularJS.
@param library
The name of the sub-folder of the resources folder.
@param resource
The name of the resource file within the library folder. | [
"Registers",
"a",
"JS",
"file",
"that",
"needs",
"to",
"be",
"include",
"in",
"the",
"header",
"of",
"the",
"HTML",
"file",
"but",
"after",
"jQuery",
"and",
"AngularJS",
"."
] | train | https://github.com/stephanrauh/AngularFaces/blob/43d915f004645b1bbbf2625214294dab0858ba01/AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/core/transformation/PuiAngularTransformer.java#L328-L342 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MeanVariance.java | MeanVariance.put | @Override
public void put(double val, double weight) {
"""
Add data with a given weight.
@param val data
@param weight weight
"""
if(weight == 0.) {
return;
}
if(n <= 0) {
n = weight;
sum = val * weight;
return;
}
val *= weight;
final double tmp = n * val -... | java | @Override
public void put(double val, double weight) {
if(weight == 0.) {
return;
}
if(n <= 0) {
n = weight;
sum = val * weight;
return;
}
val *= weight;
final double tmp = n * val - sum * weight;
final double oldn = n; // tmp copy
n += weight;
sum += val;
... | [
"@",
"Override",
"public",
"void",
"put",
"(",
"double",
"val",
",",
"double",
"weight",
")",
"{",
"if",
"(",
"weight",
"==",
"0.",
")",
"{",
"return",
";",
"}",
"if",
"(",
"n",
"<=",
"0",
")",
"{",
"n",
"=",
"weight",
";",
"sum",
"=",
"val",
... | Add data with a given weight.
@param val data
@param weight weight | [
"Add",
"data",
"with",
"a",
"given",
"weight",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MeanVariance.java#L136-L152 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_restoreSnapshot_POST | public OvhTask serviceName_restoreSnapshot_POST(String serviceName, net.minidev.ovh.api.hosting.web.backup.OvhTypeEnum backup) throws IOException {
"""
Restore this snapshot ALL CURRENT DATA WILL BE REPLACED BY YOUR SNAPSHOT
REST: POST /hosting/web/{serviceName}/restoreSnapshot
@param backup [required] The bac... | java | public OvhTask serviceName_restoreSnapshot_POST(String serviceName, net.minidev.ovh.api.hosting.web.backup.OvhTypeEnum backup) throws IOException {
String qPath = "/hosting/web/{serviceName}/restoreSnapshot";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
... | [
"public",
"OvhTask",
"serviceName_restoreSnapshot_POST",
"(",
"String",
"serviceName",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"hosting",
".",
"web",
".",
"backup",
".",
"OvhTypeEnum",
"backup",
")",
"throws",
"IOException",
"{",
"String",
"qP... | Restore this snapshot ALL CURRENT DATA WILL BE REPLACED BY YOUR SNAPSHOT
REST: POST /hosting/web/{serviceName}/restoreSnapshot
@param backup [required] The backup you want to restore
@param serviceName [required] The internal name of your hosting | [
"Restore",
"this",
"snapshot",
"ALL",
"CURRENT",
"DATA",
"WILL",
"BE",
"REPLACED",
"BY",
"YOUR",
"SNAPSHOT"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1066-L1073 |
mikepenz/Materialize | library/src/main/java/com/mikepenz/materialize/holder/ColorHolder.java | ColorHolder.applyToOrTransparent | public static void applyToOrTransparent(ColorHolder colorHolder, Context ctx, GradientDrawable gradientDrawable) {
"""
a small static helper to set the color to a GradientDrawable null save
@param colorHolder
@param ctx
@param gradientDrawable
"""
if (colorHolder != null && gradientDrawable != nul... | java | public static void applyToOrTransparent(ColorHolder colorHolder, Context ctx, GradientDrawable gradientDrawable) {
if (colorHolder != null && gradientDrawable != null) {
colorHolder.applyTo(ctx, gradientDrawable);
} else if (gradientDrawable != null) {
gradientDrawable.setColor(C... | [
"public",
"static",
"void",
"applyToOrTransparent",
"(",
"ColorHolder",
"colorHolder",
",",
"Context",
"ctx",
",",
"GradientDrawable",
"gradientDrawable",
")",
"{",
"if",
"(",
"colorHolder",
"!=",
"null",
"&&",
"gradientDrawable",
"!=",
"null",
")",
"{",
"colorHol... | a small static helper to set the color to a GradientDrawable null save
@param colorHolder
@param ctx
@param gradientDrawable | [
"a",
"small",
"static",
"helper",
"to",
"set",
"the",
"color",
"to",
"a",
"GradientDrawable",
"null",
"save"
] | train | https://github.com/mikepenz/Materialize/blob/2612c10c7570191a78d57f23620e945d61370e3d/library/src/main/java/com/mikepenz/materialize/holder/ColorHolder.java#L184-L190 |
hellosign/hellosign-java-sdk | src/main/java/com/hellosign/sdk/resource/Event.java | Event.isValid | public boolean isValid(String apiKey) throws HelloSignException {
"""
Returns true if the event hash matches the computed hash using the
provided API key.
@param apiKey String api key.
@return true if the hashes match, false otherwise
@throws HelloSignException thrown if there is a problem parsing the API
k... | java | public boolean isValid(String apiKey) throws HelloSignException {
if (apiKey == null || apiKey == "") {
return false;
}
try {
Mac sha256HMAC = Mac.getInstance(HASH_ALGORITHM);
SecretKeySpec secretKey = new SecretKeySpec(apiKey.getBytes(), HASH_ALGORITHM);
... | [
"public",
"boolean",
"isValid",
"(",
"String",
"apiKey",
")",
"throws",
"HelloSignException",
"{",
"if",
"(",
"apiKey",
"==",
"null",
"||",
"apiKey",
"==",
"\"\"",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"Mac",
"sha256HMAC",
"=",
"Mac",
".",
... | Returns true if the event hash matches the computed hash using the
provided API key.
@param apiKey String api key.
@return true if the hashes match, false otherwise
@throws HelloSignException thrown if there is a problem parsing the API
key. | [
"Returns",
"true",
"if",
"the",
"event",
"hash",
"matches",
"the",
"computed",
"hash",
"using",
"the",
"provided",
"API",
"key",
"."
] | train | https://github.com/hellosign/hellosign-java-sdk/blob/08fa7aeb3b0c68ddb6c7ea797d114d55d36d36b1/src/main/java/com/hellosign/sdk/resource/Event.java#L317-L336 |
apereo/cas | support/cas-server-support-aws/src/main/java/org/apereo/cas/aws/AmazonEnvironmentAwareClientBuilder.java | AmazonEnvironmentAwareClientBuilder.getSetting | public String getSetting(final String key, final String defaultValue) {
"""
Gets setting.
@param key the key
@param defaultValue the default value
@return the setting
"""
val result = environment.getProperty(this.propertyPrefix + '.' + key);
return StringUtils.defaultIfBlank(resul... | java | public String getSetting(final String key, final String defaultValue) {
val result = environment.getProperty(this.propertyPrefix + '.' + key);
return StringUtils.defaultIfBlank(result, defaultValue);
} | [
"public",
"String",
"getSetting",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"defaultValue",
")",
"{",
"val",
"result",
"=",
"environment",
".",
"getProperty",
"(",
"this",
".",
"propertyPrefix",
"+",
"'",
"'",
"+",
"key",
")",
";",
"return",
... | Gets setting.
@param key the key
@param defaultValue the default value
@return the setting | [
"Gets",
"setting",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-aws/src/main/java/org/apereo/cas/aws/AmazonEnvironmentAwareClientBuilder.java#L43-L46 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/tx/concurrency/LockTable.java | LockTable.sixLock | void sixLock(Object obj, long txNum) {
"""
Grants an sixlock on the specified item. If any conflict lock exists when
the method is called, then the calling thread will be placed on a wait
list until the lock is released. If the thread remains on the wait list
for a certain amount of time, then an exception is t... | java | void sixLock(Object obj, long txNum) {
Object anchor = getAnchor(obj);
txWaitMap.put(txNum, anchor);
synchronized (anchor) {
Lockers lks = prepareLockers(obj);
if (hasSixLock(lks, txNum))
return;
try {
long timestamp = System.currentTimeMillis();
while (!sixLockable(lks, txNum) &... | [
"void",
"sixLock",
"(",
"Object",
"obj",
",",
"long",
"txNum",
")",
"{",
"Object",
"anchor",
"=",
"getAnchor",
"(",
"obj",
")",
";",
"txWaitMap",
".",
"put",
"(",
"txNum",
",",
"anchor",
")",
";",
"synchronized",
"(",
"anchor",
")",
"{",
"Lockers",
"... | Grants an sixlock on the specified item. If any conflict lock exists when
the method is called, then the calling thread will be placed on a wait
list until the lock is released. If the thread remains on the wait list
for a certain amount of time, then an exception is thrown.
@param obj
a lockable item
@param txNum
a t... | [
"Grants",
"an",
"sixlock",
"on",
"the",
"specified",
"item",
".",
"If",
"any",
"conflict",
"lock",
"exists",
"when",
"the",
"method",
"is",
"called",
"then",
"the",
"calling",
"thread",
"will",
"be",
"placed",
"on",
"a",
"wait",
"list",
"until",
"the",
"... | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/tx/concurrency/LockTable.java#L268-L295 |
notnoop/java-apns | src/main/java/com/notnoop/apns/internal/SSLContextBuilder.java | SSLContextBuilder.getKeyStoreWithSingleKey | private KeyStore getKeyStoreWithSingleKey(KeyStore keyStore, String keyStorePassword, String keyAlias)
throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException {
"""
/*
Workaround for keystores containing multiple keys. Java will take the first k... | java | private KeyStore getKeyStoreWithSingleKey(KeyStore keyStore, String keyStorePassword, String keyAlias)
throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException {
KeyStore singleKeyKeyStore = KeyStore.getInstance(keyStore.getType(), keyStore.get... | [
"private",
"KeyStore",
"getKeyStoreWithSingleKey",
"(",
"KeyStore",
"keyStore",
",",
"String",
"keyStorePassword",
",",
"String",
"keyAlias",
")",
"throws",
"KeyStoreException",
",",
"IOException",
",",
"NoSuchAlgorithmException",
",",
"CertificateException",
",",
"Unreco... | /*
Workaround for keystores containing multiple keys. Java will take the first key that matches
and this way we can still offer configuration for a keystore with multiple keys and a selection
based on alias. Also much easier than making a subclass of a KeyManagerFactory | [
"/",
"*",
"Workaround",
"for",
"keystores",
"containing",
"multiple",
"keys",
".",
"Java",
"will",
"take",
"the",
"first",
"key",
"that",
"matches",
"and",
"this",
"way",
"we",
"can",
"still",
"offer",
"configuration",
"for",
"a",
"keystore",
"with",
"multip... | train | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/internal/SSLContextBuilder.java#L151-L160 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/NotificationDto.java | NotificationDto.transformToDto | public static NotificationDto transformToDto(Notification notification) {
"""
Converts notification entity object to notificationDto object.
@param notification notification entity. Cannot be null.
@return notificationDto.
@throws WebApplicationException If an error occurs.
"""
if (notif... | java | public static NotificationDto transformToDto(Notification notification) {
if (notification == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
NotificationDto result = createDtoObject(NotificationDto.... | [
"public",
"static",
"NotificationDto",
"transformToDto",
"(",
"Notification",
"notification",
")",
"{",
"if",
"(",
"notification",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto object.\"",
",",
"St... | Converts notification entity object to notificationDto object.
@param notification notification entity. Cannot be null.
@return notificationDto.
@throws WebApplicationException If an error occurs. | [
"Converts",
"notification",
"entity",
"object",
"to",
"notificationDto",
"object",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/NotificationDto.java#L78-L90 |
codescape/bitvunit | bitvunit-core/src/main/java/de/codescape/bitvunit/util/html/HtmlPageUtil.java | HtmlPageUtil.toHtmlPage | public static HtmlPage toHtmlPage(URL url) {
"""
Creates a {@link HtmlPage} from a given {@link URL} that points to the HTML code for that page.
@param url {@link URL} that points to the HTML code
@return {@link HtmlPage} for this {@link URL}
"""
try {
return (HtmlPage) new WebClient().... | java | public static HtmlPage toHtmlPage(URL url) {
try {
return (HtmlPage) new WebClient().getPage(url);
} catch (IOException e) {
throw new RuntimeException("Error creating HtmlPage from URL.", e);
}
} | [
"public",
"static",
"HtmlPage",
"toHtmlPage",
"(",
"URL",
"url",
")",
"{",
"try",
"{",
"return",
"(",
"HtmlPage",
")",
"new",
"WebClient",
"(",
")",
".",
"getPage",
"(",
"url",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new"... | Creates a {@link HtmlPage} from a given {@link URL} that points to the HTML code for that page.
@param url {@link URL} that points to the HTML code
@return {@link HtmlPage} for this {@link URL} | [
"Creates",
"a",
"{",
"@link",
"HtmlPage",
"}",
"from",
"a",
"given",
"{",
"@link",
"URL",
"}",
"that",
"points",
"to",
"the",
"HTML",
"code",
"for",
"that",
"page",
"."
] | train | https://github.com/codescape/bitvunit/blob/cef6d9af60d684e41294981c10b6d92c8f063a4e/bitvunit-core/src/main/java/de/codescape/bitvunit/util/html/HtmlPageUtil.java#L75-L81 |
adamfisk/littleshoot-util | src/main/java/org/littleshoot/util/JmxUtils.java | JmxUtils.getObjectName | public static <T> ObjectName getObjectName(final Class<T> clazz) {
"""
Returns an {@link ObjectName} for the specified object in standard
format, using the package as the domain.
@param <T> The type of class.
@param clazz The {@link Class} to create an {@link ObjectName} for.
@return The new {@link ObjectNam... | java | public static <T> ObjectName getObjectName(final Class<T> clazz)
{
final String domain = clazz.getPackage().getName();
final String className = clazz.getSimpleName();
final String objectName = domain+":type="+className;
LOG.debug("Returning object name: {}", objectName);
... | [
"public",
"static",
"<",
"T",
">",
"ObjectName",
"getObjectName",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"final",
"String",
"domain",
"=",
"clazz",
".",
"getPackage",
"(",
")",
".",
"getName",
"(",
")",
";",
"final",
"String",
"classN... | Returns an {@link ObjectName} for the specified object in standard
format, using the package as the domain.
@param <T> The type of class.
@param clazz The {@link Class} to create an {@link ObjectName} for.
@return The new {@link ObjectName}. | [
"Returns",
"an",
"{",
"@link",
"ObjectName",
"}",
"for",
"the",
"specified",
"object",
"in",
"standard",
"format",
"using",
"the",
"package",
"as",
"the",
"domain",
"."
] | train | https://github.com/adamfisk/littleshoot-util/blob/3c0dc4955116b3382d6b0575d2f164b7508a4f73/src/main/java/org/littleshoot/util/JmxUtils.java#L34-L50 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/dbinfo/DatabaseInformationFull.java | DatabaseInformationFull.COLLATIONS | Table COLLATIONS() {
"""
COLLATIONS<p>
<b>Function<b><p>
The COLLATIONS view has one row for each character collation
descriptor. <p>
<b>Definition</b>
<pre class="SqlCodeExample">
CREATE TABLE COLLATIONS (
COLLATION_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER,
COLLATION_SCHEMA INFORMATION_SCHEMA.SQL... | java | Table COLLATIONS() {
Table t = sysTables[COLLATIONS];
if (t == null) {
t = createBlankTable(sysTableHsqlNames[COLLATIONS]);
addColumn(t, "COLLATION_CATALOG", SQL_IDENTIFIER);
addColumn(t, "COLLATION_SCHEMA", SQL_IDENTIFIER); // not null
addColumn(t, ... | [
"Table",
"COLLATIONS",
"(",
")",
"{",
"Table",
"t",
"=",
"sysTables",
"[",
"COLLATIONS",
"]",
";",
"if",
"(",
"t",
"==",
"null",
")",
"{",
"t",
"=",
"createBlankTable",
"(",
"sysTableHsqlNames",
"[",
"COLLATIONS",
"]",
")",
";",
"addColumn",
"(",
"t",
... | COLLATIONS<p>
<b>Function<b><p>
The COLLATIONS view has one row for each character collation
descriptor. <p>
<b>Definition</b>
<pre class="SqlCodeExample">
CREATE TABLE COLLATIONS (
COLLATION_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER,
COLLATION_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER,
COLLATION_NAME INFORMATION_SC... | [
"COLLATIONS<p",
">"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/dbinfo/DatabaseInformationFull.java#L1882-L1937 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsDialogCopyLanguage.java | CmsDialogCopyLanguage.transferContents | protected void transferContents(CmsXmlContent content, Locale sourceLocale, List<Locale> destLocales)
throws CmsException {
"""
Copies the contents from a source locale to a number of destination locales by overwriting them.<p>
@param content the xml content
@param sourceLocale the source locale
@param de... | java | protected void transferContents(CmsXmlContent content, Locale sourceLocale, List<Locale> destLocales)
throws CmsException {
for (Iterator<Locale> i = destLocales.iterator(); i.hasNext();) {
Locale to = i.next();
if (content.hasLocale(to)) {
content.removeLocale(to);
... | [
"protected",
"void",
"transferContents",
"(",
"CmsXmlContent",
"content",
",",
"Locale",
"sourceLocale",
",",
"List",
"<",
"Locale",
">",
"destLocales",
")",
"throws",
"CmsException",
"{",
"for",
"(",
"Iterator",
"<",
"Locale",
">",
"i",
"=",
"destLocales",
".... | Copies the contents from a source locale to a number of destination locales by overwriting them.<p>
@param content the xml content
@param sourceLocale the source locale
@param destLocales a list of destination locales
@throws CmsException if something goes wrong | [
"Copies",
"the",
"contents",
"from",
"a",
"source",
"locale",
"to",
"a",
"number",
"of",
"destination",
"locales",
"by",
"overwriting",
"them",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsDialogCopyLanguage.java#L331-L341 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java | KMLGeometry.toKMLPolygon | public static void toKMLPolygon(Polygon polygon, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb) {
"""
A Polygon is defined by an outer boundary and 0 or more inner boundaries.
The boundaries, in turn, are defined by LinearRings.
Syntax :
<Polygon id="ID">
<!-- specific to Polygon -->
<extrud... | java | public static void toKMLPolygon(Polygon polygon, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb) {
sb.append("<Polygon>");
appendExtrude(extrude, sb);
appendAltitudeMode(altitudeModeEnum, sb);
sb.append("<outerBoundaryIs>");
toKMLLinearRing(polygon.getExteriorRing(),... | [
"public",
"static",
"void",
"toKMLPolygon",
"(",
"Polygon",
"polygon",
",",
"ExtrudeMode",
"extrude",
",",
"int",
"altitudeModeEnum",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"<Polygon>\"",
")",
";",
"appendExtrude",
"(",
"extrude",
",... | A Polygon is defined by an outer boundary and 0 or more inner boundaries.
The boundaries, in turn, are defined by LinearRings.
Syntax :
<Polygon id="ID">
<!-- specific to Polygon -->
<extrude>0</extrude> <!-- boolean -->
<tessellate>0</tessellate> <!-- boolean -->
<altitudeMode>clampToGround</altitudeMode>
<!-- kml:a... | [
"A",
"Polygon",
"is",
"defined",
"by",
"an",
"outer",
"boundary",
"and",
"0",
"or",
"more",
"inner",
"boundaries",
".",
"The",
"boundaries",
"in",
"turn",
"are",
"defined",
"by",
"LinearRings",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java#L230-L243 |
infinispan/infinispan | extended-statistics/src/main/java/org/infinispan/stats/CacheStatisticManager.java | CacheStatisticManager.markAsWriteTransaction | public final void markAsWriteTransaction(GlobalTransaction globalTransaction, boolean local) {
"""
Marks the transaction as a write transaction (instead of a read only transaction)
@param local {@code true} if it is a local transaction.
"""
TransactionStatistics txs = getTransactionStatistic(globalTra... | java | public final void markAsWriteTransaction(GlobalTransaction globalTransaction, boolean local) {
TransactionStatistics txs = getTransactionStatistic(globalTransaction, local);
if (txs == null) {
log.markUnexistingTransactionAsWriteTransaction(globalTransaction == null ? "null" : globalTransaction.glo... | [
"public",
"final",
"void",
"markAsWriteTransaction",
"(",
"GlobalTransaction",
"globalTransaction",
",",
"boolean",
"local",
")",
"{",
"TransactionStatistics",
"txs",
"=",
"getTransactionStatistic",
"(",
"globalTransaction",
",",
"local",
")",
";",
"if",
"(",
"txs",
... | Marks the transaction as a write transaction (instead of a read only transaction)
@param local {@code true} if it is a local transaction. | [
"Marks",
"the",
"transaction",
"as",
"a",
"write",
"transaction",
"(",
"instead",
"of",
"a",
"read",
"only",
"transaction",
")"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/extended-statistics/src/main/java/org/infinispan/stats/CacheStatisticManager.java#L156-L163 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/BeanPath.java | BeanPath.createArray | protected <A, E> ArrayPath<A, E> createArray(String property, Class<? super A> type) {
"""
Create a new array path
@param <A>
@param property property name
@param type property type
@return property path
"""
return add(new ArrayPath<A, E>(type, forProperty(property)));
} | java | protected <A, E> ArrayPath<A, E> createArray(String property, Class<? super A> type) {
return add(new ArrayPath<A, E>(type, forProperty(property)));
} | [
"protected",
"<",
"A",
",",
"E",
">",
"ArrayPath",
"<",
"A",
",",
"E",
">",
"createArray",
"(",
"String",
"property",
",",
"Class",
"<",
"?",
"super",
"A",
">",
"type",
")",
"{",
"return",
"add",
"(",
"new",
"ArrayPath",
"<",
"A",
",",
"E",
">",
... | Create a new array path
@param <A>
@param property property name
@param type property type
@return property path | [
"Create",
"a",
"new",
"array",
"path"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/BeanPath.java#L127-L129 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/URI.java | URI.initializeScheme | private void initializeScheme(String p_uriSpec) throws MalformedURIException {
"""
Initialize the scheme for this URI from a URI string spec.
@param p_uriSpec the URI specification (cannot be null)
@throws MalformedURIException if URI does not have a conformant
scheme
"""
int uriSpecLen = p_uriSpec... | java | private void initializeScheme(String p_uriSpec) throws MalformedURIException
{
int uriSpecLen = p_uriSpec.length();
int index = 0;
String scheme = null;
char testChar = '\0';
while (index < uriSpecLen)
{
testChar = p_uriSpec.charAt(index);
if (testChar == ':' || testChar == '/' ... | [
"private",
"void",
"initializeScheme",
"(",
"String",
"p_uriSpec",
")",
"throws",
"MalformedURIException",
"{",
"int",
"uriSpecLen",
"=",
"p_uriSpec",
".",
"length",
"(",
")",
";",
"int",
"index",
"=",
"0",
";",
"String",
"scheme",
"=",
"null",
";",
"char",
... | Initialize the scheme for this URI from a URI string spec.
@param p_uriSpec the URI specification (cannot be null)
@throws MalformedURIException if URI does not have a conformant
scheme | [
"Initialize",
"the",
"scheme",
"for",
"this",
"URI",
"from",
"a",
"URI",
"string",
"spec",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/URI.java#L600-L631 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/ClassReader.java | ClassReader.complete | private void complete(Symbol sym) throws CompletionFailure {
"""
Completion for classes to be loaded. Before a class is loaded
we make sure its enclosing class (if any) is loaded.
"""
if (sym.kind == TYP) {
ClassSymbol c = (ClassSymbol)sym;
c.members_field = new Scope.ErrorScop... | java | private void complete(Symbol sym) throws CompletionFailure {
if (sym.kind == TYP) {
ClassSymbol c = (ClassSymbol)sym;
c.members_field = new Scope.ErrorScope(c); // make sure it's always defined
annotate.enterStart();
try {
completeOwners(c.owner);
... | [
"private",
"void",
"complete",
"(",
"Symbol",
"sym",
")",
"throws",
"CompletionFailure",
"{",
"if",
"(",
"sym",
".",
"kind",
"==",
"TYP",
")",
"{",
"ClassSymbol",
"c",
"=",
"(",
"ClassSymbol",
")",
"sym",
";",
"c",
".",
"members_field",
"=",
"new",
"Sc... | Completion for classes to be loaded. Before a class is loaded
we make sure its enclosing class (if any) is loaded. | [
"Completion",
"for",
"classes",
"to",
"be",
"loaded",
".",
"Before",
"a",
"class",
"is",
"loaded",
"we",
"make",
"sure",
"its",
"enclosing",
"class",
"(",
"if",
"any",
")",
"is",
"loaded",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L2442-L2466 |
networknt/light-4j | client/src/main/java/com/networknt/client/oauth/OauthHelper.java | OauthHelper.adjustNoChunkedEncoding | public static void adjustNoChunkedEncoding(ClientRequest request, String requestBody) {
"""
this method is to support sending a server which doesn't support chunked transfer encoding.
"""
String fixedLengthString = request.getRequestHeaders().getFirst(Headers.CONTENT_LENGTH);
String transferEnc... | java | public static void adjustNoChunkedEncoding(ClientRequest request, String requestBody) {
String fixedLengthString = request.getRequestHeaders().getFirst(Headers.CONTENT_LENGTH);
String transferEncodingString = request.getRequestHeaders().getLast(Headers.TRANSFER_ENCODING);
if(transferEncodingStri... | [
"public",
"static",
"void",
"adjustNoChunkedEncoding",
"(",
"ClientRequest",
"request",
",",
"String",
"requestBody",
")",
"{",
"String",
"fixedLengthString",
"=",
"request",
".",
"getRequestHeaders",
"(",
")",
".",
"getFirst",
"(",
"Headers",
".",
"CONTENT_LENGTH",... | this method is to support sending a server which doesn't support chunked transfer encoding. | [
"this",
"method",
"is",
"to",
"support",
"sending",
"a",
"server",
"which",
"doesn",
"t",
"support",
"chunked",
"transfer",
"encoding",
"."
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/oauth/OauthHelper.java#L736-L751 |
alkacon/opencms-core | src/org/opencms/search/CmsSearchIndex.java | CmsSearchIndex.isSortScoring | protected boolean isSortScoring(IndexSearcher searcher, Sort sort) {
"""
Checks if the score for the results must be calculated based on the provided sort option.<p>
Since Lucene 3 apparently the score is no longer calculated by default, but only if the
searcher is explicitly told so. This methods checks if, b... | java | protected boolean isSortScoring(IndexSearcher searcher, Sort sort) {
boolean doScoring = false;
if (sort != null) {
if ((sort == CmsSearchParameters.SORT_DEFAULT) || (sort == CmsSearchParameters.SORT_TITLE)) {
// these default sorts do need score calculation
... | [
"protected",
"boolean",
"isSortScoring",
"(",
"IndexSearcher",
"searcher",
",",
"Sort",
"sort",
")",
"{",
"boolean",
"doScoring",
"=",
"false",
";",
"if",
"(",
"sort",
"!=",
"null",
")",
"{",
"if",
"(",
"(",
"sort",
"==",
"CmsSearchParameters",
".",
"SORT_... | Checks if the score for the results must be calculated based on the provided sort option.<p>
Since Lucene 3 apparently the score is no longer calculated by default, but only if the
searcher is explicitly told so. This methods checks if, based on the given sort,
the score must be calculated.<p>
@param searcher the ind... | [
"Checks",
"if",
"the",
"score",
"for",
"the",
"results",
"must",
"be",
"calculated",
"based",
"on",
"the",
"provided",
"sort",
"option",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchIndex.java#L1922-L1945 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/AbstractNumberBindTransform.java | AbstractNumberBindTransform.generateParseOnJackson | @Override
public void generateParseOnJackson(BindTypeContext context, Builder methodBuilder, String parserName, TypeName beanClass, String beanName, BindProperty property) {
"""
/* (non-Javadoc)
@see com.abubusoft.kripton.processor.bind.transform.BindTransform#generateParseOnJackson(com.abubusoft.kripton.process... | java | @Override
public void generateParseOnJackson(BindTypeContext context, Builder methodBuilder, String parserName, TypeName beanClass, String beanName, BindProperty property) {
if (property.isNullable()) {
methodBuilder.beginControlFlow("if ($L.currentToken()!=$T.VALUE_NULL)", parserName, JsonToken.class);
}
if... | [
"@",
"Override",
"public",
"void",
"generateParseOnJackson",
"(",
"BindTypeContext",
"context",
",",
"Builder",
"methodBuilder",
",",
"String",
"parserName",
",",
"TypeName",
"beanClass",
",",
"String",
"beanName",
",",
"BindProperty",
"property",
")",
"{",
"if",
... | /* (non-Javadoc)
@see com.abubusoft.kripton.processor.bind.transform.BindTransform#generateParseOnJackson(com.abubusoft.kripton.processor.bind.BindTypeContext, com.squareup.javapoet.MethodSpec.Builder, java.lang.String, com.squareup.javapoet.TypeName, java.lang.String, com.abubusoft.kripton.processor.bind.model.BindPro... | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/AbstractNumberBindTransform.java#L63-L80 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuDeviceGetPCIBusId | public static int cuDeviceGetPCIBusId(String pciBusId[], int len, CUdevice dev) {
"""
Returns a PCI Bus Id string for the device.
<pre>
CUresult cuDeviceGetPCIBusId (
char* pciBusId,
int len,
CUdevice dev )
</pre>
<div>
<p>Returns a PCI Bus Id string for the
device. Returns an ASCII string identifying... | java | public static int cuDeviceGetPCIBusId(String pciBusId[], int len, CUdevice dev)
{
return checkResult(cuDeviceGetPCIBusIdNative(pciBusId, len, dev));
} | [
"public",
"static",
"int",
"cuDeviceGetPCIBusId",
"(",
"String",
"pciBusId",
"[",
"]",
",",
"int",
"len",
",",
"CUdevice",
"dev",
")",
"{",
"return",
"checkResult",
"(",
"cuDeviceGetPCIBusIdNative",
"(",
"pciBusId",
",",
"len",
",",
"dev",
")",
")",
";",
"... | Returns a PCI Bus Id string for the device.
<pre>
CUresult cuDeviceGetPCIBusId (
char* pciBusId,
int len,
CUdevice dev )
</pre>
<div>
<p>Returns a PCI Bus Id string for the
device. Returns an ASCII string identifying the device <tt>dev</tt>
in the NULL-terminated string pointed to by <tt>pciBusId</tt>. <tt>len</tt> ... | [
"Returns",
"a",
"PCI",
"Bus",
"Id",
"string",
"for",
"the",
"device",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L3373-L3376 |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | MapCore/src/main/java/org/wwarn/mapcore/client/utils/XMLUtils.java | XMLUtils.nodeWalker | public static void nodeWalker(NodeList childNodes, NodeElementParser parser) throws ParseException {
"""
nodeWalker walker implementation, simple depth first recursive implementation
@param childNodes take a node list to iterate
@param parser an observer which parses a node element
@throws ParseException
""... | java | public static void nodeWalker(NodeList childNodes, NodeElementParser parser) throws ParseException {
for (int i = 0; i < childNodes.getLength(); i++) {
Node item = childNodes.item(i);
String node = item.getNodeName();
if(item.getNodeType() == Node.ELEMENT_NODE){
... | [
"public",
"static",
"void",
"nodeWalker",
"(",
"NodeList",
"childNodes",
",",
"NodeElementParser",
"parser",
")",
"throws",
"ParseException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"childNodes",
".",
"getLength",
"(",
")",
";",
"i",
"++",
... | nodeWalker walker implementation, simple depth first recursive implementation
@param childNodes take a node list to iterate
@param parser an observer which parses a node element
@throws ParseException | [
"nodeWalker",
"walker",
"implementation",
"simple",
"depth",
"first",
"recursive",
"implementation"
] | train | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/MapCore/src/main/java/org/wwarn/mapcore/client/utils/XMLUtils.java#L56-L65 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseBufferType | private void parseBufferType(Map<Object, Object> props) {
"""
Check the input configuration for the type of ByteBuffer to use, direct
or indirect.
@param props
"""
Object value = props.get(HttpConfigConstants.PROPNAME_DIRECT_BUFF);
if (null != value) {
this.bDirectBuffers = conv... | java | private void parseBufferType(Map<Object, Object> props) {
Object value = props.get(HttpConfigConstants.PROPNAME_DIRECT_BUFF);
if (null != value) {
this.bDirectBuffers = convertBoolean(value);
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.ev... | [
"private",
"void",
"parseBufferType",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"Object",
"value",
"=",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNAME_DIRECT_BUFF",
")",
";",
"if",
"(",
"null",
"!=",
"value",
")",
... | Check the input configuration for the type of ByteBuffer to use, direct
or indirect.
@param props | [
"Check",
"the",
"input",
"configuration",
"for",
"the",
"type",
"of",
"ByteBuffer",
"to",
"use",
"direct",
"or",
"indirect",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L550-L558 |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/tree/JTreeExtensions.java | JTreeExtensions.expandAll | public static void expandAll(JTree tree, TreePath path, boolean expand) {
"""
Expand all nodes recursive
@param tree
the tree
@param path
the path
@param expand
the flag to expand or collapse
"""
TreeNode node = (TreeNode)path.getLastPathComponent();
if (node.getChildCount() >= 0)
{
Enumerati... | java | public static void expandAll(JTree tree, TreePath path, boolean expand)
{
TreeNode node = (TreeNode)path.getLastPathComponent();
if (node.getChildCount() >= 0)
{
Enumeration<?> enumeration = node.children();
while (enumeration.hasMoreElements())
{
TreeNode n = (TreeNode)enumeration.nextElement();
... | [
"public",
"static",
"void",
"expandAll",
"(",
"JTree",
"tree",
",",
"TreePath",
"path",
",",
"boolean",
"expand",
")",
"{",
"TreeNode",
"node",
"=",
"(",
"TreeNode",
")",
"path",
".",
"getLastPathComponent",
"(",
")",
";",
"if",
"(",
"node",
".",
"getChi... | Expand all nodes recursive
@param tree
the tree
@param path
the path
@param expand
the flag to expand or collapse | [
"Expand",
"all",
"nodes",
"recursive"
] | train | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/tree/JTreeExtensions.java#L51-L75 |
facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/HarIndex.java | HarIndex.getHarIndex | public static HarIndex getHarIndex(FileSystem fs, Path initializer)
throws IOException {
"""
Creates a HarIndex object with the path to either the HAR
or a part file in the HAR.
"""
if (!initializer.getName().endsWith(HAR)) {
initializer = initializer.getParent();
}
InputStream in = nu... | java | public static HarIndex getHarIndex(FileSystem fs, Path initializer)
throws IOException {
if (!initializer.getName().endsWith(HAR)) {
initializer = initializer.getParent();
}
InputStream in = null;
try {
Path indexFile = new Path(initializer, INDEX);
FileStatus indexStat = fs.getF... | [
"public",
"static",
"HarIndex",
"getHarIndex",
"(",
"FileSystem",
"fs",
",",
"Path",
"initializer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"initializer",
".",
"getName",
"(",
")",
".",
"endsWith",
"(",
"HAR",
")",
")",
"{",
"initializer",
"=",
... | Creates a HarIndex object with the path to either the HAR
or a part file in the HAR. | [
"Creates",
"a",
"HarIndex",
"object",
"with",
"the",
"path",
"to",
"either",
"the",
"HAR",
"or",
"a",
"part",
"file",
"in",
"the",
"HAR",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/HarIndex.java#L77-L95 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/file/tfile/TFile.java | TFile.main | public static void main(String[] args) {
"""
Dumping the TFile information.
@param args
A list of TFile paths.
"""
System.out.printf("TFile Dumper (TFile %s, BCFile %s)\n", TFile.API_VERSION
.toString(), BCFile.API_VERSION.toString());
if (args.length == 0) {
System.out
.pri... | java | public static void main(String[] args) {
System.out.printf("TFile Dumper (TFile %s, BCFile %s)\n", TFile.API_VERSION
.toString(), BCFile.API_VERSION.toString());
if (args.length == 0) {
System.out
.println("Usage: java ... org.apache.hadoop.io.file.tfile.TFile tfile-path [tfile-path ...]... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"System",
".",
"out",
".",
"printf",
"(",
"\"TFile Dumper (TFile %s, BCFile %s)\\n\"",
",",
"TFile",
".",
"API_VERSION",
".",
"toString",
"(",
")",
",",
"BCFile",
".",
"API_VERSIO... | Dumping the TFile information.
@param args
A list of TFile paths. | [
"Dumping",
"the",
"TFile",
"information",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/file/tfile/TFile.java#L2335-L2353 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/json/JSONSerializer.java | JSONSerializer.jsonValToJSONString | static void jsonValToJSONString(final Object jsonVal,
final Map<ReferenceEqualityKey<JSONReference>, CharSequence> jsonReferenceToId,
final boolean includeNullValuedFields, final int depth, final int indentWidth,
final StringBuilder buf) {
"""
Serialize a JSON object, array, or ... | java | static void jsonValToJSONString(final Object jsonVal,
final Map<ReferenceEqualityKey<JSONReference>, CharSequence> jsonReferenceToId,
final boolean includeNullValuedFields, final int depth, final int indentWidth,
final StringBuilder buf) {
if (jsonVal == null) {
... | [
"static",
"void",
"jsonValToJSONString",
"(",
"final",
"Object",
"jsonVal",
",",
"final",
"Map",
"<",
"ReferenceEqualityKey",
"<",
"JSONReference",
">",
",",
"CharSequence",
">",
"jsonReferenceToId",
",",
"final",
"boolean",
"includeNullValuedFields",
",",
"final",
... | Serialize a JSON object, array, or value.
@param jsonVal
the json val
@param jsonReferenceToId
a map from json reference to id
@param includeNullValuedFields
the include null valued fields
@param depth
the depth
@param indentWidth
the indent width
@param buf
the buf | [
"Serialize",
"a",
"JSON",
"object",
"array",
"or",
"value",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/JSONSerializer.java#L417-L452 |
actorapp/actor-platform | actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/collections/SparseBooleanArray.java | SparseBooleanArray.append | public void append(int key, boolean value) {
"""
Puts a key/value pair into the array, optimizing for the case where
the key is greater than all existing keys in the array.
"""
if (mSize != 0 && key <= mKeys[mSize - 1]) {
put(key, value);
return;
}
mKeys = Growi... | java | public void append(int key, boolean value) {
if (mSize != 0 && key <= mKeys[mSize - 1]) {
put(key, value);
return;
}
mKeys = GrowingArrayUtils.append(mKeys, mSize, key);
mValues = GrowingArrayUtils.append(mValues, mSize, value);
mSize++;
} | [
"public",
"void",
"append",
"(",
"int",
"key",
",",
"boolean",
"value",
")",
"{",
"if",
"(",
"mSize",
"!=",
"0",
"&&",
"key",
"<=",
"mKeys",
"[",
"mSize",
"-",
"1",
"]",
")",
"{",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
";",
"}",
... | Puts a key/value pair into the array, optimizing for the case where
the key is greater than all existing keys in the array. | [
"Puts",
"a",
"key",
"/",
"value",
"pair",
"into",
"the",
"array",
"optimizing",
"for",
"the",
"case",
"where",
"the",
"key",
"is",
"greater",
"than",
"all",
"existing",
"keys",
"in",
"the",
"array",
"."
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/collections/SparseBooleanArray.java#L212-L220 |
square/okhttp | okhttp/src/main/java/okhttp3/internal/http/HttpHeaders.java | HttpHeaders.skipUntil | public static int skipUntil(String input, int pos, String characters) {
"""
Returns the next index in {@code input} at or after {@code pos} that contains a character from
{@code characters}. Returns the input length if none of the requested characters can be found.
"""
for (; pos < input.length(); pos++) ... | java | public static int skipUntil(String input, int pos, String characters) {
for (; pos < input.length(); pos++) {
if (characters.indexOf(input.charAt(pos)) != -1) {
break;
}
}
return pos;
} | [
"public",
"static",
"int",
"skipUntil",
"(",
"String",
"input",
",",
"int",
"pos",
",",
"String",
"characters",
")",
"{",
"for",
"(",
";",
"pos",
"<",
"input",
".",
"length",
"(",
")",
";",
"pos",
"++",
")",
"{",
"if",
"(",
"characters",
".",
"inde... | Returns the next index in {@code input} at or after {@code pos} that contains a character from
{@code characters}. Returns the input length if none of the requested characters can be found. | [
"Returns",
"the",
"next",
"index",
"in",
"{"
] | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/okhttp/src/main/java/okhttp3/internal/http/HttpHeaders.java#L360-L367 |
crawljax/crawljax | core/src/main/java/com/crawljax/oraclecomparator/comparators/EditDistanceComparator.java | EditDistanceComparator.getThreshold | double getThreshold(String x, String y, double p) {
"""
Calculate a threshold.
@param x first string.
@param y second string.
@param p the threshold coefficient.
@return 2 maxLength(x, y) (1-p)
"""
return 2 * Math.max(x.length(), y.length()) * (1 - p);
} | java | double getThreshold(String x, String y, double p) {
return 2 * Math.max(x.length(), y.length()) * (1 - p);
} | [
"double",
"getThreshold",
"(",
"String",
"x",
",",
"String",
"y",
",",
"double",
"p",
")",
"{",
"return",
"2",
"*",
"Math",
".",
"max",
"(",
"x",
".",
"length",
"(",
")",
",",
"y",
".",
"length",
"(",
")",
")",
"*",
"(",
"1",
"-",
"p",
")",
... | Calculate a threshold.
@param x first string.
@param y second string.
@param p the threshold coefficient.
@return 2 maxLength(x, y) (1-p) | [
"Calculate",
"a",
"threshold",
"."
] | train | https://github.com/crawljax/crawljax/blob/d339f4f622ca902ccd35322065821e52a62ec543/core/src/main/java/com/crawljax/oraclecomparator/comparators/EditDistanceComparator.java#L73-L75 |
netty/netty | codec/src/main/java/io/netty/handler/codec/json/JsonObjectDecoder.java | JsonObjectDecoder.extractObject | @SuppressWarnings("UnusedParameters")
protected ByteBuf extractObject(ChannelHandlerContext ctx, ByteBuf buffer, int index, int length) {
"""
Override this method if you want to filter the json objects/arrays that get passed through the pipeline.
"""
return buffer.retainedSlice(index, length);
... | java | @SuppressWarnings("UnusedParameters")
protected ByteBuf extractObject(ChannelHandlerContext ctx, ByteBuf buffer, int index, int length) {
return buffer.retainedSlice(index, length);
} | [
"@",
"SuppressWarnings",
"(",
"\"UnusedParameters\"",
")",
"protected",
"ByteBuf",
"extractObject",
"(",
"ChannelHandlerContext",
"ctx",
",",
"ByteBuf",
"buffer",
",",
"int",
"index",
",",
"int",
"length",
")",
"{",
"return",
"buffer",
".",
"retainedSlice",
"(",
... | Override this method if you want to filter the json objects/arrays that get passed through the pipeline. | [
"Override",
"this",
"method",
"if",
"you",
"want",
"to",
"filter",
"the",
"json",
"objects",
"/",
"arrays",
"that",
"get",
"passed",
"through",
"the",
"pipeline",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/json/JsonObjectDecoder.java#L190-L193 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/plugins/ZipResourceLoader.java | ZipResourceLoader.extractResources | public void extractResources() throws IOException {
"""
Extract resources return the extracted files
@return the collection of extracted files
"""
if (!cacheDir.isDirectory()) {
if (!cacheDir.mkdirs()) {
//debug("Failed to create cachedJar dir for dependent resources: " +... | java | public void extractResources() throws IOException {
if (!cacheDir.isDirectory()) {
if (!cacheDir.mkdirs()) {
//debug("Failed to create cachedJar dir for dependent resources: " + cachedir);
}
}
if (null != resourcesList) {
//debug("jar manifest ... | [
"public",
"void",
"extractResources",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"cacheDir",
".",
"isDirectory",
"(",
")",
")",
"{",
"if",
"(",
"!",
"cacheDir",
".",
"mkdirs",
"(",
")",
")",
"{",
"//debug(\"Failed to create cachedJar dir for depen... | Extract resources return the extracted files
@return the collection of extracted files | [
"Extract",
"resources",
"return",
"the",
"extracted",
"files"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/plugins/ZipResourceLoader.java#L123-L141 |
to2mbn/JMCCC | jmccc/src/main/java/org/to2mbn/jmccc/internal/org/json/JSONArray.java | JSONArray.optBigInteger | public BigInteger optBigInteger(int index, BigInteger defaultValue) {
"""
Get the optional BigInteger value associated with an index. The
defaultValue is returned if there is no value for the index, or if the
value is not a number and cannot be converted to a number.
@param index The index must be between 0 a... | java | public BigInteger optBigInteger(int index, BigInteger defaultValue) {
try {
return this.getBigInteger(index);
} catch (Exception e) {
return defaultValue;
}
} | [
"public",
"BigInteger",
"optBigInteger",
"(",
"int",
"index",
",",
"BigInteger",
"defaultValue",
")",
"{",
"try",
"{",
"return",
"this",
".",
"getBigInteger",
"(",
"index",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"defaultValue",
... | Get the optional BigInteger value associated with an index. The
defaultValue is returned if there is no value for the index, or if the
value is not a number and cannot be converted to a number.
@param index The index must be between 0 and length() - 1.
@param defaultValue The default value.
@return The value. | [
"Get",
"the",
"optional",
"BigInteger",
"value",
"associated",
"with",
"an",
"index",
".",
"The",
"defaultValue",
"is",
"returned",
"if",
"there",
"is",
"no",
"value",
"for",
"the",
"index",
"or",
"if",
"the",
"value",
"is",
"not",
"a",
"number",
"and",
... | train | https://github.com/to2mbn/JMCCC/blob/17e5b1b56ff18255cfd60976dca1a24598946647/jmccc/src/main/java/org/to2mbn/jmccc/internal/org/json/JSONArray.java#L575-L581 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.makeNewArray | Item makeNewArray(DiagnosticPosition pos, Type type, int ndims) {
"""
Generate code to create an array with given element type and number
of dimensions.
"""
Type elemtype = types.elemtype(type);
if (types.dimensions(type) > ClassFile.MAX_DIMENSIONS) {
log.error(pos, "li... | java | Item makeNewArray(DiagnosticPosition pos, Type type, int ndims) {
Type elemtype = types.elemtype(type);
if (types.dimensions(type) > ClassFile.MAX_DIMENSIONS) {
log.error(pos, "limit.dimensions");
nerrs++;
}
int elemcode = Code.arraycode(el... | [
"Item",
"makeNewArray",
"(",
"DiagnosticPosition",
"pos",
",",
"Type",
"type",
",",
"int",
"ndims",
")",
"{",
"Type",
"elemtype",
"=",
"types",
".",
"elemtype",
"(",
"type",
")",
";",
"if",
"(",
"types",
".",
"dimensions",
"(",
"type",
")",
">",
"Class... | Generate code to create an array with given element type and number
of dimensions. | [
"Generate",
"code",
"to",
"create",
"an",
"array",
"with",
"given",
"element",
"type",
"and",
"number",
"of",
"dimensions",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java#L1760-L1775 |
apache/incubator-gobblin | gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigsResource.java | FlowConfigsResource.get | @Override
public FlowConfig get(ComplexResourceKey<FlowId, EmptyRecord> key) {
"""
Retrieve the flow configuration with the given key
@param key flow config id key containing group name and flow name
@return {@link FlowConfig} with flow configuration
"""
String flowGroup = key.getKey().getFlowGroup();
... | java | @Override
public FlowConfig get(ComplexResourceKey<FlowId, EmptyRecord> key) {
String flowGroup = key.getKey().getFlowGroup();
String flowName = key.getKey().getFlowName();
FlowId flowId = new FlowId().setFlowGroup(flowGroup).setFlowName(flowName);
return this.flowConfigsResourceHandler.getFlowConfig(... | [
"@",
"Override",
"public",
"FlowConfig",
"get",
"(",
"ComplexResourceKey",
"<",
"FlowId",
",",
"EmptyRecord",
">",
"key",
")",
"{",
"String",
"flowGroup",
"=",
"key",
".",
"getKey",
"(",
")",
".",
"getFlowGroup",
"(",
")",
";",
"String",
"flowName",
"=",
... | Retrieve the flow configuration with the given key
@param key flow config id key containing group name and flow name
@return {@link FlowConfig} with flow configuration | [
"Retrieve",
"the",
"flow",
"configuration",
"with",
"the",
"given",
"key"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigsResource.java#L76-L82 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/feature/Feature.java | Feature.setUrlAttribute | public void setUrlAttribute(String name, String value) {
"""
Set attribute value of given type.
@param name attribute name
@param value attribute value
"""
Attribute attribute = getAttributes().get(name);
if (!(attribute instanceof UrlAttribute)) {
throw new IllegalStateException("Cannot set url val... | java | public void setUrlAttribute(String name, String value) {
Attribute attribute = getAttributes().get(name);
if (!(attribute instanceof UrlAttribute)) {
throw new IllegalStateException("Cannot set url value on attribute with different type, " +
attribute.getClass().getName() + " setting value " + value);
}
... | [
"public",
"void",
"setUrlAttribute",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"Attribute",
"attribute",
"=",
"getAttributes",
"(",
")",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"!",
"(",
"attribute",
"instanceof",
"UrlAttribute",
")",
... | Set attribute value of given type.
@param name attribute name
@param value attribute value | [
"Set",
"attribute",
"value",
"of",
"given",
"type",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/feature/Feature.java#L365-L372 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/convert/MergeConverter.java | MergeConverter.setupDefaultView | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert convert, int iDisplayFieldDesc, Map<String, Object> properties) {
"""
Set up the default control for this field.
Adds the default screen control for the current converter, and makes me it's converter.
@param its... | java | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert convert, int iDisplayFieldDesc, Map<String, Object> properties)
{
ScreenComponent sField = null;
Converter converter = this.getNextConverter();
if (converter != null)
sField = con... | [
"public",
"ScreenComponent",
"setupDefaultView",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"convert",
",",
"int",
"iDisplayFieldDesc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"ScreenCompon... | Set up the default control for this field.
Adds the default screen control for the current converter, and makes me it's converter.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param targetScreen Where to place this component (ie., Parent screen or GridBagLayout).
@param i... | [
"Set",
"up",
"the",
"default",
"control",
"for",
"this",
"field",
".",
"Adds",
"the",
"default",
"screen",
"control",
"for",
"the",
"current",
"converter",
"and",
"makes",
"me",
"it",
"s",
"converter",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/convert/MergeConverter.java#L179-L193 |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.defineField | private static void defineField(Map<String, FieldType> container, String name, FieldType type, String alias) {
"""
Configure the mapping between a database column and a field, including definition of
an alias.
@param container column to field map
@param name column name
@param type field type
@param alias f... | java | private static void defineField(Map<String, FieldType> container, String name, FieldType type, String alias)
{
container.put(name, type);
if (alias != null)
{
ALIASES.put(type, alias);
}
} | [
"private",
"static",
"void",
"defineField",
"(",
"Map",
"<",
"String",
",",
"FieldType",
">",
"container",
",",
"String",
"name",
",",
"FieldType",
"type",
",",
"String",
"alias",
")",
"{",
"container",
".",
"put",
"(",
"name",
",",
"type",
")",
";",
"... | Configure the mapping between a database column and a field, including definition of
an alias.
@param container column to field map
@param name column name
@param type field type
@param alias field alias | [
"Configure",
"the",
"mapping",
"between",
"a",
"database",
"column",
"and",
"a",
"field",
"including",
"definition",
"of",
"an",
"alias",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L504-L511 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BaseField.java | BaseField.moveSQLToField | public void moveSQLToField(ResultSet resultset, int iColumn) throws SQLException {
"""
Move the physical binary data to this SQL parameter row.
This is overidden to move the physical data type.
@param resultset The resultset to get the SQL data from.
@param iColumn the column in the resultset that has my data.
... | java | public void moveSQLToField(ResultSet resultset, int iColumn) throws SQLException
{
String strResult = resultset.getString(iColumn);
if (resultset.wasNull())
this.setString(Constants.BLANK, false, DBConstants.READ_MOVE); // Null value
else
this.setString(strResult, fa... | [
"public",
"void",
"moveSQLToField",
"(",
"ResultSet",
"resultset",
",",
"int",
"iColumn",
")",
"throws",
"SQLException",
"{",
"String",
"strResult",
"=",
"resultset",
".",
"getString",
"(",
"iColumn",
")",
";",
"if",
"(",
"resultset",
".",
"wasNull",
"(",
")... | Move the physical binary data to this SQL parameter row.
This is overidden to move the physical data type.
@param resultset The resultset to get the SQL data from.
@param iColumn the column in the resultset that has my data.
@exception SQLException From SQL calls. | [
"Move",
"the",
"physical",
"binary",
"data",
"to",
"this",
"SQL",
"parameter",
"row",
".",
"This",
"is",
"overidden",
"to",
"move",
"the",
"physical",
"data",
"type",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L836-L843 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/workplace/broadcast/CmsMessageInfo.java | CmsMessageInfo.createInternetAddresses | private List<InternetAddress> createInternetAddresses(String mailAddresses) throws AddressException {
"""
Creates a list of internet addresses (email) from a semicolon separated String.<p>
@param mailAddresses a semicolon separated String with email addresses
@return list of internet addresses (email)
@throws... | java | private List<InternetAddress> createInternetAddresses(String mailAddresses) throws AddressException {
if (CmsStringUtil.isNotEmpty(mailAddresses)) {
// at least one email address is present, generate list
StringTokenizer T = new StringTokenizer(mailAddresses, ";");
List<Inte... | [
"private",
"List",
"<",
"InternetAddress",
">",
"createInternetAddresses",
"(",
"String",
"mailAddresses",
")",
"throws",
"AddressException",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isNotEmpty",
"(",
"mailAddresses",
")",
")",
"{",
"// at least one email address is prese... | Creates a list of internet addresses (email) from a semicolon separated String.<p>
@param mailAddresses a semicolon separated String with email addresses
@return list of internet addresses (email)
@throws AddressException if an email address is not correct | [
"Creates",
"a",
"list",
"of",
"internet",
"addresses",
"(",
"email",
")",
"from",
"a",
"semicolon",
"separated",
"String",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/workplace/broadcast/CmsMessageInfo.java#L224-L239 |
trellis-ldp/trellis | components/file/src/main/java/org/trellisldp/file/FileUtils.java | FileUtils.uncheckedList | public static Stream<Path> uncheckedList(final Path path) {
"""
Fetch a stream of files in the provided directory path.
@param path the directory path
@return a stream of filenames
"""
try {
return Files.list(path);
} catch (final IOException ex) {
throw new UncheckedI... | java | public static Stream<Path> uncheckedList(final Path path) {
try {
return Files.list(path);
} catch (final IOException ex) {
throw new UncheckedIOException("Error fetching file list", ex);
}
} | [
"public",
"static",
"Stream",
"<",
"Path",
">",
"uncheckedList",
"(",
"final",
"Path",
"path",
")",
"{",
"try",
"{",
"return",
"Files",
".",
"list",
"(",
"path",
")",
";",
"}",
"catch",
"(",
"final",
"IOException",
"ex",
")",
"{",
"throw",
"new",
"Un... | Fetch a stream of files in the provided directory path.
@param path the directory path
@return a stream of filenames | [
"Fetch",
"a",
"stream",
"of",
"files",
"in",
"the",
"provided",
"directory",
"path",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/components/file/src/main/java/org/trellisldp/file/FileUtils.java#L129-L135 |
census-instrumentation/opencensus-java | impl_core/src/main/java/io/opencensus/implcore/internal/VarInt.java | VarInt.putVarInt | public static int putVarInt(int v, byte[] sink, int offset) {
"""
Encodes an integer in a variable-length encoding, 7 bits per byte, into a destination byte[],
following the protocol buffer convention.
@param v the int value to write to sink
@param sink the sink buffer to write to
@param offset the offset wi... | java | public static int putVarInt(int v, byte[] sink, int offset) {
do {
// Encode next 7 bits + terminator bit
int bits = v & 0x7F;
v >>>= 7;
byte b = (byte) (bits + ((v != 0) ? 0x80 : 0));
sink[offset++] = b;
} while (v != 0);
return offset;
} | [
"public",
"static",
"int",
"putVarInt",
"(",
"int",
"v",
",",
"byte",
"[",
"]",
"sink",
",",
"int",
"offset",
")",
"{",
"do",
"{",
"// Encode next 7 bits + terminator bit",
"int",
"bits",
"=",
"v",
"&",
"0x7F",
";",
"v",
">>>=",
"7",
";",
"byte",
"b",
... | Encodes an integer in a variable-length encoding, 7 bits per byte, into a destination byte[],
following the protocol buffer convention.
@param v the int value to write to sink
@param sink the sink buffer to write to
@param offset the offset within sink to begin writing
@return the updated offset after writing the vari... | [
"Encodes",
"an",
"integer",
"in",
"a",
"variable",
"-",
"length",
"encoding",
"7",
"bits",
"per",
"byte",
"into",
"a",
"destination",
"byte",
"[]",
"following",
"the",
"protocol",
"buffer",
"convention",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/impl_core/src/main/java/io/opencensus/implcore/internal/VarInt.java#L88-L97 |
janus-project/guava.janusproject.io | guava/src/com/google/common/collect/AbstractMapBasedMultiset.java | AbstractMapBasedMultiset.add | @Override public int add(@Nullable E element, int occurrences) {
"""
{@inheritDoc}
@throws IllegalArgumentException if the call would result in more than
{@link Integer#MAX_VALUE} occurrences of {@code element} in this
multiset.
"""
if (occurrences == 0) {
return count(element);
}
checkA... | java | @Override public int add(@Nullable E element, int occurrences) {
if (occurrences == 0) {
return count(element);
}
checkArgument(
occurrences > 0, "occurrences cannot be negative: %s", occurrences);
Count frequency = backingMap.get(element);
int oldCount;
if (frequency == null) {
... | [
"@",
"Override",
"public",
"int",
"add",
"(",
"@",
"Nullable",
"E",
"element",
",",
"int",
"occurrences",
")",
"{",
"if",
"(",
"occurrences",
"==",
"0",
")",
"{",
"return",
"count",
"(",
"element",
")",
";",
"}",
"checkArgument",
"(",
"occurrences",
">... | {@inheritDoc}
@throws IllegalArgumentException if the call would result in more than
{@link Integer#MAX_VALUE} occurrences of {@code element} in this
multiset. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/collect/AbstractMapBasedMultiset.java#L214-L234 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.