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 |
|---|---|---|---|---|---|---|---|---|---|---|
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/GroupsApi.java | GroupsApi.listGroupUsers | public UsersResponse listGroupUsers(String accountId, String groupId, GroupsApi.ListGroupUsersOptions options) throws ApiException {
"""
Gets a list of users in a group.
Retrieves a list of users in a group.
@param accountId The external account number (int) or account ID Guid. (required)
@param groupId The ID ... | java | public UsersResponse listGroupUsers(String accountId, String groupId, GroupsApi.ListGroupUsersOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(400, "Missing the required p... | [
"public",
"UsersResponse",
"listGroupUsers",
"(",
"String",
"accountId",
",",
"String",
"groupId",
",",
"GroupsApi",
".",
"ListGroupUsersOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"localVarPostBody",
"=",
"\"{}\"",
";",
"// verify the required pa... | Gets a list of users in a group.
Retrieves a list of users in a group.
@param accountId The external account number (int) or account ID Guid. (required)
@param groupId The ID of the group being accessed. (required)
@param options for modifying the method behavior.
@return UsersResponse
@throws ApiException if fails to ... | [
"Gets",
"a",
"list",
"of",
"users",
"in",
"a",
"group",
".",
"Retrieves",
"a",
"list",
"of",
"users",
"in",
"a",
"group",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/GroupsApi.java#L328-L371 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/compression/GzipInputHandler.java | GzipInputHandler.skipPast | private int skipPast(byte[] data, int pos, byte target) {
"""
Skip until it runs out of input data or finds the target byte.
@param data
@param pos
@param target
@return pos
"""
int index = pos;
while (index < data.length) {
if (target == data[index++]) {
retur... | java | private int skipPast(byte[] data, int pos, byte target) {
int index = pos;
while (index < data.length) {
if (target == data[index++]) {
return index;
}
}
return index;
} | [
"private",
"int",
"skipPast",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"pos",
",",
"byte",
"target",
")",
"{",
"int",
"index",
"=",
"pos",
";",
"while",
"(",
"index",
"<",
"data",
".",
"length",
")",
"{",
"if",
"(",
"target",
"==",
"data",
"[",... | Skip until it runs out of input data or finds the target byte.
@param data
@param pos
@param target
@return pos | [
"Skip",
"until",
"it",
"runs",
"out",
"of",
"input",
"data",
"or",
"finds",
"the",
"target",
"byte",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/compression/GzipInputHandler.java#L166-L174 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java | DiskTypeId.of | public static DiskTypeId of(ZoneId zoneId, String type) {
"""
Returns a disk type identity given the zone identity and the disk type name.
"""
return new DiskTypeId(zoneId.getProject(), zoneId.getZone(), type);
} | java | public static DiskTypeId of(ZoneId zoneId, String type) {
return new DiskTypeId(zoneId.getProject(), zoneId.getZone(), type);
} | [
"public",
"static",
"DiskTypeId",
"of",
"(",
"ZoneId",
"zoneId",
",",
"String",
"type",
")",
"{",
"return",
"new",
"DiskTypeId",
"(",
"zoneId",
".",
"getProject",
"(",
")",
",",
"zoneId",
".",
"getZone",
"(",
")",
",",
"type",
")",
";",
"}"
] | Returns a disk type identity given the zone identity and the disk type name. | [
"Returns",
"a",
"disk",
"type",
"identity",
"given",
"the",
"zone",
"identity",
"and",
"the",
"disk",
"type",
"name",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java#L111-L113 |
httl/httl | httl/src/main/java/httl/spi/codecs/json/JSONArray.java | JSONArray.getDouble | public double getDouble(int index, double def) {
"""
get double value.
@param index index.
@param def default value.
@return value or default value.
"""
Object tmp = mArray.get(index);
return tmp != null && tmp instanceof Number ? ((Number) tmp)
.doubleValue() : def;
... | java | public double getDouble(int index, double def) {
Object tmp = mArray.get(index);
return tmp != null && tmp instanceof Number ? ((Number) tmp)
.doubleValue() : def;
} | [
"public",
"double",
"getDouble",
"(",
"int",
"index",
",",
"double",
"def",
")",
"{",
"Object",
"tmp",
"=",
"mArray",
".",
"get",
"(",
"index",
")",
";",
"return",
"tmp",
"!=",
"null",
"&&",
"tmp",
"instanceof",
"Number",
"?",
"(",
"(",
"Number",
")"... | get double value.
@param index index.
@param def default value.
@return value or default value. | [
"get",
"double",
"value",
"."
] | train | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/spi/codecs/json/JSONArray.java#L101-L105 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java | StringIterate.anySatisfy | @Deprecated
public static boolean anySatisfy(String string, CodePointPredicate predicate) {
"""
@return true if any of the code points in the {@code string} answer true for the specified {@code predicate}.
@deprecated since 7.0. Use {@link #anySatisfyCodePoint(String, CodePointPredicate)} instead.
"""
... | java | @Deprecated
public static boolean anySatisfy(String string, CodePointPredicate predicate)
{
return StringIterate.anySatisfyCodePoint(string, predicate);
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"anySatisfy",
"(",
"String",
"string",
",",
"CodePointPredicate",
"predicate",
")",
"{",
"return",
"StringIterate",
".",
"anySatisfyCodePoint",
"(",
"string",
",",
"predicate",
")",
";",
"}"
] | @return true if any of the code points in the {@code string} answer true for the specified {@code predicate}.
@deprecated since 7.0. Use {@link #anySatisfyCodePoint(String, CodePointPredicate)} instead. | [
"@return",
"true",
"if",
"any",
"of",
"the",
"code",
"points",
"in",
"the",
"{",
"@code",
"string",
"}",
"answer",
"true",
"for",
"the",
"specified",
"{",
"@code",
"predicate",
"}",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L819-L823 |
alkacon/opencms-core | src/org/opencms/ui/login/CmsPasswordForm.java | CmsPasswordForm.setErrorPassword2 | public void setErrorPassword2(UserError error, String style) {
"""
Sets the password 2 error.<p>
@param error the error
@param style the style class
"""
m_passwordField2.setComponentError(error);
m_password2Style.setStyle(style);
} | java | public void setErrorPassword2(UserError error, String style) {
m_passwordField2.setComponentError(error);
m_password2Style.setStyle(style);
} | [
"public",
"void",
"setErrorPassword2",
"(",
"UserError",
"error",
",",
"String",
"style",
")",
"{",
"m_passwordField2",
".",
"setComponentError",
"(",
"error",
")",
";",
"m_password2Style",
".",
"setStyle",
"(",
"style",
")",
";",
"}"
] | Sets the password 2 error.<p>
@param error the error
@param style the style class | [
"Sets",
"the",
"password",
"2",
"error",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/login/CmsPasswordForm.java#L230-L234 |
paymill/paymill-java | src/main/java/com/paymill/services/TransactionService.java | TransactionService.createWithPaymentAndClient | public Transaction createWithPaymentAndClient( String paymentId, String clientId, Integer amount, String currency ) {
"""
Executes a {@link Transaction} with {@link Payment} for the given amount in the given currency.
@param paymentId
The Id of a PAYMILL {@link Payment} representing credit card or direct debit.
... | java | public Transaction createWithPaymentAndClient( String paymentId, String clientId, Integer amount, String currency ) {
return this.createWithPaymentAndClient( paymentId, clientId, amount, currency, null );
} | [
"public",
"Transaction",
"createWithPaymentAndClient",
"(",
"String",
"paymentId",
",",
"String",
"clientId",
",",
"Integer",
"amount",
",",
"String",
"currency",
")",
"{",
"return",
"this",
".",
"createWithPaymentAndClient",
"(",
"paymentId",
",",
"clientId",
",",
... | Executes a {@link Transaction} with {@link Payment} for the given amount in the given currency.
@param paymentId
The Id of a PAYMILL {@link Payment} representing credit card or direct debit.
@param clientId
The Id of a PAYMILL {@link Client} which have to be charged.
@param amount
Amount (in cents) which will be charge... | [
"Executes",
"a",
"{"
] | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/TransactionService.java#L274-L276 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java | OsLoginServiceClient.updateSshPublicKey | public final SshPublicKey updateSshPublicKey(FingerprintName name, SshPublicKey sshPublicKey) {
"""
Updates an SSH public key and returns the profile information. This method supports patch
semantics.
<p>Sample code:
<pre><code>
try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()... | java | public final SshPublicKey updateSshPublicKey(FingerprintName name, SshPublicKey sshPublicKey) {
UpdateSshPublicKeyRequest request =
UpdateSshPublicKeyRequest.newBuilder()
.setName(name == null ? null : name.toString())
.setSshPublicKey(sshPublicKey)
.build();
return ... | [
"public",
"final",
"SshPublicKey",
"updateSshPublicKey",
"(",
"FingerprintName",
"name",
",",
"SshPublicKey",
"sshPublicKey",
")",
"{",
"UpdateSshPublicKeyRequest",
"request",
"=",
"UpdateSshPublicKeyRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
... | Updates an SSH public key and returns the profile information. This method supports patch
semantics.
<p>Sample code:
<pre><code>
try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]");
SshPublicKey sshPublicKey = SshPublic... | [
"Updates",
"an",
"SSH",
"public",
"key",
"and",
"returns",
"the",
"profile",
"information",
".",
"This",
"method",
"supports",
"patch",
"semantics",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java#L734-L742 |
ZieIony/Carbon | carbon/src/main/java/carbon/internal/Menu.java | Menu.createNewMenuItem | private MenuItem createNewMenuItem(int group, int id, int categoryOrder, int ordering,
CharSequence title, int defaultShowAsAction) {
"""
Layoutlib overrides this method to return its custom implementation of MenuItem
"""
return new MenuItem(group, id, categoryOrd... | java | private MenuItem createNewMenuItem(int group, int id, int categoryOrder, int ordering,
CharSequence title, int defaultShowAsAction) {
return new MenuItem(group, id, categoryOrder, title);
} | [
"private",
"MenuItem",
"createNewMenuItem",
"(",
"int",
"group",
",",
"int",
"id",
",",
"int",
"categoryOrder",
",",
"int",
"ordering",
",",
"CharSequence",
"title",
",",
"int",
"defaultShowAsAction",
")",
"{",
"return",
"new",
"MenuItem",
"(",
"group",
",",
... | Layoutlib overrides this method to return its custom implementation of MenuItem | [
"Layoutlib",
"overrides",
"this",
"method",
"to",
"return",
"its",
"custom",
"implementation",
"of",
"MenuItem"
] | train | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/internal/Menu.java#L258-L261 |
Clivern/Racter | src/main/java/com/clivern/racter/receivers/webhook/MessageReceivedWebhook.java | MessageReceivedWebhook.setAttachment | public void setAttachment(String type, Long loc_lat, Long loc_long) {
"""
Set Attachment
@param type the attachment type
@param loc_lat the attachment location latitude
@param loc_long the attachment location longitude
"""
attachments.put(type, Long.toString(loc_lat) + "," + Long.toString(loc_long... | java | public void setAttachment(String type, Long loc_lat, Long loc_long)
{
attachments.put(type, Long.toString(loc_lat) + "," + Long.toString(loc_long));
} | [
"public",
"void",
"setAttachment",
"(",
"String",
"type",
",",
"Long",
"loc_lat",
",",
"Long",
"loc_long",
")",
"{",
"attachments",
".",
"put",
"(",
"type",
",",
"Long",
".",
"toString",
"(",
"loc_lat",
")",
"+",
"\",\"",
"+",
"Long",
".",
"toString",
... | Set Attachment
@param type the attachment type
@param loc_lat the attachment location latitude
@param loc_long the attachment location longitude | [
"Set",
"Attachment"
] | train | https://github.com/Clivern/Racter/blob/bbde02f0c2a8a80653ad6b1607376d8408acd71c/src/main/java/com/clivern/racter/receivers/webhook/MessageReceivedWebhook.java#L120-L123 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bos/BosClient.java | BosClient.appendObject | public AppendObjectResponse appendObject(String bucketName, String key, byte[] value) {
"""
Uploads the specified bytes to Bos under the specified bucket and key name.
@param bucketName The name of an existing bucket, to which you have Write permission.
@param key The key under which to store the specified fil... | java | public AppendObjectResponse appendObject(String bucketName, String key, byte[] value) {
return this.appendObject(bucketName, key, value, new ObjectMetadata());
} | [
"public",
"AppendObjectResponse",
"appendObject",
"(",
"String",
"bucketName",
",",
"String",
"key",
",",
"byte",
"[",
"]",
"value",
")",
"{",
"return",
"this",
".",
"appendObject",
"(",
"bucketName",
",",
"key",
",",
"value",
",",
"new",
"ObjectMetadata",
"... | Uploads the specified bytes to Bos under the specified bucket and key name.
@param bucketName The name of an existing bucket, to which you have Write permission.
@param key The key under which to store the specified file.
@param value The bytes containing the value to be uploaded to Bos.
@return An AppendObjectRespons... | [
"Uploads",
"the",
"specified",
"bytes",
"to",
"Bos",
"under",
"the",
"specified",
"bucket",
"and",
"key",
"name",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bos/BosClient.java#L1733-L1735 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/StringUtilities.java | StringUtilities.getOccurenceCount | public static int getOccurenceCount(char c, String s) {
"""
Returns the number of occurences of the given character in the given string.
@param c The character to look for occurrences of
@param s The string to search
@return The number of occurences
"""
int ret = 0;
for(int i = 0; i < s.len... | java | public static int getOccurenceCount(char c, String s)
{
int ret = 0;
for(int i = 0; i < s.length(); i++)
{
if(s.charAt(i) == c)
++ret;
}
return ret;
} | [
"public",
"static",
"int",
"getOccurenceCount",
"(",
"char",
"c",
",",
"String",
"s",
")",
"{",
"int",
"ret",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
... | Returns the number of occurences of the given character in the given string.
@param c The character to look for occurrences of
@param s The string to search
@return The number of occurences | [
"Returns",
"the",
"number",
"of",
"occurences",
"of",
"the",
"given",
"character",
"in",
"the",
"given",
"string",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/StringUtilities.java#L282-L293 |
tvesalainen/util | util/src/main/java/org/vesalainen/bean/BeanHelper.java | BeanHelper.addList | public static final <T> T addList(Object bean, String property, String hint, BiFunction<Class<T>,String,T> factory) {
"""
Adds pattern item to end of list using given factory and hint
@param <T>
@param bean
@param property
@param hint
@param factory
"""
Object fieldValue = getValue(bean, property... | java | public static final <T> T addList(Object bean, String property, String hint, BiFunction<Class<T>,String,T> factory)
{
Object fieldValue = getValue(bean, property);
if (fieldValue instanceof List)
{
List list = (List) fieldValue;
Class[] pt = getParameterTypes(be... | [
"public",
"static",
"final",
"<",
"T",
">",
"T",
"addList",
"(",
"Object",
"bean",
",",
"String",
"property",
",",
"String",
"hint",
",",
"BiFunction",
"<",
"Class",
"<",
"T",
">",
",",
"String",
",",
"T",
">",
"factory",
")",
"{",
"Object",
"fieldVa... | Adds pattern item to end of list using given factory and hint
@param <T>
@param bean
@param property
@param hint
@param factory | [
"Adds",
"pattern",
"item",
"to",
"end",
"of",
"list",
"using",
"given",
"factory",
"and",
"hint"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/bean/BeanHelper.java#L594-L613 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmUtils.java | XsdAsmUtils.generateMethodsAndCreateAttribute | static void generateMethodsAndCreateAttribute(Map<String, List<XsdAttribute>> createdAttributes, ClassWriter classWriter, XsdAttribute elementAttribute, String returnType, String className, String apiName) {
"""
Generates the required methods for adding a given attribute and creates the
respective class, if neede... | java | static void generateMethodsAndCreateAttribute(Map<String, List<XsdAttribute>> createdAttributes, ClassWriter classWriter, XsdAttribute elementAttribute, String returnType, String className, String apiName) {
XsdAsmAttributes.generateMethodsForAttribute(classWriter, elementAttribute, returnType, className,apiNam... | [
"static",
"void",
"generateMethodsAndCreateAttribute",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"XsdAttribute",
">",
">",
"createdAttributes",
",",
"ClassWriter",
"classWriter",
",",
"XsdAttribute",
"elementAttribute",
",",
"String",
"returnType",
",",
"String",
... | Generates the required methods for adding a given attribute and creates the
respective class, if needed.
@param createdAttributes Information about attributes that were already created.
@param classWriter The {@link ClassWriter} to write the methods.
@param elementAttribute The attribute element.
@param returnType The ... | [
"Generates",
"the",
"required",
"methods",
"for",
"adding",
"a",
"given",
"attribute",
"and",
"creates",
"the",
"respective",
"class",
"if",
"needed",
"."
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmUtils.java#L310-L313 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/AttributedString.java | AttributedString.mapsDiffer | private static boolean mapsDiffer(Map last, Map attrs) {
"""
Returns true if the attributes specified in last and attrs differ.
"""
if (last == null) {
return (attrs != null && attrs.size() > 0);
}
return (!last.equals(attrs));
} | java | private static boolean mapsDiffer(Map last, Map attrs) {
if (last == null) {
return (attrs != null && attrs.size() > 0);
}
return (!last.equals(attrs));
} | [
"private",
"static",
"boolean",
"mapsDiffer",
"(",
"Map",
"last",
",",
"Map",
"attrs",
")",
"{",
"if",
"(",
"last",
"==",
"null",
")",
"{",
"return",
"(",
"attrs",
"!=",
"null",
"&&",
"attrs",
".",
"size",
"(",
")",
">",
"0",
")",
";",
"}",
"retu... | Returns true if the attributes specified in last and attrs differ. | [
"Returns",
"true",
"if",
"the",
"attributes",
"specified",
"in",
"last",
"and",
"attrs",
"differ",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/AttributedString.java#L720-L725 |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/utils/CSVDumper.java | CSVDumper.loadSchema | private void loadSchema() {
"""
Connect to the Doradus server and download the requested application's schema.
"""
m_logger.info("Loading schema for application: {}", m_config.app);
m_client = new Client(m_config.host, m_config.port, m_config.getTLSParams());
m_client.setCredentials(... | java | private void loadSchema() {
m_logger.info("Loading schema for application: {}", m_config.app);
m_client = new Client(m_config.host, m_config.port, m_config.getTLSParams());
m_client.setCredentials(m_config.getCredentials());
m_session = m_client.openApplication(m_config.app); // thro... | [
"private",
"void",
"loadSchema",
"(",
")",
"{",
"m_logger",
".",
"info",
"(",
"\"Loading schema for application: {}\"",
",",
"m_config",
".",
"app",
")",
";",
"m_client",
"=",
"new",
"Client",
"(",
"m_config",
".",
"host",
",",
"m_config",
".",
"port",
",",
... | Connect to the Doradus server and download the requested application's schema. | [
"Connect",
"to",
"the",
"Doradus",
"server",
"and",
"download",
"the",
"requested",
"application",
"s",
"schema",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/utils/CSVDumper.java#L247-L256 |
JetBrains/xodus | openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java | EnvironmentConfig.setGcMinUtilization | public EnvironmentConfig setGcMinUtilization(int percent) throws InvalidSettingException {
"""
Sets percent of minimum database utilization. Default value is {@code 50}. That means that 50 percent
of free space in raw data in {@code Log} files (.xd files) is allowed. If database utilization is less than
defined ... | java | public EnvironmentConfig setGcMinUtilization(int percent) throws InvalidSettingException {
if (percent < 1 || percent > 90) {
throw new InvalidSettingException("Invalid minimum log files utilization: " + percent);
}
return setSetting(GC_MIN_UTILIZATION, percent);
} | [
"public",
"EnvironmentConfig",
"setGcMinUtilization",
"(",
"int",
"percent",
")",
"throws",
"InvalidSettingException",
"{",
"if",
"(",
"percent",
"<",
"1",
"||",
"percent",
">",
"90",
")",
"{",
"throw",
"new",
"InvalidSettingException",
"(",
"\"Invalid minimum log f... | Sets percent of minimum database utilization. Default value is {@code 50}. That means that 50 percent
of free space in raw data in {@code Log} files (.xd files) is allowed. If database utilization is less than
defined (free space percent is more than {@code 50}), the database garbage collector is triggered.
<p>Mutable ... | [
"Sets",
"percent",
"of",
"minimum",
"database",
"utilization",
".",
"Default",
"value",
"is",
"{",
"@code",
"50",
"}",
".",
"That",
"means",
"that",
"50",
"percent",
"of",
"free",
"space",
"in",
"raw",
"data",
"in",
"{",
"@code",
"Log",
"}",
"files",
"... | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java#L1851-L1856 |
qspin/qtaste | plugins_src/javagui-fx/src/main/java/com/qspin/qtaste/javaguifx/server/TreeNodeSelector.java | TreeNodeSelector.compareNodeNames | protected boolean compareNodeNames(String nodePathElement, String nodeName) {
"""
Compare a node path element (provided as argument of the selectNode method) to a node name (from a JTree).
@param nodePathElement the node path element to compare with the node name
@param nodeName the node name
@return true if ... | java | protected boolean compareNodeNames(String nodePathElement, String nodeName) {
boolean comparisonResult = false;
switch (mSelectorIdentifier) {
case SELECT_BY_REGEX:
comparisonResult = Pattern.matches(nodePathElement, nodeName);
break;
case SELECT... | [
"protected",
"boolean",
"compareNodeNames",
"(",
"String",
"nodePathElement",
",",
"String",
"nodeName",
")",
"{",
"boolean",
"comparisonResult",
"=",
"false",
";",
"switch",
"(",
"mSelectorIdentifier",
")",
"{",
"case",
"SELECT_BY_REGEX",
":",
"comparisonResult",
"... | Compare a node path element (provided as argument of the selectNode method) to a node name (from a JTree).
@param nodePathElement the node path element to compare with the node name
@param nodeName the node name
@return true if both match, false otherwise. | [
"Compare",
"a",
"node",
"path",
"element",
"(",
"provided",
"as",
"argument",
"of",
"the",
"selectNode",
"method",
")",
"to",
"a",
"node",
"name",
"(",
"from",
"a",
"JTree",
")",
"."
] | train | https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/plugins_src/javagui-fx/src/main/java/com/qspin/qtaste/javaguifx/server/TreeNodeSelector.java#L64-L79 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbooksInner.java | WorkbooksInner.updateAsync | public Observable<WorkbookInner> updateAsync(String resourceGroupName, String resourceName, WorkbookInner workbookProperties) {
"""
Updates a workbook that has already been added.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resourc... | java | public Observable<WorkbookInner> updateAsync(String resourceGroupName, String resourceName, WorkbookInner workbookProperties) {
return updateWithServiceResponseAsync(resourceGroupName, resourceName, workbookProperties).map(new Func1<ServiceResponse<WorkbookInner>, WorkbookInner>() {
@Override
... | [
"public",
"Observable",
"<",
"WorkbookInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"WorkbookInner",
"workbookProperties",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceN... | Updates a workbook that has already been added.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param workbookProperties Properties that need to be specified to create a new workbook.
@throws IllegalArgumentException thrown if param... | [
"Updates",
"a",
"workbook",
"that",
"has",
"already",
"been",
"added",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/WorkbooksInner.java#L578-L585 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.writeLines | public static <T> File writeLines(Collection<T> list, File file, String charset) throws IORuntimeException {
"""
将列表写入文件,覆盖模式
@param <T> 集合元素类型
@param list 列表
@param file 文件
@param charset 字符集
@return 目标文件
@throws IORuntimeException IO异常
@since 4.2.0
"""
return writeLines(list, file, charset, false... | java | public static <T> File writeLines(Collection<T> list, File file, String charset) throws IORuntimeException {
return writeLines(list, file, charset, false);
} | [
"public",
"static",
"<",
"T",
">",
"File",
"writeLines",
"(",
"Collection",
"<",
"T",
">",
"list",
",",
"File",
"file",
",",
"String",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"return",
"writeLines",
"(",
"list",
",",
"file",
",",
"charset",
... | 将列表写入文件,覆盖模式
@param <T> 集合元素类型
@param list 列表
@param file 文件
@param charset 字符集
@return 目标文件
@throws IORuntimeException IO异常
@since 4.2.0 | [
"将列表写入文件,覆盖模式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2910-L2912 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/support/action/Action.java | Action.doAction | private void doAction(List<ActionBlock> actions) throws ActionException {
"""
Subroutine that calls an action block from either performs, backOuts or cleanUps.
@param actions
@throws ActionException
"""
try {
actions.get(nextStep).execute();
} catch (ActionException e) {
... | java | private void doAction(List<ActionBlock> actions) throws ActionException {
try {
actions.get(nextStep).execute();
} catch (ActionException e) {
throw e;
} catch (Exception e) {
throw new ActionException("Exception raised by step: " + nextStep, e);
}
... | [
"private",
"void",
"doAction",
"(",
"List",
"<",
"ActionBlock",
">",
"actions",
")",
"throws",
"ActionException",
"{",
"try",
"{",
"actions",
".",
"get",
"(",
"nextStep",
")",
".",
"execute",
"(",
")",
";",
"}",
"catch",
"(",
"ActionException",
"e",
")",... | Subroutine that calls an action block from either performs, backOuts or cleanUps.
@param actions
@throws ActionException | [
"Subroutine",
"that",
"calls",
"an",
"action",
"block",
"from",
"either",
"performs",
"backOuts",
"or",
"cleanUps",
"."
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/support/action/Action.java#L210-L218 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/FormulaFactory.java | FormulaFactory.addFormulaAnd | private void addFormulaAnd(final LinkedHashSet<Formula> ops, final Formula f) {
"""
Adds a given formula to a list of operands. If the formula is the neutral element for the respective n-ary
operation it will be skipped. If a complementary formula is already present in the list of operands or the
formula is th... | java | private void addFormulaAnd(final LinkedHashSet<Formula> ops, final Formula f) {
if (f.type() == TRUE) {
this.formulaAdditionResult[0] = true;
this.formulaAdditionResult[1] = true;
} else if (f.type == FALSE || containsComplement(ops, f)) {
this.formulaAdditionResult[0] = false;
this.form... | [
"private",
"void",
"addFormulaAnd",
"(",
"final",
"LinkedHashSet",
"<",
"Formula",
">",
"ops",
",",
"final",
"Formula",
"f",
")",
"{",
"if",
"(",
"f",
".",
"type",
"(",
")",
"==",
"TRUE",
")",
"{",
"this",
".",
"formulaAdditionResult",
"[",
"0",
"]",
... | Adds a given formula to a list of operands. If the formula is the neutral element for the respective n-ary
operation it will be skipped. If a complementary formula is already present in the list of operands or the
formula is the dual element, {@code false} is stored as first element of the result array,
otherwise {@c... | [
"Adds",
"a",
"given",
"formula",
"to",
"a",
"list",
"of",
"operands",
".",
"If",
"the",
"formula",
"is",
"the",
"neutral",
"element",
"for",
"the",
"respective",
"n",
"-",
"ary",
"operation",
"it",
"will",
"be",
"skipped",
".",
"If",
"a",
"complementary"... | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/FormulaFactory.java#L977-L989 |
stephenc/java-iso-tools | loop-fs-spi/src/main/java/com/github/stephenc/javaisotools/loopfs/spi/AbstractBlockFileSystem.java | AbstractBlockFileSystem.readBlock | protected final boolean readBlock(final long block, final byte[] buffer) throws IOException {
"""
Read the data for the specified block into the specified buffer.
@return if the block was actually read
@throws IOException if the number of bytes read into the buffer was less than the expected number (i.e. the... | java | protected final boolean readBlock(final long block, final byte[] buffer) throws IOException {
final int bytesRead = readData(block * this.blockSize, buffer, 0, this.blockSize);
if (bytesRead <= 0) {
return false;
}
if (this.blockSize != bytesRead) {
throw new IO... | [
"protected",
"final",
"boolean",
"readBlock",
"(",
"final",
"long",
"block",
",",
"final",
"byte",
"[",
"]",
"buffer",
")",
"throws",
"IOException",
"{",
"final",
"int",
"bytesRead",
"=",
"readData",
"(",
"block",
"*",
"this",
".",
"blockSize",
",",
"buffe... | Read the data for the specified block into the specified buffer.
@return if the block was actually read
@throws IOException if the number of bytes read into the buffer was less than the expected number (i.e. the block
size) | [
"Read",
"the",
"data",
"for",
"the",
"specified",
"block",
"into",
"the",
"specified",
"buffer",
"."
] | train | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/loop-fs-spi/src/main/java/com/github/stephenc/javaisotools/loopfs/spi/AbstractBlockFileSystem.java#L89-L101 |
landawn/AbacusUtil | src/com/landawn/abacus/util/JdbcUtil.java | JdbcUtil.importData | public static <E extends Exception> int importData(final DataSet dataset, final Collection<String> selectColumnNames, final int offset, final int count,
final Try.Predicate<? super Object[], E> filter, final PreparedStatement stmt, final int batchSize, final int batchInterval)
throws Unchecked... | java | public static <E extends Exception> int importData(final DataSet dataset, final Collection<String> selectColumnNames, final int offset, final int count,
final Try.Predicate<? super Object[], E> filter, final PreparedStatement stmt, final int batchSize, final int batchInterval)
throws Unchecked... | [
"public",
"static",
"<",
"E",
"extends",
"Exception",
">",
"int",
"importData",
"(",
"final",
"DataSet",
"dataset",
",",
"final",
"Collection",
"<",
"String",
">",
"selectColumnNames",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"count",
",",
"final"... | Imports the data from <code>DataSet</code> to database.
@param dataset
@param selectColumnNames
@param offset
@param count
@param stmt the column order in the sql must be consistent with the column order in the DataSet.
@param batchSize
@param batchInterval
@return
@throws UncheckedSQLException | [
"Imports",
"the",
"data",
"from",
"<code",
">",
"DataSet<",
"/",
"code",
">",
"to",
"database",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L2238-L2249 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.price_GET | public OvhPrice price_GET(String flavorId, String region) throws IOException {
"""
Get services prices
REST: GET /cloud/price
@param region [required] Region
@param flavorId [required] OVH cloud flavor id
@deprecated
"""
String qPath = "/cloud/price";
StringBuilder sb = path(qPath);
query(sb, "flav... | java | public OvhPrice price_GET(String flavorId, String region) throws IOException {
String qPath = "/cloud/price";
StringBuilder sb = path(qPath);
query(sb, "flavorId", flavorId);
query(sb, "region", region);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPrice.class);
} | [
"public",
"OvhPrice",
"price_GET",
"(",
"String",
"flavorId",
",",
"String",
"region",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/price\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"query",
"(",
"sb",
",",
... | Get services prices
REST: GET /cloud/price
@param region [required] Region
@param flavorId [required] OVH cloud flavor id
@deprecated | [
"Get",
"services",
"prices"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2388-L2395 |
nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/DataSet.java | DataSet.addCharacter | public void addCharacter(int code, int xadvance, int x, int y, int width, int height,int yoffset) {
"""
Add a character to the data set
@param code The character code
@param xadvance The advance on the x axis after writing this character
@param x The x position on the sheet of the character
@param y The y po... | java | public void addCharacter(int code, int xadvance, int x, int y, int width, int height,int yoffset) {
chars.add(new CharData(code, xadvance, x, y, width, height,size + yoffset));
} | [
"public",
"void",
"addCharacter",
"(",
"int",
"code",
",",
"int",
"xadvance",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
",",
"int",
"yoffset",
")",
"{",
"chars",
".",
"add",
"(",
"new",
"CharData",
"(",
"code",
",... | Add a character to the data set
@param code The character code
@param xadvance The advance on the x axis after writing this character
@param x The x position on the sheet of the character
@param y The y position on the sheet of the character
@param width The width of the character on the sheet
@param height The height... | [
"Add",
"a",
"character",
"to",
"the",
"data",
"set"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/DataSet.java#L214-L216 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/channels/Channels.java | Channels.writeFully | private static void writeFully(WritableByteChannel ch, ByteBuffer bb)
throws IOException {
"""
Write all remaining bytes in buffer to the given channel.
@throws IllegalBlockingException
If the channel is selectable and configured non-blocking.
"""
if (ch instanceof SelectableChannel) {
... | java | private static void writeFully(WritableByteChannel ch, ByteBuffer bb)
throws IOException
{
if (ch instanceof SelectableChannel) {
SelectableChannel sc = (SelectableChannel)ch;
synchronized (sc.blockingLock()) {
if (!sc.isBlocking())
throw n... | [
"private",
"static",
"void",
"writeFully",
"(",
"WritableByteChannel",
"ch",
",",
"ByteBuffer",
"bb",
")",
"throws",
"IOException",
"{",
"if",
"(",
"ch",
"instanceof",
"SelectableChannel",
")",
"{",
"SelectableChannel",
"sc",
"=",
"(",
"SelectableChannel",
")",
... | Write all remaining bytes in buffer to the given channel.
@throws IllegalBlockingException
If the channel is selectable and configured non-blocking. | [
"Write",
"all",
"remaining",
"bytes",
"in",
"buffer",
"to",
"the",
"given",
"channel",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/channels/Channels.java#L91-L104 |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/EncodingUtil.java | EncodingUtil.toStream | public static InputStream toStream(String content, Charset charset) {
"""
Converts the string of given content to an input stream.
@param content the string content.
@param charset the charset for conversion.
@return the stream (should be closed by invoker).
"""
byte[] bytes = content.getBytes(cha... | java | public static InputStream toStream(String content, Charset charset) {
byte[] bytes = content.getBytes(charset);
return new ByteArrayInputStream(bytes);
} | [
"public",
"static",
"InputStream",
"toStream",
"(",
"String",
"content",
",",
"Charset",
"charset",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"content",
".",
"getBytes",
"(",
"charset",
")",
";",
"return",
"new",
"ByteArrayInputStream",
"(",
"bytes",
")",
... | Converts the string of given content to an input stream.
@param content the string content.
@param charset the charset for conversion.
@return the stream (should be closed by invoker). | [
"Converts",
"the",
"string",
"of",
"given",
"content",
"to",
"an",
"input",
"stream",
"."
] | train | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/EncodingUtil.java#L33-L36 |
xvik/dropwizard-guicey | src/main/java/ru/vyarus/dropwizard/guice/module/yaml/ConfigurationTree.java | ConfigurationTree.valuesByType | @SuppressWarnings("unchecked")
public <T> List<? extends T> valuesByType(final Class<T> type) {
"""
Useful to resolve sub configuration objects.
<pre>{@code class Config extends Configuration {
SubOne sub1 = ...
SubTwo sub2 = ...
SubTwo sub2_1 = ...
SubTwoExt sub2_2 = ... // SubTwoExt extends SubTwo
}}</... | java | @SuppressWarnings("unchecked")
public <T> List<? extends T> valuesByType(final Class<T> type) {
return (List<? extends T>) findAllByType(type).stream()
.map(ConfigPath::getValue)
.filter(Objects::nonNull)
.collect(Collectors.toList());
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"List",
"<",
"?",
"extends",
"T",
">",
"valuesByType",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"(",
"List",
"<",
"?",
"extends",
"T",
">",
")",
"... | Useful to resolve sub configuration objects.
<pre>{@code class Config extends Configuration {
SubOne sub1 = ...
SubTwo sub2 = ...
SubTwo sub2_1 = ...
SubTwoExt sub2_2 = ... // SubTwoExt extends SubTwo
}}</pre>
{@code valuesByType(SubOne.class) == [<sub1>]}
{@code valuesByType(SubTwo.class) == [<sub2>, <sub2_1>, <sub2_2... | [
"Useful",
"to",
"resolve",
"sub",
"configuration",
"objects",
".",
"<pre",
">",
"{",
"@code",
"class",
"Config",
"extends",
"Configuration",
"{",
"SubOne",
"sub1",
"=",
"...",
"SubTwo",
"sub2",
"=",
"...",
"SubTwo",
"sub2_1",
"=",
"...",
"SubTwoExt",
"sub2_2... | train | https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/yaml/ConfigurationTree.java#L220-L227 |
lucee/Lucee | core/src/main/java/lucee/runtime/cache/CacheUtil.java | CacheUtil.getDefault | public static Cache getDefault(PageContext pc, int type, Cache defaultValue) {
"""
get the default cache for a certain type, also check definitions in application context
(application . cfc/cfapplication)
@param pc current PageContext
@param type default type -> Config.CACHE_DEFAULT_...
@param defaultValue v... | java | public static Cache getDefault(PageContext pc, int type, Cache defaultValue) {
// get default from application conetx
String name = null;
if (pc != null && pc.getApplicationContext() != null) name = pc.getApplicationContext().getDefaultCacheName(type);
Config config = ThreadLocalPageContext.getConfig(pc);
if (!Str... | [
"public",
"static",
"Cache",
"getDefault",
"(",
"PageContext",
"pc",
",",
"int",
"type",
",",
"Cache",
"defaultValue",
")",
"{",
"// get default from application conetx",
"String",
"name",
"=",
"null",
";",
"if",
"(",
"pc",
"!=",
"null",
"&&",
"pc",
".",
"ge... | get the default cache for a certain type, also check definitions in application context
(application . cfc/cfapplication)
@param pc current PageContext
@param type default type -> Config.CACHE_DEFAULT_...
@param defaultValue value returned when there is no default cache for this type
@return matching cache | [
"get",
"the",
"default",
"cache",
"for",
"a",
"certain",
"type",
"also",
"check",
"definitions",
"in",
"application",
"context",
"(",
"application",
".",
"cfc",
"/",
"cfapplication",
")"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/cache/CacheUtil.java#L63-L83 |
mgm-tp/jfunk | jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java | WebDriverTool.processField | public void processField(final By by, final String value) {
"""
Uses the internal {@link FormInputHandler} to set form field. This method does not use a
data set to retrieve the value.
@param by
the {@link By} used to locate the element representing an HTML input or
textarea
@param value
the value to set t... | java | public void processField(final By by, final String value) {
checkTopmostElement(by);
fih.by(by).value(value).perform();
} | [
"public",
"void",
"processField",
"(",
"final",
"By",
"by",
",",
"final",
"String",
"value",
")",
"{",
"checkTopmostElement",
"(",
"by",
")",
";",
"fih",
".",
"by",
"(",
"by",
")",
".",
"value",
"(",
"value",
")",
".",
"perform",
"(",
")",
";",
"}"... | Uses the internal {@link FormInputHandler} to set form field. This method does not use a
data set to retrieve the value.
@param by
the {@link By} used to locate the element representing an HTML input or
textarea
@param value
the value to set the field to | [
"Uses",
"the",
"internal",
"{",
"@link",
"FormInputHandler",
"}",
"to",
"set",
"form",
"field",
".",
"This",
"method",
"does",
"not",
"use",
"a",
"data",
"set",
"to",
"retrieve",
"the",
"value",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java#L667-L670 |
apache/flink | flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java | FileSystem.create | @Deprecated
public FSDataOutputStream create(
Path f,
boolean overwrite,
int bufferSize,
short replication,
long blockSize) throws IOException {
"""
Opens an FSDataOutputStream at the indicated Path.
<p>This method is deprecated, because most of its parameters are ignored by most file systems.
... | java | @Deprecated
public FSDataOutputStream create(
Path f,
boolean overwrite,
int bufferSize,
short replication,
long blockSize) throws IOException {
return create(f, overwrite ? WriteMode.OVERWRITE : WriteMode.NO_OVERWRITE);
} | [
"@",
"Deprecated",
"public",
"FSDataOutputStream",
"create",
"(",
"Path",
"f",
",",
"boolean",
"overwrite",
",",
"int",
"bufferSize",
",",
"short",
"replication",
",",
"long",
"blockSize",
")",
"throws",
"IOException",
"{",
"return",
"create",
"(",
"f",
",",
... | Opens an FSDataOutputStream at the indicated Path.
<p>This method is deprecated, because most of its parameters are ignored by most file systems.
To control for example the replication factor and block size in the Hadoop Distributed File system,
make sure that the respective Hadoop configuration file is either linked ... | [
"Opens",
"an",
"FSDataOutputStream",
"at",
"the",
"indicated",
"Path",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java#L643-L652 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policystringmap_binding.java | policystringmap_binding.get | public static policystringmap_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch policystringmap_binding resource of given name .
"""
policystringmap_binding obj = new policystringmap_binding();
obj.set_name(name);
policystringmap_binding response = (policystring... | java | public static policystringmap_binding get(nitro_service service, String name) throws Exception{
policystringmap_binding obj = new policystringmap_binding();
obj.set_name(name);
policystringmap_binding response = (policystringmap_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"policystringmap_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"policystringmap_binding",
"obj",
"=",
"new",
"policystringmap_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"nam... | Use this API to fetch policystringmap_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"policystringmap_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policystringmap_binding.java#L103-L108 |
dihedron/dihedron-commons | src/main/java/org/dihedron/patterns/activities/TypedVector.java | TypedVector.removeRange | @Override
public void removeRange(int fromIndex, int toIndex) {
"""
Removes from this list all of the elements whose index is between fromIndex,
inclusive, and toIndex, exclusive; both indexes can be negative; for
details see {@link #getRealIndex(int)}.
@param fromIndex
the index to start from, inclusive.
... | java | @Override
public void removeRange(int fromIndex, int toIndex) {
int fromIdx = getRealIndex(fromIndex);
int toIdx = getRealIndex(toIndex);
super.removeRange(fromIdx, toIdx);
} | [
"@",
"Override",
"public",
"void",
"removeRange",
"(",
"int",
"fromIndex",
",",
"int",
"toIndex",
")",
"{",
"int",
"fromIdx",
"=",
"getRealIndex",
"(",
"fromIndex",
")",
";",
"int",
"toIdx",
"=",
"getRealIndex",
"(",
"toIndex",
")",
";",
"super",
".",
"r... | Removes from this list all of the elements whose index is between fromIndex,
inclusive, and toIndex, exclusive; both indexes can be negative; for
details see {@link #getRealIndex(int)}.
@param fromIndex
the index to start from, inclusive.
@param toIndex
the index to stop at, exclusive.
@see java.util.Vector#removeRang... | [
"Removes",
"from",
"this",
"list",
"all",
"of",
"the",
"elements",
"whose",
"index",
"is",
"between",
"fromIndex",
"inclusive",
"and",
"toIndex",
"exclusive",
";",
"both",
"indexes",
"can",
"be",
"negative",
";",
"for",
"details",
"see",
"{",
"@link",
"#getR... | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/patterns/activities/TypedVector.java#L249-L254 |
fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/SgUtils.java | SgUtils.checkFieldModifiers | public static void checkFieldModifiers(final int modifiers) {
"""
Checks if the modifiers are valid for a field. If any of the modifiers is
not valid an <code>IllegalArgumentException</code> is thrown.
@param modifiers
Modifiers.
"""
// Basic checks
checkModifiers(FIELD, modifiers);
... | java | public static void checkFieldModifiers(final int modifiers) {
// Basic checks
checkModifiers(FIELD, modifiers);
// Check final and volatile
if (Modifier.isFinal(modifiers) && Modifier.isVolatile(modifiers)) {
throw new IllegalArgumentException(FIELD_FINAL_VOLATILE_ER... | [
"public",
"static",
"void",
"checkFieldModifiers",
"(",
"final",
"int",
"modifiers",
")",
"{",
"// Basic checks\r",
"checkModifiers",
"(",
"FIELD",
",",
"modifiers",
")",
";",
"// Check final and volatile\r",
"if",
"(",
"Modifier",
".",
"isFinal",
"(",
"modifiers",
... | Checks if the modifiers are valid for a field. If any of the modifiers is
not valid an <code>IllegalArgumentException</code> is thrown.
@param modifiers
Modifiers. | [
"Checks",
"if",
"the",
"modifiers",
"are",
"valid",
"for",
"a",
"field",
".",
"If",
"any",
"of",
"the",
"modifiers",
"is",
"not",
"valid",
"an",
"<code",
">",
"IllegalArgumentException<",
"/",
"code",
">",
"is",
"thrown",
"."
] | train | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgUtils.java#L189-L200 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_account_accountName_usage_GET | public OvhDomainUsageAccountStruct domain_account_accountName_usage_GET(String domain, String accountName) throws IOException {
"""
usage of account
REST: GET /email/domain/{domain}/account/{accountName}/usage
@param domain [required] Name of your domain name
@param accountName [required] Name of account
... | java | public OvhDomainUsageAccountStruct domain_account_accountName_usage_GET(String domain, String accountName) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/usage";
StringBuilder sb = path(qPath, domain, accountName);
String resp = exec(qPath, "GET", sb.toString(), null);
return ... | [
"public",
"OvhDomainUsageAccountStruct",
"domain_account_accountName_usage_GET",
"(",
"String",
"domain",
",",
"String",
"accountName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/account/{accountName}/usage\"",
";",
"StringBuilder",
"sb... | usage of account
REST: GET /email/domain/{domain}/account/{accountName}/usage
@param domain [required] Name of your domain name
@param accountName [required] Name of account | [
"usage",
"of",
"account"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L432-L437 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java | DocTreeScanner.visitStartElement | @Override
public R visitStartElement(StartElementTree node, P p) {
"""
{@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning
"""
return scan(node.getAttributes(), p);
} | java | @Override
public R visitStartElement(StartElementTree node, P p) {
return scan(node.getAttributes(), p);
} | [
"@",
"Override",
"public",
"R",
"visitStartElement",
"(",
"StartElementTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"scan",
"(",
"node",
".",
"getAttributes",
"(",
")",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"scans",
"the",
"children",
"in",
"left",
"to",
"right",
"order",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java#L435-L438 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getWvWMatchOverview | public void getWvWMatchOverview(String[] ids, Callback<List<WvWMatchOverview>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on WvW matches API go <a href="https://wiki.guildwars2.com/wiki/API:2/wvw/matches">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Re... | java | public void getWvWMatchOverview(String[] ids, Callback<List<WvWMatchOverview>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getWvWMatchOverviewUsingID(processIds(ids)).enqueue(callback);
} | [
"public",
"void",
"getWvWMatchOverview",
"(",
"String",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"WvWMatchOverview",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker"... | For more info on WvW matches API go <a href="https://wiki.guildwars2.com/wiki/API:2/wvw/matches">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of wvw match id(s)
@param callback call... | [
"For",
"more",
"info",
"on",
"WvW",
"matches",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"wvw",
"/",
"matches",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2652-L2655 |
schallee/alib4j | core/src/main/java/net/darkmist/alib/res/PkgRes.java | PkgRes.getResourcePathFor | public static String getResourcePathFor(CharSequence name, Class<?> cls) {
"""
Gets a resource path using cls's package name as the prefix.
@param name The name of the resource.
@param cls The class to get the package prefix from.
@return Path of a resource prefixed by the class package name.
@throws NullPoint... | java | public static String getResourcePathFor(CharSequence name, Class<?> cls)
{
int nameLen;
StringBuilder sb;
if(name==null)
throw new NullPointerException("name is null");
if(cls==null)
throw new NullPointerException("cls is null");
nameLen = name.length();
sb = new StringBuilder(cls.getName().length()... | [
"public",
"static",
"String",
"getResourcePathFor",
"(",
"CharSequence",
"name",
",",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"int",
"nameLen",
";",
"StringBuilder",
"sb",
";",
"if",
"(",
"name",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
... | Gets a resource path using cls's package name as the prefix.
@param name The name of the resource.
@param cls The class to get the package prefix from.
@return Path of a resource prefixed by the class package name.
@throws NullPointerException if name or cls are null. | [
"Gets",
"a",
"resource",
"path",
"using",
"cls",
"s",
"package",
"name",
"as",
"the",
"prefix",
"."
] | train | https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/core/src/main/java/net/darkmist/alib/res/PkgRes.java#L186-L205 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/lambda2/StaticAnalysis.java | StaticAnalysis.inferType | public static Type inferType(Expression2 expression, Type rootType, TypeDeclaration typeDeclaration) {
"""
Implementation of type inference that infers types for
expressions using the basic type information in typeDeclaration.
@param expression
@param rootType
@param typeDeclaration
@return
"""
Map<... | java | public static Type inferType(Expression2 expression, Type rootType, TypeDeclaration typeDeclaration) {
Map<Integer, Type> subexpressionTypeMap = inferTypeMap(expression, rootType, typeDeclaration);
return subexpressionTypeMap.get(0);
} | [
"public",
"static",
"Type",
"inferType",
"(",
"Expression2",
"expression",
",",
"Type",
"rootType",
",",
"TypeDeclaration",
"typeDeclaration",
")",
"{",
"Map",
"<",
"Integer",
",",
"Type",
">",
"subexpressionTypeMap",
"=",
"inferTypeMap",
"(",
"expression",
",",
... | Implementation of type inference that infers types for
expressions using the basic type information in typeDeclaration.
@param expression
@param rootType
@param typeDeclaration
@return | [
"Implementation",
"of",
"type",
"inference",
"that",
"infers",
"types",
"for",
"expressions",
"using",
"the",
"basic",
"type",
"information",
"in",
"typeDeclaration",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lambda2/StaticAnalysis.java#L283-L286 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/StringSelectionListBinding.java | StringSelectionListBinding.getLabelsFromMap | public static Collection getLabelsFromMap(Collection sortedKeys, Map keysAndLabels) {
"""
Will extract labels from a map in sorted order.
@param sortedKeys
collection with keys in the appropriate order. Each key
corresponds to one in the map.
@param keysAndLabels
map containing both, keys and labels, from w... | java | public static Collection getLabelsFromMap(Collection sortedKeys, Map keysAndLabels)
{
Collection<Object> labels = new ArrayList<Object>();
Iterator keyIt = sortedKeys.iterator();
while (keyIt.hasNext())
{
labels.add(keysAndLabels.get(keyIt.next()));
}
retu... | [
"public",
"static",
"Collection",
"getLabelsFromMap",
"(",
"Collection",
"sortedKeys",
",",
"Map",
"keysAndLabels",
")",
"{",
"Collection",
"<",
"Object",
">",
"labels",
"=",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
")",
";",
"Iterator",
"keyIt",
"=",
"s... | Will extract labels from a map in sorted order.
@param sortedKeys
collection with keys in the appropriate order. Each key
corresponds to one in the map.
@param keysAndLabels
map containing both, keys and labels, from which the labels
have to be extracted.
@return a collection containing the labels corresponding to the... | [
"Will",
"extract",
"labels",
"from",
"a",
"map",
"in",
"sorted",
"order",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/StringSelectionListBinding.java#L104-L113 |
recommenders/rival | rival-recommend/src/main/java/net/recommenders/rival/recommend/frameworks/MultipleRecommendationRunner.java | MultipleRecommendationRunner.listAllFiles | public static void listAllFiles(final Set<String> setOfPaths, final String inputPath) {
"""
List all files at a certain path.
@param setOfPaths the set of files at a certain path
@param inputPath the path to check
"""
if (inputPath == null) {
return;
}
File[] files = new... | java | public static void listAllFiles(final Set<String> setOfPaths, final String inputPath) {
if (inputPath == null) {
return;
}
File[] files = new File(inputPath).listFiles();
if (files == null) {
return;
}
for (File file : files) {
if (file... | [
"public",
"static",
"void",
"listAllFiles",
"(",
"final",
"Set",
"<",
"String",
">",
"setOfPaths",
",",
"final",
"String",
"inputPath",
")",
"{",
"if",
"(",
"inputPath",
"==",
"null",
")",
"{",
"return",
";",
"}",
"File",
"[",
"]",
"files",
"=",
"new",... | List all files at a certain path.
@param setOfPaths the set of files at a certain path
@param inputPath the path to check | [
"List",
"all",
"files",
"at",
"a",
"certain",
"path",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-recommend/src/main/java/net/recommenders/rival/recommend/frameworks/MultipleRecommendationRunner.java#L411-L426 |
mangstadt/biweekly | src/main/java/biweekly/util/com/google/ical/iter/IntSet.java | IntSet.toIntArray | int[] toIntArray() {
"""
Converts this set to a new integer array that is sorted in ascending
order.
@return the array (sorted in ascending order)
"""
int[] out = new int[size()];
int a = 0, b = out.length;
for (int i = -1; (i = ints.nextSetBit(i + 1)) >= 0;) {
int n = decode(i);
if (n < 0) {
... | java | int[] toIntArray() {
int[] out = new int[size()];
int a = 0, b = out.length;
for (int i = -1; (i = ints.nextSetBit(i + 1)) >= 0;) {
int n = decode(i);
if (n < 0) {
out[a++] = n;
} else {
out[--b] = n;
}
}
//if it contains -3, -1, 0, 1, 2, 4
//then out will be -1, -3, 4, 2, 1, 0
rever... | [
"int",
"[",
"]",
"toIntArray",
"(",
")",
"{",
"int",
"[",
"]",
"out",
"=",
"new",
"int",
"[",
"size",
"(",
")",
"]",
";",
"int",
"a",
"=",
"0",
",",
"b",
"=",
"out",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"-",
"1",
";",
"(",
"... | Converts this set to a new integer array that is sorted in ascending
order.
@return the array (sorted in ascending order) | [
"Converts",
"this",
"set",
"to",
"a",
"new",
"integer",
"array",
"that",
"is",
"sorted",
"in",
"ascending",
"order",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/IntSet.java#L82-L100 |
tvesalainen/lpg | src/main/java/org/vesalainen/parser/util/Input.java | Input.getInstance | public static <T> InputReader getInstance(T input, String cs, Set<ParserFeature> features) throws IOException {
"""
Returns InputReader for input
@param <T>
@param input Any supported input type
@param cs Character set
@param features Needed features
@return
@throws IOException
"""
return getInst... | java | public static <T> InputReader getInstance(T input, String cs, Set<ParserFeature> features) throws IOException
{
return getInstance(input, -1, Charset.forName(cs), features);
} | [
"public",
"static",
"<",
"T",
">",
"InputReader",
"getInstance",
"(",
"T",
"input",
",",
"String",
"cs",
",",
"Set",
"<",
"ParserFeature",
">",
"features",
")",
"throws",
"IOException",
"{",
"return",
"getInstance",
"(",
"input",
",",
"-",
"1",
",",
"Cha... | Returns InputReader for input
@param <T>
@param input Any supported input type
@param cs Character set
@param features Needed features
@return
@throws IOException | [
"Returns",
"InputReader",
"for",
"input"
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/parser/util/Input.java#L242-L245 |
ManfredTremmel/gwt-bean-validators | gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/CollectionUtils.java | CollectionUtils.findFirstMatch | @SuppressWarnings("unchecked")
@Nullable
public static <E> E findFirstMatch(final Collection<?> source, final Collection<E> candidates) {
"""
Return the first element in '{@code candidates}' that is contained in '{@code source}'. If no
element in '{@code candidates}' is present in '{@code source}' returns {@c... | java | @SuppressWarnings("unchecked")
@Nullable
public static <E> E findFirstMatch(final Collection<?> source, final Collection<E> candidates) {
if (CollectionUtils.isEmpty(source) || CollectionUtils.isEmpty(candidates)) {
return null;
}
for (final Object candidate : candidates) {
if (source.contai... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Nullable",
"public",
"static",
"<",
"E",
">",
"E",
"findFirstMatch",
"(",
"final",
"Collection",
"<",
"?",
">",
"source",
",",
"final",
"Collection",
"<",
"E",
">",
"candidates",
")",
"{",
"if",
"... | Return the first element in '{@code candidates}' that is contained in '{@code source}'. If no
element in '{@code candidates}' is present in '{@code source}' returns {@code null}. Iteration
order is {@link Collection} implementation specific.
@param source the source Collection
@param candidates the candidates to searc... | [
"Return",
"the",
"first",
"element",
"in",
"{",
"@code",
"candidates",
"}",
"that",
"is",
"contained",
"in",
"{",
"@code",
"source",
"}",
".",
"If",
"no",
"element",
"in",
"{",
"@code",
"candidates",
"}",
"is",
"present",
"in",
"{",
"@code",
"source",
... | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/CollectionUtils.java#L220-L232 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/SubscriptionsApi.java | SubscriptionsApi.createSubscriptionAsync | public com.squareup.okhttp.Call createSubscriptionAsync(SubscriptionInfo subscriptionInfo, final ApiCallback<SubscriptionEnvelope> callback) throws ApiException {
"""
Create Subscription (asynchronously)
Create Subscription
@param subscriptionInfo Subscription details (required)
@param callback The callback to ... | java | public com.squareup.okhttp.Call createSubscriptionAsync(SubscriptionInfo subscriptionInfo, final ApiCallback<SubscriptionEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"createSubscriptionAsync",
"(",
"SubscriptionInfo",
"subscriptionInfo",
",",
"final",
"ApiCallback",
"<",
"SubscriptionEnvelope",
">",
"callback",
")",
"throws",
"ApiException",
"{",
"ProgressResponseBody",
... | Create Subscription (asynchronously)
Create Subscription
@param subscriptionInfo Subscription details (required)
@param callback The callback to be executed when the API call finishes
@return The request call
@throws ApiException If fail to process the API call, e.g. serializing the request body object | [
"Create",
"Subscription",
"(",
"asynchronously",
")",
"Create",
"Subscription"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/SubscriptionsApi.java#L153-L178 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java | ThreeViewEstimateMetricScene.flipAround | private static void flipAround(SceneStructureMetric structure, SceneObservations observations) {
"""
Flip the camera pose around. This seems to help it converge to a valid solution if it got it backwards
even if it's not technically something which can be inverted this way
"""
// The first view will be iden... | java | private static void flipAround(SceneStructureMetric structure, SceneObservations observations) {
// The first view will be identity
for (int i = 1; i < structure.views.length; i++) {
Se3_F64 w2v = structure.views[i].worldToView;
w2v.set(w2v.invert(null));
}
triangulatePoints(structure,observations);
} | [
"private",
"static",
"void",
"flipAround",
"(",
"SceneStructureMetric",
"structure",
",",
"SceneObservations",
"observations",
")",
"{",
"// The first view will be identity",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"structure",
".",
"views",
".",
"length"... | Flip the camera pose around. This seems to help it converge to a valid solution if it got it backwards
even if it's not technically something which can be inverted this way | [
"Flip",
"the",
"camera",
"pose",
"around",
".",
"This",
"seems",
"to",
"help",
"it",
"converge",
"to",
"a",
"valid",
"solution",
"if",
"it",
"got",
"it",
"backwards",
"even",
"if",
"it",
"s",
"not",
"technically",
"something",
"which",
"can",
"be",
"inve... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/ThreeViewEstimateMetricScene.java#L483-L490 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDto.java | IssueDto.setRuleKey | public IssueDto setRuleKey(String repo, String rule) {
"""
Should only be used to persist in E/S
<p/>
Please use {@link #setRule(RuleDefinitionDto)} instead
"""
this.ruleRepo = repo;
this.ruleKey = rule;
return this;
} | java | public IssueDto setRuleKey(String repo, String rule) {
this.ruleRepo = repo;
this.ruleKey = rule;
return this;
} | [
"public",
"IssueDto",
"setRuleKey",
"(",
"String",
"repo",
",",
"String",
"rule",
")",
"{",
"this",
".",
"ruleRepo",
"=",
"repo",
";",
"this",
".",
"ruleKey",
"=",
"rule",
";",
"return",
"this",
";",
"}"
] | Should only be used to persist in E/S
<p/>
Please use {@link #setRule(RuleDefinitionDto)} instead | [
"Should",
"only",
"be",
"used",
"to",
"persist",
"in",
"E",
"/",
"S",
"<p",
"/",
">",
"Please",
"use",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDto.java#L611-L615 |
jamesagnew/hapi-fhir | hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Replace.java | Replace.apply | @Override
public Object apply(Object value, Object... params) {
"""
/*
replace(input, string, replacement = '')
Replace occurrences of a string with another
"""
String original = super.asString(value);
Object needle = super.get(0, params);
String replacement = "";
if ... | java | @Override
public Object apply(Object value, Object... params) {
String original = super.asString(value);
Object needle = super.get(0, params);
String replacement = "";
if (needle == null) {
throw new RuntimeException("invalid pattern: " + needle);
}
if... | [
"@",
"Override",
"public",
"Object",
"apply",
"(",
"Object",
"value",
",",
"Object",
"...",
"params",
")",
"{",
"String",
"original",
"=",
"super",
".",
"asString",
"(",
"value",
")",
";",
"Object",
"needle",
"=",
"super",
".",
"get",
"(",
"0",
",",
... | /*
replace(input, string, replacement = '')
Replace occurrences of a string with another | [
"/",
"*",
"replace",
"(",
"input",
"string",
"replacement",
"=",
")"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Replace.java#L10-L34 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java | XpathUtils.asByteBuffer | public static ByteBuffer asByteBuffer(String expression, Node node)
throws XPathExpressionException {
"""
Evaluates the specified xpath expression, base64 decodes the data and
returns the result as a ByteBuffer.
<p>
This method can be expensive as a new xpath is instantiated per
invocation. Conside... | java | public static ByteBuffer asByteBuffer(String expression, Node node)
throws XPathExpressionException {
return asByteBuffer(expression, node, xpath());
} | [
"public",
"static",
"ByteBuffer",
"asByteBuffer",
"(",
"String",
"expression",
",",
"Node",
"node",
")",
"throws",
"XPathExpressionException",
"{",
"return",
"asByteBuffer",
"(",
"expression",
",",
"node",
",",
"xpath",
"(",
")",
")",
";",
"}"
] | Evaluates the specified xpath expression, base64 decodes the data and
returns the result as a ByteBuffer.
<p>
This method can be expensive as a new xpath is instantiated per
invocation. Consider passing in the xpath explicitly via {
{@link #asDouble(String, Node, XPath)} instead. Note {@link XPath} is
not thread-safe ... | [
"Evaluates",
"the",
"specified",
"xpath",
"expression",
"base64",
"decodes",
"the",
"data",
"and",
"returns",
"the",
"result",
"as",
"a",
"ByteBuffer",
".",
"<p",
">",
"This",
"method",
"can",
"be",
"expensive",
"as",
"a",
"new",
"xpath",
"is",
"instantiated... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java#L495-L498 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfLine.java | PdfLine.getWidthCorrected | public float getWidthCorrected(float charSpacing, float wordSpacing) {
"""
Gets a width corrected with a charSpacing and wordSpacing.
@param charSpacing
@param wordSpacing
@return a corrected width
"""
float total = 0;
for (int k = 0; k < line.size(); ++k) {
PdfChunk ck = (PdfChu... | java | public float getWidthCorrected(float charSpacing, float wordSpacing) {
float total = 0;
for (int k = 0; k < line.size(); ++k) {
PdfChunk ck = (PdfChunk)line.get(k);
total += ck.getWidthCorrected(charSpacing, wordSpacing);
}
return total;
} | [
"public",
"float",
"getWidthCorrected",
"(",
"float",
"charSpacing",
",",
"float",
"wordSpacing",
")",
"{",
"float",
"total",
"=",
"0",
";",
"for",
"(",
"int",
"k",
"=",
"0",
";",
"k",
"<",
"line",
".",
"size",
"(",
")",
";",
"++",
"k",
")",
"{",
... | Gets a width corrected with a charSpacing and wordSpacing.
@param charSpacing
@param wordSpacing
@return a corrected width | [
"Gets",
"a",
"width",
"corrected",
"with",
"a",
"charSpacing",
"and",
"wordSpacing",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfLine.java#L497-L504 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/ssh/SshKeyFingerprint.java | SshKeyFingerprint.getFingerprint | public static String getFingerprint(byte[] encoded, String algorithm)
throws SshException {
"""
Generate an SSH key fingerprint with a specific algorithm.
@param encoded
@param algorithm
@return the key fingerprint, for example
"c1:b1:30:29:d7:b8:de:6c:97:77:10:d7:46:41:63:87"
"""
Digest md5 = (Dig... | java | public static String getFingerprint(byte[] encoded, String algorithm)
throws SshException {
Digest md5 = (Digest) ComponentManager.getInstance().supportedDigests()
.getInstance(algorithm);
md5.putBytes(encoded);
byte[] digest = md5.doFinal();
StringBuffer buf = new StringBuffer();
int ch;
for (in... | [
"public",
"static",
"String",
"getFingerprint",
"(",
"byte",
"[",
"]",
"encoded",
",",
"String",
"algorithm",
")",
"throws",
"SshException",
"{",
"Digest",
"md5",
"=",
"(",
"Digest",
")",
"ComponentManager",
".",
"getInstance",
"(",
")",
".",
"supportedDigests... | Generate an SSH key fingerprint with a specific algorithm.
@param encoded
@param algorithm
@return the key fingerprint, for example
"c1:b1:30:29:d7:b8:de:6c:97:77:10:d7:46:41:63:87" | [
"Generate",
"an",
"SSH",
"key",
"fingerprint",
"with",
"a",
"specific",
"algorithm",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/ssh/SshKeyFingerprint.java#L66-L88 |
andkulikov/Transitions-Everywhere | library(1.x)/src/main/java/com/transitionseverywhere/Transition.java | Transition.excludeTarget | @NonNull
public Transition excludeTarget(@Nullable View target, boolean exclude) {
"""
Whether to add the given target to the list of targets to exclude from this
transition. The <code>exclude</code> parameter specifies whether the target
should be added to or removed from the excluded list.
<p/>
<p>Exclud... | java | @NonNull
public Transition excludeTarget(@Nullable View target, boolean exclude) {
mTargetExcludes = excludeObject(mTargetExcludes, target, exclude);
return this;
} | [
"@",
"NonNull",
"public",
"Transition",
"excludeTarget",
"(",
"@",
"Nullable",
"View",
"target",
",",
"boolean",
"exclude",
")",
"{",
"mTargetExcludes",
"=",
"excludeObject",
"(",
"mTargetExcludes",
",",
"target",
",",
"exclude",
")",
";",
"return",
"this",
";... | Whether to add the given target to the list of targets to exclude from this
transition. The <code>exclude</code> parameter specifies whether the target
should be added to or removed from the excluded list.
<p/>
<p>Excluding targets is a general mechanism for allowing transitions to run on
a view hierarchy while skippin... | [
"Whether",
"to",
"add",
"the",
"given",
"target",
"to",
"the",
"list",
"of",
"targets",
"to",
"exclude",
"from",
"this",
"transition",
".",
"The",
"<code",
">",
"exclude<",
"/",
"code",
">",
"parameter",
"specifies",
"whether",
"the",
"target",
"should",
"... | train | https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/Transition.java#L1225-L1229 |
OrienteerBAP/wicket-orientdb | wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/security/OrientResourceAuthorizationStrategy.java | OrientResourceAuthorizationStrategy.checkResources | public boolean checkResources(RequiredOrientResource[] resources, Action action) {
"""
Check that current user has access to all mentioned resources
@param resources {@link RequiredOrientResource}s to check
@param action {@link Action} to check for
@return true if access is allowed
"""
for (int i = 0; i <... | java | public boolean checkResources(RequiredOrientResource[] resources, Action action)
{
for (int i = 0; i < resources.length; i++) {
RequiredOrientResource requiredOrientResource = resources[i];
if(!checkResource(requiredOrientResource, action)) return false;
}
return true;
} | [
"public",
"boolean",
"checkResources",
"(",
"RequiredOrientResource",
"[",
"]",
"resources",
",",
"Action",
"action",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"resources",
".",
"length",
";",
"i",
"++",
")",
"{",
"RequiredOrientResource",... | Check that current user has access to all mentioned resources
@param resources {@link RequiredOrientResource}s to check
@param action {@link Action} to check for
@return true if access is allowed | [
"Check",
"that",
"current",
"user",
"has",
"access",
"to",
"all",
"mentioned",
"resources"
] | train | https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/security/OrientResourceAuthorizationStrategy.java#L72-L79 |
indeedeng/util | util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java | Quicksortables.vecswap | private static void vecswap(Quicksortable q, int a, int b, int n) {
"""
Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
@param q The quicksortable.
@param a The first pointer to swap
@param b The second pointer to swap
@param n The number of elements to swap
"""
for (int i = 0; i < n; i++, a++, b++)
... | java | private static void vecswap(Quicksortable q, int a, int b, int n) {
for (int i = 0; i < n; i++, a++, b++)
q.swap(a, b);
} | [
"private",
"static",
"void",
"vecswap",
"(",
"Quicksortable",
"q",
",",
"int",
"a",
",",
"int",
"b",
",",
"int",
"n",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
",",
"a",
"++",
",",
"b",
"++",
")",
"q",
... | Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
@param q The quicksortable.
@param a The first pointer to swap
@param b The second pointer to swap
@param n The number of elements to swap | [
"Swaps",
"x",
"[",
"a",
"..",
"(",
"a",
"+",
"n",
"-",
"1",
")",
"]",
"with",
"x",
"[",
"b",
"..",
"(",
"b",
"+",
"n",
"-",
"1",
")",
"]",
"."
] | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java#L221-L224 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionComputer.java | MapTileCollisionComputer.computeCollision | public CollisionResult computeCollision(Transformable transformable, CollisionCategory category) {
"""
Search first tile hit by the transformable that contains collision, applying a ray tracing from its old location
to its current. This way, the transformable can not pass through a collidable tile.
@param tran... | java | public CollisionResult computeCollision(Transformable transformable, CollisionCategory category)
{
// Distance calculation
final double sh = transformable.getOldX() + category.getOffsetX();
final double sv = transformable.getOldY() + category.getOffsetY();
final double dh = tr... | [
"public",
"CollisionResult",
"computeCollision",
"(",
"Transformable",
"transformable",
",",
"CollisionCategory",
"category",
")",
"{",
"// Distance calculation\r",
"final",
"double",
"sh",
"=",
"transformable",
".",
"getOldX",
"(",
")",
"+",
"category",
".",
"getOffs... | Search first tile hit by the transformable that contains collision, applying a ray tracing from its old location
to its current. This way, the transformable can not pass through a collidable tile.
@param transformable The transformable reference.
@param category The collisions category to search in.
@return The collis... | [
"Search",
"first",
"tile",
"hit",
"by",
"the",
"transformable",
"that",
"contains",
"collision",
"applying",
"a",
"ray",
"tracing",
"from",
"its",
"old",
"location",
"to",
"its",
"current",
".",
"This",
"way",
"the",
"transformable",
"can",
"not",
"pass",
"t... | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionComputer.java#L128-L156 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java | TypeConverter.convertToFloat | public static float convertToFloat (@Nullable final Object aSrcValue, final float fDefault) {
"""
Convert the passed source value to float
@param aSrcValue
The source value. May be <code>null</code>.
@param fDefault
The default value to be returned if an error occurs during type
conversion.
@return The con... | java | public static float convertToFloat (@Nullable final Object aSrcValue, final float fDefault)
{
final Float aValue = convert (aSrcValue, Float.class, null);
return aValue == null ? fDefault : aValue.floatValue ();
} | [
"public",
"static",
"float",
"convertToFloat",
"(",
"@",
"Nullable",
"final",
"Object",
"aSrcValue",
",",
"final",
"float",
"fDefault",
")",
"{",
"final",
"Float",
"aValue",
"=",
"convert",
"(",
"aSrcValue",
",",
"Float",
".",
"class",
",",
"null",
")",
";... | Convert the passed source value to float
@param aSrcValue
The source value. May be <code>null</code>.
@param fDefault
The default value to be returned if an error occurs during type
conversion.
@return The converted value.
@throws RuntimeException
If the converter itself throws an exception
@see TypeConverterProviderB... | [
"Convert",
"the",
"passed",
"source",
"value",
"to",
"float"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java#L295-L299 |
apache/groovy | src/main/java/org/codehaus/groovy/tools/ErrorReporter.java | ErrorReporter.stacktrace | protected void stacktrace(Throwable e, boolean always) {
"""
Displays an exception's stack trace, if <code>debug</code> or
<code>always</code>.
"""
if (debug || always) {
println(">>> stacktrace:");
if (output instanceof PrintStream) {
e.printStackTrace((PrintSt... | java | protected void stacktrace(Throwable e, boolean always) {
if (debug || always) {
println(">>> stacktrace:");
if (output instanceof PrintStream) {
e.printStackTrace((PrintStream) output);
} else {
e.printStackTrace((PrintWriter) output);
... | [
"protected",
"void",
"stacktrace",
"(",
"Throwable",
"e",
",",
"boolean",
"always",
")",
"{",
"if",
"(",
"debug",
"||",
"always",
")",
"{",
"println",
"(",
"\">>> stacktrace:\"",
")",
";",
"if",
"(",
"output",
"instanceof",
"PrintStream",
")",
"{",
"e",
... | Displays an exception's stack trace, if <code>debug</code> or
<code>always</code>. | [
"Displays",
"an",
"exception",
"s",
"stack",
"trace",
"if",
"<code",
">",
"debug<",
"/",
"code",
">",
"or",
"<code",
">",
"always<",
"/",
"code",
">",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/tools/ErrorReporter.java#L171-L180 |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/dispatchers/InitialRequestDispatcher.java | InitialRequestDispatcher.dispatchOutsideContainer | private void dispatchOutsideContainer(SipServletRequestImpl sipServletRequest) throws DispatcherException {
"""
Dispatch a request outside the container
@param sipServletRequest request
@throws DispatcherException problem occured when dispatching the request outside the container
"""
final Request request ... | java | private void dispatchOutsideContainer(SipServletRequestImpl sipServletRequest) throws DispatcherException {
final Request request = (Request) sipServletRequest.getMessage();
if(logger.isInfoEnabled()) {
logger.info("Dispatching the request event outside the container");
}
//check if the request point to anot... | [
"private",
"void",
"dispatchOutsideContainer",
"(",
"SipServletRequestImpl",
"sipServletRequest",
")",
"throws",
"DispatcherException",
"{",
"final",
"Request",
"request",
"=",
"(",
"Request",
")",
"sipServletRequest",
".",
"getMessage",
"(",
")",
";",
"if",
"(",
"l... | Dispatch a request outside the container
@param sipServletRequest request
@throws DispatcherException problem occured when dispatching the request outside the container | [
"Dispatch",
"a",
"request",
"outside",
"the",
"container"
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/dispatchers/InitialRequestDispatcher.java#L523-L555 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java | JedisUtils.newJedisPool | public static JedisPool newJedisPool(String hostAndPort, String password) {
"""
Create a new {@link JedisPool} with default pool configs.
@param hostAndPort
format {@code host:port} or {@code host}, default Redis port is used if not
specified
@param password
@return
"""
return newJedisPool(defau... | java | public static JedisPool newJedisPool(String hostAndPort, String password) {
return newJedisPool(defaultJedisPoolConfig(), hostAndPort, password);
} | [
"public",
"static",
"JedisPool",
"newJedisPool",
"(",
"String",
"hostAndPort",
",",
"String",
"password",
")",
"{",
"return",
"newJedisPool",
"(",
"defaultJedisPoolConfig",
"(",
")",
",",
"hostAndPort",
",",
"password",
")",
";",
"}"
] | Create a new {@link JedisPool} with default pool configs.
@param hostAndPort
format {@code host:port} or {@code host}, default Redis port is used if not
specified
@param password
@return | [
"Create",
"a",
"new",
"{",
"@link",
"JedisPool",
"}",
"with",
"default",
"pool",
"configs",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java#L115-L117 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/CheckedExceptionsFactory.java | CheckedExceptionsFactory.newTimeoutException | public static TimeoutException newTimeoutException(String message, Object... args) {
"""
Constructs and initializes a new {@link TimeoutException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link TimeoutException exce... | java | public static TimeoutException newTimeoutException(String message, Object... args) {
return newTimeoutException(null, message, args);
} | [
"public",
"static",
"TimeoutException",
"newTimeoutException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newTimeoutException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link TimeoutException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link TimeoutException exception}.
@param args {@link Object[] arguments} used to replace format placeholders in the {@link ... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"TimeoutException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/CheckedExceptionsFactory.java#L103-L105 |
wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/WebJarController.java | WebJarController.addingBundle | @Override
public synchronized List<BundleWebJarLib> addingBundle(Bundle bundle, BundleEvent bundleEvent) {
"""
A bundle just arrived (and / or just becomes ACTIVE). We need to check if it contains 'webjar libraries'.
@param bundle the bundle
@param bundleEvent the event
@return the list of webjar fou... | java | @Override
public synchronized List<BundleWebJarLib> addingBundle(Bundle bundle, BundleEvent bundleEvent) {
Enumeration<URL> e = bundle.findEntries(WEBJAR_LOCATION, "*", true);
if (e == null) {
// No match
return Collections.emptyList();
}
List<BundleWebJarLib>... | [
"@",
"Override",
"public",
"synchronized",
"List",
"<",
"BundleWebJarLib",
">",
"addingBundle",
"(",
"Bundle",
"bundle",
",",
"BundleEvent",
"bundleEvent",
")",
"{",
"Enumeration",
"<",
"URL",
">",
"e",
"=",
"bundle",
".",
"findEntries",
"(",
"WEBJAR_LOCATION",
... | A bundle just arrived (and / or just becomes ACTIVE). We need to check if it contains 'webjar libraries'.
@param bundle the bundle
@param bundleEvent the event
@return the list of webjar found in the bundle, empty if none. | [
"A",
"bundle",
"just",
"arrived",
"(",
"and",
"/",
"or",
"just",
"becomes",
"ACTIVE",
")",
".",
"We",
"need",
"to",
"check",
"if",
"it",
"contains",
"webjar",
"libraries",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/WebJarController.java#L294-L321 |
carewebframework/carewebframework-core | org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/ConfigTemplate.java | ConfigTemplate.createFile | protected void createFile(File stagingDirectory) throws MojoExecutionException {
"""
Create the xml configuration descriptor.
@param stagingDirectory The parent directory where the configuration descriptor is to be
created.
@throws MojoExecutionException Unspecified exception.
"""
File targetDirec... | java | protected void createFile(File stagingDirectory) throws MojoExecutionException {
File targetDirectory = newSubdirectory(stagingDirectory, "META-INF");
File newEntry = new File(targetDirectory, filename);
try (FileOutputStream out = new FileOutputStream(newEntry); PrintStream ps = new PrintStrea... | [
"protected",
"void",
"createFile",
"(",
"File",
"stagingDirectory",
")",
"throws",
"MojoExecutionException",
"{",
"File",
"targetDirectory",
"=",
"newSubdirectory",
"(",
"stagingDirectory",
",",
"\"META-INF\"",
")",
";",
"File",
"newEntry",
"=",
"new",
"File",
"(",
... | Create the xml configuration descriptor.
@param stagingDirectory The parent directory where the configuration descriptor is to be
created.
@throws MojoExecutionException Unspecified exception. | [
"Create",
"the",
"xml",
"configuration",
"descriptor",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/ConfigTemplate.java#L128-L156 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.addResourceToOrgUnit | public void addResourceToOrgUnit(CmsRequestContext context, CmsOrganizationalUnit orgUnit, CmsResource resource)
throws CmsException {
"""
Adds a resource to the given organizational unit.<p>
@param context the current request context
@param orgUnit the organizational unit to add the resource to
@param re... | java | public void addResourceToOrgUnit(CmsRequestContext context, CmsOrganizationalUnit orgUnit, CmsResource resource)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
checkOfflineProject(dbc);
checkRole(dbc, CmsRole.ADMINISTRATOR.forOrgUnit... | [
"public",
"void",
"addResourceToOrgUnit",
"(",
"CmsRequestContext",
"context",
",",
"CmsOrganizationalUnit",
"orgUnit",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"conte... | Adds a resource to the given organizational unit.<p>
@param context the current request context
@param orgUnit the organizational unit to add the resource to
@param resource the resource that is to be added to the organizational unit
@throws CmsException if something goes wrong
@see org.opencms.security.CmsOrgUnitMa... | [
"Adds",
"a",
"resource",
"to",
"the",
"given",
"organizational",
"unit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L247-L266 |
igniterealtime/Smack | smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/multi/MultiMediaManager.java | MultiMediaManager.createMediaSession | @Override
public JingleMediaSession createMediaSession(PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local, final JingleSession jingleSession) {
"""
Returns a new JingleMediaSession.
@param payloadType payloadType
@param remote remote Candidate
@param local ... | java | @Override
public JingleMediaSession createMediaSession(PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local, final JingleSession jingleSession) {
for (JingleMediaManager manager : managers) {
if (manager.getPayloads().contains(payloadType)) {
r... | [
"@",
"Override",
"public",
"JingleMediaSession",
"createMediaSession",
"(",
"PayloadType",
"payloadType",
",",
"final",
"TransportCandidate",
"remote",
",",
"final",
"TransportCandidate",
"local",
",",
"final",
"JingleSession",
"jingleSession",
")",
"{",
"for",
"(",
"... | Returns a new JingleMediaSession.
@param payloadType payloadType
@param remote remote Candidate
@param local local Candidate
@return JingleMediaSession JingleMediaSession | [
"Returns",
"a",
"new",
"JingleMediaSession",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/multi/MultiMediaManager.java#L82-L90 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bmr/BmrClient.java | BmrClient.modifyInstanceGroups | public void modifyInstanceGroups(ModifyInstanceGroupsRequest request) {
"""
Modify the instance groups of the target cluster.
@param request The request containing the ID of BMR cluster and the instance groups to be modified.
"""
checkNotNull(request, "request should not be null.");
checkStr... | java | public void modifyInstanceGroups(ModifyInstanceGroupsRequest request) {
checkNotNull(request, "request should not be null.");
checkStringNotEmpty(request.getClusterId(), "The clusterId should not be null or empty string.");
checkNotNull(request.getInstanceGroups(), "The instanceGroups should not... | [
"public",
"void",
"modifyInstanceGroups",
"(",
"ModifyInstanceGroupsRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getClusterId",
"(",
")",
",",
"\"The cluster... | Modify the instance groups of the target cluster.
@param request The request containing the ID of BMR cluster and the instance groups to be modified. | [
"Modify",
"the",
"instance",
"groups",
"of",
"the",
"target",
"cluster",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bmr/BmrClient.java#L292-L332 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/CommonUtils.java | CommonUtils.getValueFromStaticMapping | public static String getValueFromStaticMapping(String mapping, String key) {
"""
Gets the value with a given key from a static key/value mapping in string format. E.g. with
mapping "id1=user1;id2=user2", it returns "user1" with key "id1". It returns null if the given
key does not exist in the mapping.
@param ... | java | public static String getValueFromStaticMapping(String mapping, String key) {
Map<String, String> m = Splitter.on(";")
.omitEmptyStrings()
.trimResults()
.withKeyValueSeparator("=")
.split(mapping);
return m.get(key);
} | [
"public",
"static",
"String",
"getValueFromStaticMapping",
"(",
"String",
"mapping",
",",
"String",
"key",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"m",
"=",
"Splitter",
".",
"on",
"(",
"\";\"",
")",
".",
"omitEmptyStrings",
"(",
")",
".",
"tr... | Gets the value with a given key from a static key/value mapping in string format. E.g. with
mapping "id1=user1;id2=user2", it returns "user1" with key "id1". It returns null if the given
key does not exist in the mapping.
@param mapping the "key=value" mapping in string format separated by ";"
@param key the key to qu... | [
"Gets",
"the",
"value",
"with",
"a",
"given",
"key",
"from",
"a",
"static",
"key",
"/",
"value",
"mapping",
"in",
"string",
"format",
".",
"E",
".",
"g",
".",
"with",
"mapping",
"id1",
"=",
"user1",
";",
"id2",
"=",
"user2",
"it",
"returns",
"user1",... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L395-L402 |
fuinorg/objects4j | src/main/java/org/fuin/objects4j/ui/TableColumnInfo.java | TableColumnInfo.getGetter | private static String getGetter(final TableColumn tableColumn, final String fieldName) {
"""
Returns the getter for the given field. If <code>tableColumn.getter()</code> is empty <code>getXxx()</code> is returned ("Xxx" is
<code>fieldName</code> with first character upper case).
@param tableColumn
Table colum... | java | private static String getGetter(final TableColumn tableColumn, final String fieldName) {
if (tableColumn.getter().equals("")) {
return "get" + firstCharUpper(fieldName);
}
return tableColumn.getter();
} | [
"private",
"static",
"String",
"getGetter",
"(",
"final",
"TableColumn",
"tableColumn",
",",
"final",
"String",
"fieldName",
")",
"{",
"if",
"(",
"tableColumn",
".",
"getter",
"(",
")",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"return",
"\"get\"",
"+",
... | Returns the getter for the given field. If <code>tableColumn.getter()</code> is empty <code>getXxx()</code> is returned ("Xxx" is
<code>fieldName</code> with first character upper case).
@param tableColumn
Table column information for the field.
@param fieldName
Name of the field.
@return Getter for the field. | [
"Returns",
"the",
"getter",
"for",
"the",
"given",
"field",
".",
"If",
"<code",
">",
"tableColumn",
".",
"getter",
"()",
"<",
"/",
"code",
">",
"is",
"empty",
"<code",
">",
"getXxx",
"()",
"<",
"/",
"code",
">",
"is",
"returned",
"(",
"Xxx",
"is",
... | train | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/ui/TableColumnInfo.java#L294-L299 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/CharInfo.java | CharInfo.extraEntity | private boolean extraEntity(String outputString, int charToMap) {
"""
This method returns true if there are some non-standard mappings to
entities other than quot, amp, lt, gt, and its only purpose is for
performance.
@param charToMap The value of the character that is mapped to a String
@param outputString Th... | java | private boolean extraEntity(String outputString, int charToMap)
{
boolean extra = false;
if (charToMap < ASCII_MAX)
{
switch (charToMap)
{
case '"' : // quot
if (!outputString.equals("""))
extra = true;
... | [
"private",
"boolean",
"extraEntity",
"(",
"String",
"outputString",
",",
"int",
"charToMap",
")",
"{",
"boolean",
"extra",
"=",
"false",
";",
"if",
"(",
"charToMap",
"<",
"ASCII_MAX",
")",
"{",
"switch",
"(",
"charToMap",
")",
"{",
"case",
"'",
"'",
":",... | This method returns true if there are some non-standard mappings to
entities other than quot, amp, lt, gt, and its only purpose is for
performance.
@param charToMap The value of the character that is mapped to a String
@param outputString The String to which the character is mapped, usually
an entity reference such as ... | [
"This",
"method",
"returns",
"true",
"if",
"there",
"are",
"some",
"non",
"-",
"standard",
"mappings",
"to",
"entities",
"other",
"than",
"quot",
"amp",
"lt",
"gt",
"and",
"its",
"only",
"purpose",
"is",
"for",
"performance",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/CharInfo.java#L666-L694 |
prolificinteractive/material-calendarview | library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java | MaterialCalendarView.clampSize | private static int clampSize(int size, int spec) {
"""
Clamp the size to the measure spec.
@param size Size we want to be
@param spec Measure spec to clamp against
@return the appropriate size to pass to {@linkplain View#setMeasuredDimension(int, int)}
"""
int specMode = MeasureSpec.getMode(spec);
... | java | private static int clampSize(int size, int spec) {
int specMode = MeasureSpec.getMode(spec);
int specSize = MeasureSpec.getSize(spec);
switch (specMode) {
case MeasureSpec.EXACTLY: {
return specSize;
}
case MeasureSpec.AT_MOST: {
return Math.min(size, specSize);
}
... | [
"private",
"static",
"int",
"clampSize",
"(",
"int",
"size",
",",
"int",
"spec",
")",
"{",
"int",
"specMode",
"=",
"MeasureSpec",
".",
"getMode",
"(",
"spec",
")",
";",
"int",
"specSize",
"=",
"MeasureSpec",
".",
"getSize",
"(",
"spec",
")",
";",
"swit... | Clamp the size to the measure spec.
@param size Size we want to be
@param spec Measure spec to clamp against
@return the appropriate size to pass to {@linkplain View#setMeasuredDimension(int, int)} | [
"Clamp",
"the",
"size",
"to",
"the",
"measure",
"spec",
"."
] | train | https://github.com/prolificinteractive/material-calendarview/blob/04fae8175fd034d0a7131f8cb253cae883a88aa2/library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java#L1664-L1679 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AtomCache.java | AtomCache.getStructureForDomain | public Structure getStructureForDomain(ScopDomain domain, ScopDatabase scopDatabase) throws IOException,
StructureException {
"""
Returns the representation of a {@link ScopDomain} as a BioJava {@link Structure} object.
@param domain
a SCOP domain
@param scopDatabase
A {@link ScopDatabase} to use
@return... | java | public Structure getStructureForDomain(ScopDomain domain, ScopDatabase scopDatabase) throws IOException,
StructureException {
return getStructureForDomain(domain, scopDatabase, false);
} | [
"public",
"Structure",
"getStructureForDomain",
"(",
"ScopDomain",
"domain",
",",
"ScopDatabase",
"scopDatabase",
")",
"throws",
"IOException",
",",
"StructureException",
"{",
"return",
"getStructureForDomain",
"(",
"domain",
",",
"scopDatabase",
",",
"false",
")",
";... | Returns the representation of a {@link ScopDomain} as a BioJava {@link Structure} object.
@param domain
a SCOP domain
@param scopDatabase
A {@link ScopDatabase} to use
@return a Structure object
@throws IOException
@throws StructureException | [
"Returns",
"the",
"representation",
"of",
"a",
"{",
"@link",
"ScopDomain",
"}",
"as",
"a",
"BioJava",
"{",
"@link",
"Structure",
"}",
"object",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AtomCache.java#L543-L546 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java | LocalWeightedHistogramRotRect.createSamplePoints | protected void createSamplePoints(int numSamples) {
"""
create the list of points in square coordinates that it will sample. values will range
from -0.5 to 0.5 along each axis.
"""
for( int y = 0; y < numSamples; y++ ) {
float regionY = (y/(numSamples-1.0f) - 0.5f);
for( int x = 0; x < numSamples; x... | java | protected void createSamplePoints(int numSamples) {
for( int y = 0; y < numSamples; y++ ) {
float regionY = (y/(numSamples-1.0f) - 0.5f);
for( int x = 0; x < numSamples; x++ ) {
float regionX = (x/(numSamples-1.0f) - 0.5f);
samplePts.add( new Point2D_F32(regionX,regionY));
}
}
} | [
"protected",
"void",
"createSamplePoints",
"(",
"int",
"numSamples",
")",
"{",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"numSamples",
";",
"y",
"++",
")",
"{",
"float",
"regionY",
"=",
"(",
"y",
"/",
"(",
"numSamples",
"-",
"1.0f",
")",
"-"... | create the list of points in square coordinates that it will sample. values will range
from -0.5 to 0.5 along each axis. | [
"create",
"the",
"list",
"of",
"points",
"in",
"square",
"coordinates",
"that",
"it",
"will",
"sample",
".",
"values",
"will",
"range",
"from",
"-",
"0",
".",
"5",
"to",
"0",
".",
"5",
"along",
"each",
"axis",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L117-L126 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-container/src/main/java/com/google/cloud/container/v1/ClusterManagerClient.java | ClusterManagerClient.startIPRotation | public final Operation startIPRotation(String projectId, String zone, String clusterId) {
"""
Start master IP rotation.
<p>Sample code:
<pre><code>
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
Operation ... | java | public final Operation startIPRotation(String projectId, String zone, String clusterId) {
StartIPRotationRequest request =
StartIPRotationRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.build();
return startIPRotatio... | [
"public",
"final",
"Operation",
"startIPRotation",
"(",
"String",
"projectId",
",",
"String",
"zone",
",",
"String",
"clusterId",
")",
"{",
"StartIPRotationRequest",
"request",
"=",
"StartIPRotationRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"... | Start master IP rotation.
<p>Sample code:
<pre><code>
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
Operation response = clusterManagerClient.startIPRotation(projectId, zone, clusterId);
}
</code></pre>
@param project... | [
"Start",
"master",
"IP",
"rotation",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-container/src/main/java/com/google/cloud/container/v1/ClusterManagerClient.java#L2439-L2448 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/JsonUtil.java | JsonUtil.getBoolean | public static boolean getBoolean(JsonObject object, String field, boolean defaultValue) {
"""
Returns a field in a Json object as a boolean.
@param object the Json Object
@param field the field in the Json object to return
@param defaultValue a default value for the field if the field value is null
@return t... | java | public static boolean getBoolean(JsonObject object, String field, boolean defaultValue) {
final JsonValue value = object.get(field);
if (value == null || value.isNull()) {
return defaultValue;
} else {
return value.asBoolean();
}
} | [
"public",
"static",
"boolean",
"getBoolean",
"(",
"JsonObject",
"object",
",",
"String",
"field",
",",
"boolean",
"defaultValue",
")",
"{",
"final",
"JsonValue",
"value",
"=",
"object",
".",
"get",
"(",
"field",
")",
";",
"if",
"(",
"value",
"==",
"null",
... | Returns a field in a Json object as a boolean.
@param object the Json Object
@param field the field in the Json object to return
@param defaultValue a default value for the field if the field value is null
@return the Json field value as a boolean | [
"Returns",
"a",
"field",
"in",
"a",
"Json",
"object",
"as",
"a",
"boolean",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/JsonUtil.java#L213-L220 |
gondor/kbop | src/main/java/org/pacesys/kbop/internal/AbstractKeyedObjectPool.java | AbstractKeyedObjectPool.await | protected boolean await(final PoolWaitFuture<E> future, final PoolKey<K> key, Date deadline) throws InterruptedException {
"""
Adds the current PoolWaitFuture into the waiting list. The future will wait up until the specified deadline. If the future is woken up before the
specified deadline then true is returne... | java | protected boolean await(final PoolWaitFuture<E> future, final PoolKey<K> key, Date deadline) throws InterruptedException {
try
{
waiting.add(future);
return future.await(deadline);
}
finally {
waiting.remove(future);
}
} | [
"protected",
"boolean",
"await",
"(",
"final",
"PoolWaitFuture",
"<",
"E",
">",
"future",
",",
"final",
"PoolKey",
"<",
"K",
">",
"key",
",",
"Date",
"deadline",
")",
"throws",
"InterruptedException",
"{",
"try",
"{",
"waiting",
".",
"add",
"(",
"future",
... | Adds the current PoolWaitFuture into the waiting list. The future will wait up until the specified deadline. If the future is woken up before the
specified deadline then true is returned otherwise false. The future will always be removed from the wait list regardless
of the outcome.
@param future the PoolWaitFuture... | [
"Adds",
"the",
"current",
"PoolWaitFuture",
"into",
"the",
"waiting",
"list",
".",
"The",
"future",
"will",
"wait",
"up",
"until",
"the",
"specified",
"deadline",
".",
"If",
"the",
"future",
"is",
"woken",
"up",
"before",
"the",
"specified",
"deadline",
"the... | train | https://github.com/gondor/kbop/blob/a176fd845f1e146610f03a1cb3cb0d661ebf4faa/src/main/java/org/pacesys/kbop/internal/AbstractKeyedObjectPool.java#L217-L226 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/DNS.java | DNS.getDefaultHost | @Deprecated
public static String getDefaultHost(String strInterface, String nameserver)
throws UnknownHostException {
"""
Returns the default (first) host name associated by the provided
nameserver with the address bound to the specified network interface
@param strInterface
The name of the network inte... | java | @Deprecated
public static String getDefaultHost(String strInterface, String nameserver)
throws UnknownHostException {
if (strInterface.equals("default"))
return InetAddress.getLocalHost().getCanonicalHostName();
if (nameserver != null && nameserver.equals("default"))
return getDefaultHost(st... | [
"@",
"Deprecated",
"public",
"static",
"String",
"getDefaultHost",
"(",
"String",
"strInterface",
",",
"String",
"nameserver",
")",
"throws",
"UnknownHostException",
"{",
"if",
"(",
"strInterface",
".",
"equals",
"(",
"\"default\"",
")",
")",
"return",
"InetAddres... | Returns the default (first) host name associated by the provided
nameserver with the address bound to the specified network interface
@param strInterface
The name of the network interface to query (e.g. eth0)
@param nameserver
The DNS host name
@return The default host names associated with IPs bound to the network
in... | [
"Returns",
"the",
"default",
"(",
"first",
")",
"host",
"name",
"associated",
"by",
"the",
"provided",
"nameserver",
"with",
"the",
"address",
"bound",
"to",
"the",
"specified",
"network",
"interface"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/DNS.java#L199-L210 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java | JobOperations.patchJob | public void patchJob(String jobId, JobPatchParameter jobPatchParameter, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Updates the specified job.
This method only replaces the properties specified with non-null values.
@param jobId The ID of the job.
@param jo... | java | public void patchJob(String jobId, JobPatchParameter jobPatchParameter, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
JobPatchOptions options = new JobPatchOptions();
BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors);
... | [
"public",
"void",
"patchJob",
"(",
"String",
"jobId",
",",
"JobPatchParameter",
"jobPatchParameter",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"JobPatchOptions",
"options",
"="... | Updates the specified job.
This method only replaces the properties specified with non-null values.
@param jobId The ID of the job.
@param jobPatchParameter The parameter to update the job.
@param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service request.
@... | [
"Updates",
"the",
"specified",
"job",
".",
"This",
"method",
"only",
"replaces",
"the",
"properties",
"specified",
"with",
"non",
"-",
"null",
"values",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java#L588-L594 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/server/RemoteSessionActivator.java | RemoteSessionActivator.startupService | public Object startupService(BundleContext bundleContext) {
"""
Start this service.
Override this to do all the startup.
@return true if successful.
"""
try {
Environment env = (Environment)this.getService(Env.class);
// Note the order that I do this... this is because MainApp... | java | public Object startupService(BundleContext bundleContext)
{
try {
Environment env = (Environment)this.getService(Env.class);
// Note the order that I do this... this is because MainApplication may need access to the remoteapp during initialization
Map<String, Object> prop... | [
"public",
"Object",
"startupService",
"(",
"BundleContext",
"bundleContext",
")",
"{",
"try",
"{",
"Environment",
"env",
"=",
"(",
"Environment",
")",
"this",
".",
"getService",
"(",
"Env",
".",
"class",
")",
";",
"// Note the order that I do this... this is because... | Start this service.
Override this to do all the startup.
@return true if successful. | [
"Start",
"this",
"service",
".",
"Override",
"this",
"to",
"do",
"all",
"the",
"startup",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/server/RemoteSessionActivator.java#L27-L42 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/retention/dataset/FsCleanableHelper.java | FsCleanableHelper.clean | public void clean(final Collection<? extends FileSystemDatasetVersion> deletableVersions, final FileSystemDataset fsDataset) throws IOException {
"""
Delete all {@link FileSystemDatasetVersion}s <code>deletableVersions</code> and also delete any empty parent directories.
@param fsDataset to which the version be... | java | public void clean(final Collection<? extends FileSystemDatasetVersion> deletableVersions, final FileSystemDataset fsDataset) throws IOException {
if (deletableVersions.isEmpty()) {
log.warn("No deletable dataset version can be found. Ignoring.");
return;
}
Set<Path> possiblyEmptyDirectories = ne... | [
"public",
"void",
"clean",
"(",
"final",
"Collection",
"<",
"?",
"extends",
"FileSystemDatasetVersion",
">",
"deletableVersions",
",",
"final",
"FileSystemDataset",
"fsDataset",
")",
"throws",
"IOException",
"{",
"if",
"(",
"deletableVersions",
".",
"isEmpty",
"(",
... | Delete all {@link FileSystemDatasetVersion}s <code>deletableVersions</code> and also delete any empty parent directories.
@param fsDataset to which the version belongs. | [
"Delete",
"all",
"{",
"@link",
"FileSystemDatasetVersion",
"}",
"s",
"<code",
">",
"deletableVersions<",
"/",
"code",
">",
"and",
"also",
"delete",
"any",
"empty",
"parent",
"directories",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/retention/dataset/FsCleanableHelper.java#L143-L153 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java | TableUtils.waitUntilActive | public static void waitUntilActive(final AmazonDynamoDB dynamo, final String tableName)
throws InterruptedException, TableNeverTransitionedToStateException {
"""
Waits up to 10 minutes for a specified DynamoDB table to move into the
<code>ACTIVE</code> state. If the table does not exist or does not
transition... | java | public static void waitUntilActive(final AmazonDynamoDB dynamo, final String tableName)
throws InterruptedException, TableNeverTransitionedToStateException {
waitUntilActive(dynamo, tableName, DEFAULT_WAIT_TIMEOUT, DEFAULT_WAIT_INTERVAL);
} | [
"public",
"static",
"void",
"waitUntilActive",
"(",
"final",
"AmazonDynamoDB",
"dynamo",
",",
"final",
"String",
"tableName",
")",
"throws",
"InterruptedException",
",",
"TableNeverTransitionedToStateException",
"{",
"waitUntilActive",
"(",
"dynamo",
",",
"tableName",
"... | Waits up to 10 minutes for a specified DynamoDB table to move into the
<code>ACTIVE</code> state. If the table does not exist or does not
transition to the <code>ACTIVE</code> state after this time, then
SdkClientException is thrown.
@param dynamo
The DynamoDB client to use to make requests.
@param tableName
The name ... | [
"Waits",
"up",
"to",
"10",
"minutes",
"for",
"a",
"specified",
"DynamoDB",
"table",
"to",
"move",
"into",
"the",
"<code",
">",
"ACTIVE<",
"/",
"code",
">",
"state",
".",
"If",
"the",
"table",
"does",
"not",
"exist",
"or",
"does",
"not",
"transition",
"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java#L137-L140 |
bytefish/PgBulkInsert | PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/PgBulkInsert.java | PgBulkInsert.saveAll | public void saveAll(PGConnection connection, Stream<TEntity> entities) throws SQLException {
"""
Save stream of entities
@param connection underlying db connection
@param entities stream of entities
@throws SQLException
"""
try (PgBinaryWriter bw = new PgBinaryWriter(configuration.getBufferSize()... | java | public void saveAll(PGConnection connection, Stream<TEntity> entities) throws SQLException {
try (PgBinaryWriter bw = new PgBinaryWriter(configuration.getBufferSize())) {
// Wrap the CopyOutputStream in our own Writer:
bw.open(new PGCopyOutputStream(connection, mapping.getCopyCommand()... | [
"public",
"void",
"saveAll",
"(",
"PGConnection",
"connection",
",",
"Stream",
"<",
"TEntity",
">",
"entities",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"PgBinaryWriter",
"bw",
"=",
"new",
"PgBinaryWriter",
"(",
"configuration",
".",
"getBufferSize",
"(",... | Save stream of entities
@param connection underlying db connection
@param entities stream of entities
@throws SQLException | [
"Save",
"stream",
"of",
"entities"
] | train | https://github.com/bytefish/PgBulkInsert/blob/ed3dcdb95a66a38171016dee4a71642ac7cd4a11/PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/PgBulkInsert.java#L44-L54 |
camunda/camunda-xml-model | src/main/java/org/camunda/bpm/model/xml/impl/ModelImpl.java | ModelImpl.registerType | public void registerType(ModelElementType modelElementType, Class<? extends ModelElementInstance> instanceType) {
"""
Registers a {@link ModelElementType} in this {@link Model}.
@param modelElementType the element type to register
@param instanceType the instance class of the type to register
"""
QNa... | java | public void registerType(ModelElementType modelElementType, Class<? extends ModelElementInstance> instanceType) {
QName qName = ModelUtil.getQName(modelElementType.getTypeNamespace(), modelElementType.getTypeName());
typesByName.put(qName, modelElementType);
typesByClass.put(instanceType, modelElementType);... | [
"public",
"void",
"registerType",
"(",
"ModelElementType",
"modelElementType",
",",
"Class",
"<",
"?",
"extends",
"ModelElementInstance",
">",
"instanceType",
")",
"{",
"QName",
"qName",
"=",
"ModelUtil",
".",
"getQName",
"(",
"modelElementType",
".",
"getTypeNamesp... | Registers a {@link ModelElementType} in this {@link Model}.
@param modelElementType the element type to register
@param instanceType the instance class of the type to register | [
"Registers",
"a",
"{",
"@link",
"ModelElementType",
"}",
"in",
"this",
"{",
"@link",
"Model",
"}",
"."
] | train | https://github.com/camunda/camunda-xml-model/blob/85b3f879e26d063f71c94cfd21ac17d9ff6baf4d/src/main/java/org/camunda/bpm/model/xml/impl/ModelImpl.java#L106-L110 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/ByteArrayUtil.java | ByteArrayUtil.putShortLE | public static void putShortLE(final byte[] array, final int offset, final short value) {
"""
Put the source <i>short</i> into the destination byte array starting at the given offset
in little endian order.
There is no bounds checking.
@param array destination byte array
@param offset destination offset
@param... | java | public static void putShortLE(final byte[] array, final int offset, final short value) {
array[offset ] = (byte) (value );
array[offset + 1] = (byte) (value >>> 8);
} | [
"public",
"static",
"void",
"putShortLE",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
",",
"final",
"short",
"value",
")",
"{",
"array",
"[",
"offset",
"]",
"=",
"(",
"byte",
")",
"(",
"value",
")",
";",
"array",
"[",
"o... | Put the source <i>short</i> into the destination byte array starting at the given offset
in little endian order.
There is no bounds checking.
@param array destination byte array
@param offset destination offset
@param value source <i>short</i> | [
"Put",
"the",
"source",
"<i",
">",
"short<",
"/",
"i",
">",
"into",
"the",
"destination",
"byte",
"array",
"starting",
"at",
"the",
"given",
"offset",
"in",
"little",
"endian",
"order",
".",
"There",
"is",
"no",
"bounds",
"checking",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/ByteArrayUtil.java#L26-L29 |
tiesebarrell/process-assertions | process-assertions-api/src/main/java/org/toxos/processassertions/api/ProcessAssert.java | ProcessAssert.assertTaskUncompleted | public static final void assertTaskUncompleted(final String processInstanceId, final String taskDefinitionKey) {
"""
Asserts a task with the provided taskDefinitionKey is pending completion in the process instance with the
provided processInstanceId.
@param processInstanceId
the process instance's id to check... | java | public static final void assertTaskUncompleted(final String processInstanceId, final String taskDefinitionKey) {
Validate.notNull(processInstanceId);
Validate.notNull(taskDefinitionKey);
apiCallback.debug(LogMessage.TASK_1, taskDefinitionKey, processInstanceId);
try {
getTas... | [
"public",
"static",
"final",
"void",
"assertTaskUncompleted",
"(",
"final",
"String",
"processInstanceId",
",",
"final",
"String",
"taskDefinitionKey",
")",
"{",
"Validate",
".",
"notNull",
"(",
"processInstanceId",
")",
";",
"Validate",
".",
"notNull",
"(",
"task... | Asserts a task with the provided taskDefinitionKey is pending completion in the process instance with the
provided processInstanceId.
@param processInstanceId
the process instance's id to check for. May not be <code>null</code>
@param taskDefinitionKey
the task's definition key to check for. May not be <code>null</cod... | [
"Asserts",
"a",
"task",
"with",
"the",
"provided",
"taskDefinitionKey",
"is",
"pending",
"completion",
"in",
"the",
"process",
"instance",
"with",
"the",
"provided",
"processInstanceId",
"."
] | train | https://github.com/tiesebarrell/process-assertions/blob/932a8443982e356cdf5a230165a35c725d9306ab/process-assertions-api/src/main/java/org/toxos/processassertions/api/ProcessAssert.java#L142-L152 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java | SeleniumHelper.clickWithKeyDown | public void clickWithKeyDown(WebElement element, CharSequence key) {
"""
Simulates clicking with the supplied key pressed on the supplied element.
Key will be released after click.
@param element element to click on
"""
getActions().keyDown(key).click(element).keyUp(key).perform();
} | java | public void clickWithKeyDown(WebElement element, CharSequence key) {
getActions().keyDown(key).click(element).keyUp(key).perform();
} | [
"public",
"void",
"clickWithKeyDown",
"(",
"WebElement",
"element",
",",
"CharSequence",
"key",
")",
"{",
"getActions",
"(",
")",
".",
"keyDown",
"(",
"key",
")",
".",
"click",
"(",
"element",
")",
".",
"keyUp",
"(",
"key",
")",
".",
"perform",
"(",
")... | Simulates clicking with the supplied key pressed on the supplied element.
Key will be released after click.
@param element element to click on | [
"Simulates",
"clicking",
"with",
"the",
"supplied",
"key",
"pressed",
"on",
"the",
"supplied",
"element",
".",
"Key",
"will",
"be",
"released",
"after",
"click",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java#L573-L575 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java | RestClientUtil.addDocumentWithParentId | public String addDocumentWithParentId(String indexName, Object bean, Object parentId) throws ElasticSearchException {
"""
创建索引文档,根据elasticsearch.xml中指定的日期时间格式,生成对应时间段的索引表名称
For Elasticsearch 7 and 7+
@param indexName
@param bean
@return
@throws ElasticSearchException
"""
return addDocumentWithParentId... | java | public String addDocumentWithParentId(String indexName, Object bean, Object parentId) throws ElasticSearchException{
return addDocumentWithParentId( indexName, _doc,bean, parentId);
} | [
"public",
"String",
"addDocumentWithParentId",
"(",
"String",
"indexName",
",",
"Object",
"bean",
",",
"Object",
"parentId",
")",
"throws",
"ElasticSearchException",
"{",
"return",
"addDocumentWithParentId",
"(",
"indexName",
",",
"_doc",
",",
"bean",
",",
"parentId... | 创建索引文档,根据elasticsearch.xml中指定的日期时间格式,生成对应时间段的索引表名称
For Elasticsearch 7 and 7+
@param indexName
@param bean
@return
@throws ElasticSearchException | [
"创建索引文档,根据elasticsearch",
".",
"xml中指定的日期时间格式,生成对应时间段的索引表名称",
"For",
"Elasticsearch",
"7",
"and",
"7",
"+"
] | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java#L4110-L4112 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java | TypeAnnotationPosition.methodParameter | public static TypeAnnotationPosition
methodParameter(final List<TypePathEntry> location,
final int parameter_index) {
"""
Create a {@code TypeAnnotationPosition} for a method formal parameter.
@param location The type path.
@param parameter_index The index of the parameter.
... | java | public static TypeAnnotationPosition
methodParameter(final List<TypePathEntry> location,
final int parameter_index) {
return methodParameter(location, null, parameter_index, -1);
} | [
"public",
"static",
"TypeAnnotationPosition",
"methodParameter",
"(",
"final",
"List",
"<",
"TypePathEntry",
">",
"location",
",",
"final",
"int",
"parameter_index",
")",
"{",
"return",
"methodParameter",
"(",
"location",
",",
"null",
",",
"parameter_index",
",",
... | Create a {@code TypeAnnotationPosition} for a method formal parameter.
@param location The type path.
@param parameter_index The index of the parameter. | [
"Create",
"a",
"{",
"@code",
"TypeAnnotationPosition",
"}",
"for",
"a",
"method",
"formal",
"parameter",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java#L512-L516 |
Trilarion/java-vorbis-support | src/main/java/com/github/trilarion/sound/vorbis/sampled/DecodedVorbisAudioInputStream.java | DecodedVorbisAudioInputStream.readFromStream | private int readFromStream(byte[] buffer, int index, int bufferSize_) {
"""
Reads from the oggBitStream_ a specified number of Bytes(bufferSize_)
worth starting at index and puts them in the specified buffer[].
@param buffer
@param index
@param bufferSize_
@return the number of bytes read or -1 if error.
... | java | private int readFromStream(byte[] buffer, int index, int bufferSize_) {
int bytes;
try {
bytes = oggBitStream_.read(buffer, index, bufferSize_);
} catch (Exception e) {
LOG.log(Level.FINE, "Cannot Read Selected Song");
bytes = -1;
}
currentByte... | [
"private",
"int",
"readFromStream",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
",",
"int",
"bufferSize_",
")",
"{",
"int",
"bytes",
";",
"try",
"{",
"bytes",
"=",
"oggBitStream_",
".",
"read",
"(",
"buffer",
",",
"index",
",",
"bufferSize_",
... | Reads from the oggBitStream_ a specified number of Bytes(bufferSize_)
worth starting at index and puts them in the specified buffer[].
@param buffer
@param index
@param bufferSize_
@return the number of bytes read or -1 if error. | [
"Reads",
"from",
"the",
"oggBitStream_",
"a",
"specified",
"number",
"of",
"Bytes",
"(",
"bufferSize_",
")",
"worth",
"starting",
"at",
"index",
"and",
"puts",
"them",
"in",
"the",
"specified",
"buffer",
"[]",
"."
] | train | https://github.com/Trilarion/java-vorbis-support/blob/f72aba7d97167fe0ff20b1b719fdb5bb662ff736/src/main/java/com/github/trilarion/sound/vorbis/sampled/DecodedVorbisAudioInputStream.java#L421-L431 |
dihedron/dihedron-commons | src/main/java/org/dihedron/patterns/functional/Functional.java | Functional.forEach | public static final <S, E> S forEach(Set<E> set, S state, Fx<S, E> functor) {
"""
Applies the given functor to all elements in the input set.
@param set
the set to which the functor will be applied.
@param state
an state variable, that will be used as the return vale for the iteration.
@param functor
a fun... | java | public static final <S, E> S forEach(Set<E> set, S state, Fx<S, E> functor) {
return new FunctionalSet<S, E>(set).forEach(state, functor);
} | [
"public",
"static",
"final",
"<",
"S",
",",
"E",
">",
"S",
"forEach",
"(",
"Set",
"<",
"E",
">",
"set",
",",
"S",
"state",
",",
"Fx",
"<",
"S",
",",
"E",
">",
"functor",
")",
"{",
"return",
"new",
"FunctionalSet",
"<",
"S",
",",
"E",
">",
"("... | Applies the given functor to all elements in the input set.
@param set
the set to which the functor will be applied.
@param state
an state variable, that will be used as the return vale for the iteration.
@param functor
a function to be applied to all elements in the set.
@return
the state object after the processing. | [
"Applies",
"the",
"given",
"functor",
"to",
"all",
"elements",
"in",
"the",
"input",
"set",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/patterns/functional/Functional.java#L87-L89 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_udp_frontend_frontendId_PUT | public void serviceName_udp_frontend_frontendId_PUT(String serviceName, Long frontendId, OvhFrontendUdp body) throws IOException {
"""
Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/udp/frontend/{frontendId}
@param body [required] New object properties
@param serviceName [required] The ... | java | public void serviceName_udp_frontend_frontendId_PUT(String serviceName, Long frontendId, OvhFrontendUdp body) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/udp/frontend/{frontendId}";
StringBuilder sb = path(qPath, serviceName, frontendId);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_udp_frontend_frontendId_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"frontendId",
",",
"OvhFrontendUdp",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/udp/frontend/{frontendId}\"",
";",... | Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/udp/frontend/{frontendId}
@param body [required] New object properties
@param serviceName [required] The internal name of your IP load balancing
@param frontendId [required] Id of your frontend
API beta | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L773-L777 |
radkovo/CSSBox | src/main/java/org/fit/cssbox/layout/CSSDecoder.java | CSSDecoder.getLength | public int getLength(TermLengthOrPercent value, boolean auto, TermLengthOrPercent defval, TermLengthOrPercent autoval, int whole) {
"""
Returns the length in pixels from a CSS definition. <code>null</code> values
of the lengths are interpreted as zero.
@param value The length or percentage value to be converted
... | java | public int getLength(TermLengthOrPercent value, boolean auto, TermLengthOrPercent defval, TermLengthOrPercent autoval, int whole)
{
TermLengthOrPercent val = value;
if (value == null) val = defval;
if (auto) val = autoval;
if (val != null)
return (int) context.pxLength(va... | [
"public",
"int",
"getLength",
"(",
"TermLengthOrPercent",
"value",
",",
"boolean",
"auto",
",",
"TermLengthOrPercent",
"defval",
",",
"TermLengthOrPercent",
"autoval",
",",
"int",
"whole",
")",
"{",
"TermLengthOrPercent",
"val",
"=",
"value",
";",
"if",
"(",
"va... | Returns the length in pixels from a CSS definition. <code>null</code> values
of the lengths are interpreted as zero.
@param value The length or percentage value to be converted
@param auto True, if the property is set to <code>auto</code>
@param defval The length value to be used when the first one is null
@param autov... | [
"Returns",
"the",
"length",
"in",
"pixels",
"from",
"a",
"CSS",
"definition",
".",
"<code",
">",
"null<",
"/",
"code",
">",
"values",
"of",
"the",
"lengths",
"are",
"interpreted",
"as",
"zero",
"."
] | train | https://github.com/radkovo/CSSBox/blob/38aaf8f22d233d7b4dbc12a56cdbc72b447bc559/src/main/java/org/fit/cssbox/layout/CSSDecoder.java#L80-L89 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/ST_Delaunay.java | ST_Delaunay.createDT | public static GeometryCollection createDT(Geometry geometry, int flag) throws SQLException {
"""
Build a delaunay triangulation based on all coordinates of the geometry
@param geometry
@param flag for flag=0 (default flag) or a MULTILINESTRING for flag=1
@return a set of polygons (triangles)
@throws SQLExce... | java | public static GeometryCollection createDT(Geometry geometry, int flag) throws SQLException {
if (geometry != null) {
DelaunayTriangulationBuilder triangulationBuilder = new DelaunayTriangulationBuilder();
triangulationBuilder.setSites(geometry);
if(flag == 0) {
... | [
"public",
"static",
"GeometryCollection",
"createDT",
"(",
"Geometry",
"geometry",
",",
"int",
"flag",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geometry",
"!=",
"null",
")",
"{",
"DelaunayTriangulationBuilder",
"triangulationBuilder",
"=",
"new",
"DelaunayTri... | Build a delaunay triangulation based on all coordinates of the geometry
@param geometry
@param flag for flag=0 (default flag) or a MULTILINESTRING for flag=1
@return a set of polygons (triangles)
@throws SQLException | [
"Build",
"a",
"delaunay",
"triangulation",
"based",
"on",
"all",
"coordinates",
"of",
"the",
"geometry"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/ST_Delaunay.java#L71-L82 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java | CPOptionPersistenceImpl.fetchByG_K | @Override
public CPOption fetchByG_K(long groupId, String key) {
"""
Returns the cp option where groupId = ? and key = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param key the key
@return the matching cp option, or <code>null</code> if... | java | @Override
public CPOption fetchByG_K(long groupId, String key) {
return fetchByG_K(groupId, key, true);
} | [
"@",
"Override",
"public",
"CPOption",
"fetchByG_K",
"(",
"long",
"groupId",
",",
"String",
"key",
")",
"{",
"return",
"fetchByG_K",
"(",
"groupId",
",",
"key",
",",
"true",
")",
";",
"}"
] | Returns the cp option where groupId = ? and key = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param key the key
@return the matching cp option, or <code>null</code> if a matching cp option could not be found | [
"Returns",
"the",
"cp",
"option",
"where",
"groupId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"finder",
"cache",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java#L2027-L2030 |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/ModelUtils.java | ModelUtils.tryToSetValueThroughSetter | private static boolean tryToSetValueThroughSetter(OpenEngSBModelEntry entry, Object instance)
throws IllegalAccessException {
"""
Tries to set the value of an OpenEngSBModelEntry to its corresponding setter of the model. Returns true if the
setter can be called, returns false if not.
"""
try {... | java | private static boolean tryToSetValueThroughSetter(OpenEngSBModelEntry entry, Object instance)
throws IllegalAccessException {
try {
String setterName = getSetterName(entry.getKey());
Method method = instance.getClass().getMethod(setterName, entry.getType());
method.in... | [
"private",
"static",
"boolean",
"tryToSetValueThroughSetter",
"(",
"OpenEngSBModelEntry",
"entry",
",",
"Object",
"instance",
")",
"throws",
"IllegalAccessException",
"{",
"try",
"{",
"String",
"setterName",
"=",
"getSetterName",
"(",
"entry",
".",
"getKey",
"(",
")... | Tries to set the value of an OpenEngSBModelEntry to its corresponding setter of the model. Returns true if the
setter can be called, returns false if not. | [
"Tries",
"to",
"set",
"the",
"value",
"of",
"an",
"OpenEngSBModelEntry",
"to",
"its",
"corresponding",
"setter",
"of",
"the",
"model",
".",
"Returns",
"true",
"if",
"the",
"setter",
"can",
"be",
"called",
"returns",
"false",
"if",
"not",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/ModelUtils.java#L96-L111 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AbstractCodeGen.java | AbstractCodeGen.writeSimpleMethodSignature | protected void writeSimpleMethodSignature(Writer out, int indent, String javadoc, String signature)
throws IOException {
"""
write a simple method signature
@param out the writer
@param indent indent
@param javadoc javadoc strinf
@param signature signatore of the method
@throws IOException excption
... | java | protected void writeSimpleMethodSignature(Writer out, int indent, String javadoc, String signature)
throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeIndent(out, indent);
out.write(javadoc);
writeEol(out);
writeWithIndent(out, indent, " */\n");
writeIndent... | [
"protected",
"void",
"writeSimpleMethodSignature",
"(",
"Writer",
"out",
",",
"int",
"indent",
",",
"String",
"javadoc",
",",
"String",
"signature",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"... | write a simple method signature
@param out the writer
@param indent indent
@param javadoc javadoc strinf
@param signature signatore of the method
@throws IOException excption | [
"write",
"a",
"simple",
"method",
"signature"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AbstractCodeGen.java#L93-L104 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/MiniSat.java | MiniSat.generateBlockingClause | private LNGIntVector generateBlockingClause(final LNGBooleanVector modelFromSolver, final LNGIntVector relevantVars) {
"""
Generates a blocking clause from a given model and a set of relevant variables.
@param modelFromSolver the current model for which the blocking clause should be generated
@param relevantVars... | java | private LNGIntVector generateBlockingClause(final LNGBooleanVector modelFromSolver, final LNGIntVector relevantVars) {
final LNGIntVector blockingClause;
if (relevantVars != null) {
blockingClause = new LNGIntVector(relevantVars.size());
for (int i = 0; i < relevantVars.size(); i++) {
final ... | [
"private",
"LNGIntVector",
"generateBlockingClause",
"(",
"final",
"LNGBooleanVector",
"modelFromSolver",
",",
"final",
"LNGIntVector",
"relevantVars",
")",
"{",
"final",
"LNGIntVector",
"blockingClause",
";",
"if",
"(",
"relevantVars",
"!=",
"null",
")",
"{",
"blocki... | Generates a blocking clause from a given model and a set of relevant variables.
@param modelFromSolver the current model for which the blocking clause should be generated
@param relevantVars the indices of the relevant variables. If {@code null} all variables are relevant.
@return the blocking clause for the given ... | [
"Generates",
"a",
"blocking",
"clause",
"from",
"a",
"given",
"model",
"and",
"a",
"set",
"of",
"relevant",
"variables",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/MiniSat.java#L371-L390 |
ragnor/simple-spring-memcached | simple-spring-memcached/src/main/java/com/google/code/ssm/json/ClassAliasIdResolver.java | ClassAliasIdResolver.addClassToId | public void addClassToId(final Class<?> clazz, final String id) {
"""
Adds single mapping: class <-> alias (id).
@param clazz
@param id
"""
Assert.notNull(clazz, "Class cannot be null");
Assert.hasText(id, "Alias (id) cannot be null or contain only whitespaces");
if (classToId.cont... | java | public void addClassToId(final Class<?> clazz, final String id) {
Assert.notNull(clazz, "Class cannot be null");
Assert.hasText(id, "Alias (id) cannot be null or contain only whitespaces");
if (classToId.containsKey(clazz)) {
throw new IllegalArgumentException("Class " + clazz + " h... | [
"public",
"void",
"addClassToId",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"String",
"id",
")",
"{",
"Assert",
".",
"notNull",
"(",
"clazz",
",",
"\"Class cannot be null\"",
")",
";",
"Assert",
".",
"hasText",
"(",
"id",
",",
"\"Alias... | Adds single mapping: class <-> alias (id).
@param clazz
@param id | [
"Adds",
"single",
"mapping",
":",
"class",
"<",
"-",
">",
"alias",
"(",
"id",
")",
"."
] | train | https://github.com/ragnor/simple-spring-memcached/blob/83db68aa1af219397e132426e377d45f397d31e7/simple-spring-memcached/src/main/java/com/google/code/ssm/json/ClassAliasIdResolver.java#L92-L108 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/Pattern.java | Pattern.matchClause | private boolean matchClause(Clause clause, char[] chars, int[] cursor) {
"""
Match one clause against a character sequence (used by checkPrefix and matchMiddle)
"""
if (clause.minlen > cursor[1] - cursor[0])
return false;
for (int i = 0; i < clause.items.length; i++) {
Object item = clause.... | java | private boolean matchClause(Clause clause, char[] chars, int[] cursor) {
if (clause.minlen > cursor[1] - cursor[0])
return false;
for (int i = 0; i < clause.items.length; i++) {
Object item = clause.items[i];
if (item == matchOne)
cursor[0]++;
else if (!matchForward(chars, (char[... | [
"private",
"boolean",
"matchClause",
"(",
"Clause",
"clause",
",",
"char",
"[",
"]",
"chars",
",",
"int",
"[",
"]",
"cursor",
")",
"{",
"if",
"(",
"clause",
".",
"minlen",
">",
"cursor",
"[",
"1",
"]",
"-",
"cursor",
"[",
"0",
"]",
")",
"return",
... | Match one clause against a character sequence (used by checkPrefix and matchMiddle) | [
"Match",
"one",
"clause",
"against",
"a",
"character",
"sequence",
"(",
"used",
"by",
"checkPrefix",
"and",
"matchMiddle",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/Pattern.java#L188-L200 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/XMLFilterImpl.java | XMLFilterImpl.setProperty | public void setProperty (String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
"""
Set the value of a property.
<p>This will always fail if the parent is null.</p>
@param name The property name.
@param value The requested property value.
@exception org.xml.sax.SAXNotRe... | java | public void setProperty (String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException
{
if (parent != null) {
parent.setProperty(name, value);
} else {
throw new SAXNotRecognizedException("Property: " + name);
}
} | [
"public",
"void",
"setProperty",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"throws",
"SAXNotRecognizedException",
",",
"SAXNotSupportedException",
"{",
"if",
"(",
"parent",
"!=",
"null",
")",
"{",
"parent",
".",
"setProperty",
"(",
"name",
",",
"valu... | Set the value of a property.
<p>This will always fail if the parent is null.</p>
@param name The property name.
@param value The requested property value.
@exception org.xml.sax.SAXNotRecognizedException If the property
value can't be assigned or retrieved from the parent.
@exception org.xml.sax.SAXNotSupportedExcept... | [
"Set",
"the",
"value",
"of",
"a",
"property",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/XMLFilterImpl.java#L197-L205 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/Config.java | Config.setQuorumConfigs | public Config setQuorumConfigs(Map<String, QuorumConfig> quorumConfigs) {
"""
Sets the map of split-brain protection configurations, mapped by config
name. The config name may be a pattern with which the configuration
will be obtained in the future.
@param quorumConfigs the split-brain protection configuratio... | java | public Config setQuorumConfigs(Map<String, QuorumConfig> quorumConfigs) {
this.quorumConfigs.clear();
this.quorumConfigs.putAll(quorumConfigs);
for (final Entry<String, QuorumConfig> entry : this.quorumConfigs.entrySet()) {
entry.getValue().setName(entry.getKey());
}
... | [
"public",
"Config",
"setQuorumConfigs",
"(",
"Map",
"<",
"String",
",",
"QuorumConfig",
">",
"quorumConfigs",
")",
"{",
"this",
".",
"quorumConfigs",
".",
"clear",
"(",
")",
";",
"this",
".",
"quorumConfigs",
".",
"putAll",
"(",
"quorumConfigs",
")",
";",
... | Sets the map of split-brain protection configurations, mapped by config
name. The config name may be a pattern with which the configuration
will be obtained in the future.
@param quorumConfigs the split-brain protection configuration map to set
@return this config instance | [
"Sets",
"the",
"map",
"of",
"split",
"-",
"brain",
"protection",
"configurations",
"mapped",
"by",
"config",
"name",
".",
"The",
"config",
"name",
"may",
"be",
"a",
"pattern",
"with",
"which",
"the",
"configuration",
"will",
"be",
"obtained",
"in",
"the",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/Config.java#L2608-L2615 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.