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 |
|---|---|---|---|---|---|---|---|---|---|---|
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java | BaseMigrationOperation.verifyPartitionStateVersion | private void verifyPartitionStateVersion() {
"""
Verifies that the sent partition state version matches the local version or this node is master.
"""
InternalPartitionService partitionService = getService();
int localPartitionStateVersion = partitionService.getPartitionStateVersion();
i... | java | private void verifyPartitionStateVersion() {
InternalPartitionService partitionService = getService();
int localPartitionStateVersion = partitionService.getPartitionStateVersion();
if (partitionStateVersion != localPartitionStateVersion) {
if (getNodeEngine().getThisAddress().equals(... | [
"private",
"void",
"verifyPartitionStateVersion",
"(",
")",
"{",
"InternalPartitionService",
"partitionService",
"=",
"getService",
"(",
")",
";",
"int",
"localPartitionStateVersion",
"=",
"partitionService",
".",
"getPartitionStateVersion",
"(",
")",
";",
"if",
"(",
... | Verifies that the sent partition state version matches the local version or this node is master. | [
"Verifies",
"that",
"the",
"sent",
"partition",
"state",
"version",
"matches",
"the",
"local",
"version",
"or",
"this",
"node",
"is",
"master",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/operation/BaseMigrationOperation.java#L118-L129 |
Jasig/uPortal | uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/firewall/RequestParameterPolicyEnforcementFilter.java | RequestParameterPolicyEnforcementFilter.requireNotMultiValued | static void requireNotMultiValued(final Set<String> parametersToCheck, final Map parameterMap) {
"""
For each parameter to check, verify that it has zero or one value.
<p>The Set of parameters to check MAY be empty. The parameter map MAY NOT contain any given
parameter to check.
<p>This method is an impleme... | java | static void requireNotMultiValued(final Set<String> parametersToCheck, final Map parameterMap) {
for (final String parameterName : parametersToCheck) {
if (parameterMap.containsKey(parameterName)) {
final String[] values = (String[]) parameterMap.get(parameterName);
... | [
"static",
"void",
"requireNotMultiValued",
"(",
"final",
"Set",
"<",
"String",
">",
"parametersToCheck",
",",
"final",
"Map",
"parameterMap",
")",
"{",
"for",
"(",
"final",
"String",
"parameterName",
":",
"parametersToCheck",
")",
"{",
"if",
"(",
"parameterMap",... | For each parameter to check, verify that it has zero or one value.
<p>The Set of parameters to check MAY be empty. The parameter map MAY NOT contain any given
parameter to check.
<p>This method is an implementation detail and is not exposed API. This method is only
non-private to allow JUnit testing.
<p>Static, stat... | [
"For",
"each",
"parameter",
"to",
"check",
"verify",
"that",
"it",
"has",
"zero",
"or",
"one",
"value",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/firewall/RequestParameterPolicyEnforcementFilter.java#L434-L449 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java | FirewallClient.insertFirewall | @BetaApi
public final Operation insertFirewall(ProjectName project, Firewall firewallResource) {
"""
Creates a firewall rule in the specified project using the data included in the request.
<p>Sample code:
<pre><code>
try (FirewallClient firewallClient = FirewallClient.create()) {
ProjectName project = P... | java | @BetaApi
public final Operation insertFirewall(ProjectName project, Firewall firewallResource) {
InsertFirewallHttpRequest request =
InsertFirewallHttpRequest.newBuilder()
.setProject(project == null ? null : project.toString())
.setFirewallResource(firewallResource)
.... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertFirewall",
"(",
"ProjectName",
"project",
",",
"Firewall",
"firewallResource",
")",
"{",
"InsertFirewallHttpRequest",
"request",
"=",
"InsertFirewallHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setProject",
"(... | Creates a firewall rule in the specified project using the data included in the request.
<p>Sample code:
<pre><code>
try (FirewallClient firewallClient = FirewallClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
Firewall firewallResource = Firewall.newBuilder().build();
Operation response = firewa... | [
"Creates",
"a",
"firewall",
"rule",
"in",
"the",
"specified",
"project",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FirewallClient.java#L366-L375 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java | PredictionsImpl.predictImageWithNoStore | public ImagePrediction predictImageWithNoStore(UUID projectId, byte[] imageData, PredictImageWithNoStoreOptionalParameter predictImageWithNoStoreOptionalParameter) {
"""
Predict an image without saving the result.
@param projectId The project id
@param imageData the InputStream value
@param predictImageWithNo... | java | public ImagePrediction predictImageWithNoStore(UUID projectId, byte[] imageData, PredictImageWithNoStoreOptionalParameter predictImageWithNoStoreOptionalParameter) {
return predictImageWithNoStoreWithServiceResponseAsync(projectId, imageData, predictImageWithNoStoreOptionalParameter).toBlocking().single().body(... | [
"public",
"ImagePrediction",
"predictImageWithNoStore",
"(",
"UUID",
"projectId",
",",
"byte",
"[",
"]",
"imageData",
",",
"PredictImageWithNoStoreOptionalParameter",
"predictImageWithNoStoreOptionalParameter",
")",
"{",
"return",
"predictImageWithNoStoreWithServiceResponseAsync",
... | Predict an image without saving the result.
@param projectId The project id
@param imageData the InputStream value
@param predictImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
... | [
"Predict",
"an",
"image",
"without",
"saving",
"the",
"result",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java#L97-L99 |
ixa-ehu/kaflib | src/main/java/ixa/kaflib/KAFDocument.java | KAFDocument.newCategory | public Feature newCategory(String lemma, List<Span<Term>> references) {
"""
Creates a new category. It assigns an appropriate ID to it. The category is added to the document.
@param lemma the lemma of the category.
@param references different mentions (list of targets) to the same category.
@return a new corefe... | java | public Feature newCategory(String lemma, List<Span<Term>> references) {
String newId = idManager.getNextId(AnnotationType.CATEGORY);
Feature newCategory = new Feature(newId, lemma, references);
annotationContainer.add(newCategory, Layer.CATEGORIES, AnnotationType.CATEGORY);
return newCategory;
} | [
"public",
"Feature",
"newCategory",
"(",
"String",
"lemma",
",",
"List",
"<",
"Span",
"<",
"Term",
">",
">",
"references",
")",
"{",
"String",
"newId",
"=",
"idManager",
".",
"getNextId",
"(",
"AnnotationType",
".",
"CATEGORY",
")",
";",
"Feature",
"newCat... | Creates a new category. It assigns an appropriate ID to it. The category is added to the document.
@param lemma the lemma of the category.
@param references different mentions (list of targets) to the same category.
@return a new coreference. | [
"Creates",
"a",
"new",
"category",
".",
"It",
"assigns",
"an",
"appropriate",
"ID",
"to",
"it",
".",
"The",
"category",
"is",
"added",
"to",
"the",
"document",
"."
] | train | https://github.com/ixa-ehu/kaflib/blob/3921f55d9ae4621736a329418f6334fb721834b8/src/main/java/ixa/kaflib/KAFDocument.java#L939-L944 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java | GeneSequence.addExon | public ExonSequence addExon(AccessionID accession, int begin, int end) throws Exception {
"""
Add an ExonSequence mainly used to mark as a feature
@param accession
@param begin
@param end
@return exon sequence
"""
if (exonSequenceHashMap.containsKey(accession.getID())) {
throw new Exception("Duplicate... | java | public ExonSequence addExon(AccessionID accession, int begin, int end) throws Exception {
if (exonSequenceHashMap.containsKey(accession.getID())) {
throw new Exception("Duplicate accesion id " + accession.getID());
}
ExonSequence exonSequence = new ExonSequence(this, begin, end); //sense should be the same as... | [
"public",
"ExonSequence",
"addExon",
"(",
"AccessionID",
"accession",
",",
"int",
"begin",
",",
"int",
"end",
")",
"throws",
"Exception",
"{",
"if",
"(",
"exonSequenceHashMap",
".",
"containsKey",
"(",
"accession",
".",
"getID",
"(",
")",
")",
")",
"{",
"t... | Add an ExonSequence mainly used to mark as a feature
@param accession
@param begin
@param end
@return exon sequence | [
"Add",
"an",
"ExonSequence",
"mainly",
"used",
"to",
"mark",
"as",
"a",
"feature"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java#L261-L271 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.assertSeleniumNElementExists | @Then("^'(\\d+?)' elements? exists? with '([^:]*?):(.+?)'$")
public void assertSeleniumNElementExists(Integer expectedCount, String method, String element) throws ClassNotFoundException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
"""
Checks if {@code expectedCou... | java | @Then("^'(\\d+?)' elements? exists? with '([^:]*?):(.+?)'$")
public void assertSeleniumNElementExists(Integer expectedCount, String method, String element) throws ClassNotFoundException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
List<WebElement> wel = common... | [
"@",
"Then",
"(",
"\"^'(\\\\d+?)' elements? exists? with '([^:]*?):(.+?)'$\"",
")",
"public",
"void",
"assertSeleniumNElementExists",
"(",
"Integer",
"expectedCount",
",",
"String",
"method",
",",
"String",
"element",
")",
"throws",
"ClassNotFoundException",
",",
"NoSuchFie... | Checks if {@code expectedCount} webelements are found, with a location {@code method}.
@param expectedCount
@param method
@param element
@throws IllegalAccessException
@throws IllegalArgumentException
@throws SecurityException
@throws NoSuchFieldException
@throws ClassNotFoundException | [
"Checks",
"if",
"{",
"@code",
"expectedCount",
"}",
"webelements",
"are",
"found",
"with",
"a",
"location",
"{",
"@code",
"method",
"}",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L435-L440 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyJs.java | RecurlyJs.getRecurlySignature | public static String getRecurlySignature(String privateJsKey, List<String> extraParams) {
"""
Get Recurly.js Signature
See spec here: https://docs.recurly.com/deprecated-api-docs/recurlyjs/signatures
<p>
Returns a signature key for use with recurly.js BuildSubscriptionForm.
@param privateJsKey recurly.js pri... | java | public static String getRecurlySignature(String privateJsKey, List<String> extraParams) {
final long unixTime = System.currentTimeMillis() / 1000L;
final String uuid = UUID.randomUUID().toString().replaceAll("-", "");
return getRecurlySignature(privateJsKey, unixTime, uuid, extraParams);
} | [
"public",
"static",
"String",
"getRecurlySignature",
"(",
"String",
"privateJsKey",
",",
"List",
"<",
"String",
">",
"extraParams",
")",
"{",
"final",
"long",
"unixTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"/",
"1000L",
";",
"final",
"String",
... | Get Recurly.js Signature
See spec here: https://docs.recurly.com/deprecated-api-docs/recurlyjs/signatures
<p>
Returns a signature key for use with recurly.js BuildSubscriptionForm.
@param privateJsKey recurly.js private key
@param extraParams extra parameters to include in the signature
@return signature string on suc... | [
"Get",
"Recurly",
".",
"js",
"Signature",
"See",
"spec",
"here",
":",
"https",
":",
"//",
"docs",
".",
"recurly",
".",
"com",
"/",
"deprecated",
"-",
"api",
"-",
"docs",
"/",
"recurlyjs",
"/",
"signatures",
"<p",
">",
"Returns",
"a",
"signature",
"key"... | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyJs.java#L65-L69 |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.generatePdf | private void generatePdf() {
"""
Generates a pdf report in the same directory as the html report
"""
File pdfFile = new File(directory, filename + ".pdf");
try (OutputStream os = new FileOutputStream(pdfFile)) {
PdfRendererBuilder builder = new PdfRendererBuilder();
buil... | java | private void generatePdf() {
File pdfFile = new File(directory, filename + ".pdf");
try (OutputStream os = new FileOutputStream(pdfFile)) {
PdfRendererBuilder builder = new PdfRendererBuilder();
builder.withHtmlContent(getHtmlForPDFConversion(), "file://" + pdfFile.getAbsolutePat... | [
"private",
"void",
"generatePdf",
"(",
")",
"{",
"File",
"pdfFile",
"=",
"new",
"File",
"(",
"directory",
",",
"filename",
"+",
"\".pdf\"",
")",
";",
"try",
"(",
"OutputStream",
"os",
"=",
"new",
"FileOutputStream",
"(",
"pdfFile",
")",
")",
"{",
"PdfRen... | Generates a pdf report in the same directory as the html report | [
"Generates",
"a",
"pdf",
"report",
"in",
"the",
"same",
"directory",
"as",
"the",
"html",
"report"
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L741-L752 |
appium/java-client | src/main/java/io/appium/java_client/imagecomparison/OccurrenceMatchingResult.java | OccurrenceMatchingResult.getRect | public Rectangle getRect() {
"""
Returns rectangle of partial image occurrence.
@return The region of the partial image occurrence on the full image.
"""
verifyPropertyPresence(RECT);
//noinspection unchecked
return mapToRect((Map<String, Object>) getCommandResult().get(RECT));
} | java | public Rectangle getRect() {
verifyPropertyPresence(RECT);
//noinspection unchecked
return mapToRect((Map<String, Object>) getCommandResult().get(RECT));
} | [
"public",
"Rectangle",
"getRect",
"(",
")",
"{",
"verifyPropertyPresence",
"(",
"RECT",
")",
";",
"//noinspection unchecked",
"return",
"mapToRect",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"getCommandResult",
"(",
")",
".",
"get",
"(",
"RECT... | Returns rectangle of partial image occurrence.
@return The region of the partial image occurrence on the full image. | [
"Returns",
"rectangle",
"of",
"partial",
"image",
"occurrence",
"."
] | train | https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/imagecomparison/OccurrenceMatchingResult.java#L35-L39 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/PeriodDuration.java | PeriodDuration.of | public static PeriodDuration of(Duration duration) {
"""
Obtains an instance based on a duration.
<p>
The period will be zero.
@param duration the duration, not null
@return the combined period-duration, not null
"""
Objects.requireNonNull(duration, "The duration must not be null");
retu... | java | public static PeriodDuration of(Duration duration) {
Objects.requireNonNull(duration, "The duration must not be null");
return new PeriodDuration(Period.ZERO, duration);
} | [
"public",
"static",
"PeriodDuration",
"of",
"(",
"Duration",
"duration",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"duration",
",",
"\"The duration must not be null\"",
")",
";",
"return",
"new",
"PeriodDuration",
"(",
"Period",
".",
"ZERO",
",",
"duration"... | Obtains an instance based on a duration.
<p>
The period will be zero.
@param duration the duration, not null
@return the combined period-duration, not null | [
"Obtains",
"an",
"instance",
"based",
"on",
"a",
"duration",
".",
"<p",
">",
"The",
"period",
"will",
"be",
"zero",
"."
] | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/PeriodDuration.java#L152-L155 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionValuePersistenceImpl.java | CPOptionValuePersistenceImpl.removeByUuid_C | @Override
public void removeByUuid_C(String uuid, long companyId) {
"""
Removes all the cp option values where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID
"""
for (CPOptionValue cpOptionValue : findByUuid_C(uuid, companyId,
QueryUtil.ALL... | java | @Override
public void removeByUuid_C(String uuid, long companyId) {
for (CPOptionValue cpOptionValue : findByUuid_C(uuid, companyId,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpOptionValue);
}
} | [
"@",
"Override",
"public",
"void",
"removeByUuid_C",
"(",
"String",
"uuid",
",",
"long",
"companyId",
")",
"{",
"for",
"(",
"CPOptionValue",
"cpOptionValue",
":",
"findByUuid_C",
"(",
"uuid",
",",
"companyId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil"... | Removes all the cp option values where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID | [
"Removes",
"all",
"the",
"cp",
"option",
"values",
"where",
"uuid",
"=",
"?",
";",
"and",
"companyId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionValuePersistenceImpl.java#L1400-L1406 |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/impl/LogReader.java | LogReader.reportDrop | private void reportDrop(long bytes, Throwable reason) {
"""
Reports dropped bytes to the monitor.
The buffer must be updated to remove the dropped bytes prior to invocation.
"""
if (monitor != null) {
monitor.corruption(bytes, reason);
}
} | java | private void reportDrop(long bytes, Throwable reason)
{
if (monitor != null) {
monitor.corruption(bytes, reason);
}
} | [
"private",
"void",
"reportDrop",
"(",
"long",
"bytes",
",",
"Throwable",
"reason",
")",
"{",
"if",
"(",
"monitor",
"!=",
"null",
")",
"{",
"monitor",
".",
"corruption",
"(",
"bytes",
",",
"reason",
")",
";",
"}",
"}"
] | Reports dropped bytes to the monitor.
The buffer must be updated to remove the dropped bytes prior to invocation. | [
"Reports",
"dropped",
"bytes",
"to",
"the",
"monitor",
".",
"The",
"buffer",
"must",
"be",
"updated",
"to",
"remove",
"the",
"dropped",
"bytes",
"prior",
"to",
"invocation",
"."
] | train | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/impl/LogReader.java#L348-L353 |
couchbase/CouchbaseMock | src/main/java/com/couchbase/mock/memcached/VBucketStore.java | VBucketStore.forceStorageMutation | void forceStorageMutation(Item itm, VBucketCoordinates coords) {
"""
Force a storage of an item to the cache.
This assumes the current object belongs to a replica, as it will blindly
assume information passed here is authoritative.
@param itm The item to mutate (should be a copy of the original)
@param coo... | java | void forceStorageMutation(Item itm, VBucketCoordinates coords) {
forceMutation(itm.getKeySpec().vbId, itm, coords, false);
} | [
"void",
"forceStorageMutation",
"(",
"Item",
"itm",
",",
"VBucketCoordinates",
"coords",
")",
"{",
"forceMutation",
"(",
"itm",
".",
"getKeySpec",
"(",
")",
".",
"vbId",
",",
"itm",
",",
"coords",
",",
"false",
")",
";",
"}"
] | Force a storage of an item to the cache.
This assumes the current object belongs to a replica, as it will blindly
assume information passed here is authoritative.
@param itm The item to mutate (should be a copy of the original)
@param coords Coordinate info | [
"Force",
"a",
"storage",
"of",
"an",
"item",
"to",
"the",
"cache",
"."
] | train | https://github.com/couchbase/CouchbaseMock/blob/2085bbebade1d5b6356480e7bf335139d08383da/src/main/java/com/couchbase/mock/memcached/VBucketStore.java#L312-L314 |
dhanji/sitebricks | sitebricks-converter/src/main/java/com/google/sitebricks/conversion/generics/Generics.java | Generics.getExactReturnType | public static Type getExactReturnType(Method m, Type type) {
"""
Returns the exact return type of the given method in the given type. This
may be different from <tt>m.getGenericReturnType()</tt> when the method
was declared in a superclass, of <tt>type</tt> is a raw type.
"""
Type returnType = m.getGeneri... | java | public static Type getExactReturnType(Method m, Type type)
{
Type returnType = m.getGenericReturnType();
Type exactDeclaringType = getExactSuperType(capture(type), m.getDeclaringClass());
return mapTypeParameters(returnType, exactDeclaringType);
} | [
"public",
"static",
"Type",
"getExactReturnType",
"(",
"Method",
"m",
",",
"Type",
"type",
")",
"{",
"Type",
"returnType",
"=",
"m",
".",
"getGenericReturnType",
"(",
")",
";",
"Type",
"exactDeclaringType",
"=",
"getExactSuperType",
"(",
"capture",
"(",
"type"... | Returns the exact return type of the given method in the given type. This
may be different from <tt>m.getGenericReturnType()</tt> when the method
was declared in a superclass, of <tt>type</tt> is a raw type. | [
"Returns",
"the",
"exact",
"return",
"type",
"of",
"the",
"given",
"method",
"in",
"the",
"given",
"type",
".",
"This",
"may",
"be",
"different",
"from",
"<tt",
">",
"m",
".",
"getGenericReturnType",
"()",
"<",
"/",
"tt",
">",
"when",
"the",
"method",
... | train | https://github.com/dhanji/sitebricks/blob/8682029a78bd48fb8566173d970800499e9e5d97/sitebricks-converter/src/main/java/com/google/sitebricks/conversion/generics/Generics.java#L473-L478 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.javaeesec/src/com/ibm/ws/security/javaeesec/identitystore/ELHelper.java | ELHelper.processString | @FFDCIgnore(ELException.class)
@Trivial
protected String processString(String name, String expression, boolean immediateOnly, boolean mask) {
"""
This method will process a configuration value for any configuration setting in
{@link LdapIdentityStoreDefinition} or {@link DatabaseIdentityStoreDefinition} t... | java | @FFDCIgnore(ELException.class)
@Trivial
protected String processString(String name, String expression, boolean immediateOnly, boolean mask) {
final String methodName = "processString";
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, methodName, new Ob... | [
"@",
"FFDCIgnore",
"(",
"ELException",
".",
"class",
")",
"@",
"Trivial",
"protected",
"String",
"processString",
"(",
"String",
"name",
",",
"String",
"expression",
",",
"boolean",
"immediateOnly",
",",
"boolean",
"mask",
")",
"{",
"final",
"String",
"methodN... | This method will process a configuration value for any configuration setting in
{@link LdapIdentityStoreDefinition} or {@link DatabaseIdentityStoreDefinition} that
is a string and whose name is NOT a "*Expression". It will first check to see if it
is a EL expression. It it is, it will return the evaluated expression; o... | [
"This",
"method",
"will",
"process",
"a",
"configuration",
"value",
"for",
"any",
"configuration",
"setting",
"in",
"{",
"@link",
"LdapIdentityStoreDefinition",
"}",
"or",
"{",
"@link",
"DatabaseIdentityStoreDefinition",
"}",
"that",
"is",
"a",
"string",
"and",
"w... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.javaeesec/src/com/ibm/ws/security/javaeesec/identitystore/ELHelper.java#L252-L285 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/WServlet.java | WServlet.serviceInt | protected void serviceInt(final HttpServletRequest request, final HttpServletResponse response)
throws ServletException, IOException {
"""
Service internal. This method does the real work in servicing the http request. It integrates wcomponents into a
servlet environment via a servlet specific helper class.
... | java | protected void serviceInt(final HttpServletRequest request, final HttpServletResponse response)
throws ServletException, IOException {
// Check for resource request
boolean continueProcess = ServletUtil.checkResourceRequest(request, response);
if (!continueProcess) {
return;
}
// Create a support class... | [
"protected",
"void",
"serviceInt",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"// Check for resource request",
"boolean",
"continueProcess",
"=",
"ServletUtil",
... | Service internal. This method does the real work in servicing the http request. It integrates wcomponents into a
servlet environment via a servlet specific helper class.
@param request the http servlet request.
@param response the http servlet response.
@throws IOException an IO exception
@throws ServletException a se... | [
"Service",
"internal",
".",
"This",
"method",
"does",
"the",
"real",
"work",
"in",
"servicing",
"the",
"http",
"request",
".",
"It",
"integrates",
"wcomponents",
"into",
"a",
"servlet",
"environment",
"via",
"a",
"servlet",
"specific",
"helper",
"class",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/WServlet.java#L130-L148 |
opentelecoms-org/jsmpp | jsmpp/src/main/java/org/jsmpp/bean/DeliveryReceipt.java | DeliveryReceipt.intToString | private static String intToString(int value, int digit) {
"""
Create String representation of integer. Preceding 0 will be add as
needed.
@param value is the value.
@param digit is the digit should be shown.
@return the String representation of int value.
"""
StringBuilder stringBuilder = new Str... | java | private static String intToString(int value, int digit) {
StringBuilder stringBuilder = new StringBuilder(digit);
stringBuilder.append(Integer.toString(value));
while (stringBuilder.length() < digit) {
stringBuilder.insert(0, "0");
}
return stringBuilder.toString();
... | [
"private",
"static",
"String",
"intToString",
"(",
"int",
"value",
",",
"int",
"digit",
")",
"{",
"StringBuilder",
"stringBuilder",
"=",
"new",
"StringBuilder",
"(",
"digit",
")",
";",
"stringBuilder",
".",
"append",
"(",
"Integer",
".",
"toString",
"(",
"va... | Create String representation of integer. Preceding 0 will be add as
needed.
@param value is the value.
@param digit is the digit should be shown.
@return the String representation of int value. | [
"Create",
"String",
"representation",
"of",
"integer",
".",
"Preceding",
"0",
"will",
"be",
"add",
"as",
"needed",
"."
] | train | https://github.com/opentelecoms-org/jsmpp/blob/acc15e73e7431deabc803731971b15323315baaf/jsmpp/src/main/java/org/jsmpp/bean/DeliveryReceipt.java#L305-L312 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/CmsValidationHandler.java | CmsValidationHandler.setPaused | public void setPaused(boolean paused, CmsEntity entity) {
"""
Sets the validation to pause.<p>
@param paused <code>true</code> to pause the validation
@param entity the entity will be revalidated when setting paused to <code>false</code>
"""
if (paused != m_paused) {
m_paused = paus... | java | public void setPaused(boolean paused, CmsEntity entity) {
if (paused != m_paused) {
m_paused = paused;
if (m_paused) {
if (m_validationTimer != null) {
m_validationTimer.cancel();
m_validationTimer = null;
}... | [
"public",
"void",
"setPaused",
"(",
"boolean",
"paused",
",",
"CmsEntity",
"entity",
")",
"{",
"if",
"(",
"paused",
"!=",
"m_paused",
")",
"{",
"m_paused",
"=",
"paused",
";",
"if",
"(",
"m_paused",
")",
"{",
"if",
"(",
"m_validationTimer",
"!=",
"null",... | Sets the validation to pause.<p>
@param paused <code>true</code> to pause the validation
@param entity the entity will be revalidated when setting paused to <code>false</code> | [
"Sets",
"the",
"validation",
"to",
"pause",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsValidationHandler.java#L273-L288 |
ludovicianul/selenium-on-steroids | src/main/java/com/insidecoding/sos/io/FileUtils.java | FileUtils.getFileContentsAsString | public String getFileContentsAsString(final File file, final String encoding)
throws IOException {
"""
Returns the contents of a file into a String object. <br/>
Please be careful when using this with large files
@param file
the file
@param encoding
the file encoding. Example: "UTF-8", "UTF-16"
@return ... | java | public String getFileContentsAsString(final File file, final String encoding)
throws IOException {
LOG.info("Getting files contents as string: " + file);
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(
file), encoding));
StringBuilder builder = new... | [
"public",
"String",
"getFileContentsAsString",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"info",
"(",
"\"Getting files contents as string: \"",
"+",
"file",
")",
";",
"BufferedReader",
"br",
"=... | Returns the contents of a file into a String object. <br/>
Please be careful when using this with large files
@param file
the file
@param encoding
the file encoding. Example: "UTF-8", "UTF-16"
@return a String object with the contents of the file
@throws IOException
if something goes wrong while reading the file | [
"Returns",
"the",
"contents",
"of",
"a",
"file",
"into",
"a",
"String",
"object",
".",
"<br",
"/",
">",
"Please",
"be",
"careful",
"when",
"using",
"this",
"with",
"large",
"files"
] | train | https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/io/FileUtils.java#L527-L549 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.waitForFragmentById | public boolean waitForFragmentById(int id, int timeout) {
"""
Waits for a Fragment matching the specified resource id.
@param id the R.id of the fragment
@param timeout the amount of time in milliseconds to wait
@return {@code true} if fragment appears and {@code false} if it does not appear before the timeou... | java | public boolean waitForFragmentById(int id, int timeout){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForFragmentById("+id+", "+timeout+")");
}
return waiter.waitForFragment(null, id, timeout);
} | [
"public",
"boolean",
"waitForFragmentById",
"(",
"int",
"id",
",",
"int",
"timeout",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"waitForFragmentById(\"",
"+",
"id",
"+",
... | Waits for a Fragment matching the specified resource id.
@param id the R.id of the fragment
@param timeout the amount of time in milliseconds to wait
@return {@code true} if fragment appears and {@code false} if it does not appear before the timeout | [
"Waits",
"for",
"a",
"Fragment",
"matching",
"the",
"specified",
"resource",
"id",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L3709-L3715 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/RadioButtonGroup.java | RadioButtonGroup.isMatched | public boolean isMatched(String value, Boolean defaultValue) {
"""
Does the specified value match one of those we are looking for?
@param value Value to be compared
"""
// @todo: there isn't a defaultValue for radio button, what should we do here?
if (value == null)
return false;
... | java | public boolean isMatched(String value, Boolean defaultValue)
{
// @todo: there isn't a defaultValue for radio button, what should we do here?
if (value == null)
return false;
if (_match != null)
return value.equals(_match);
if (_defaultRadio != null)
... | [
"public",
"boolean",
"isMatched",
"(",
"String",
"value",
",",
"Boolean",
"defaultValue",
")",
"{",
"// @todo: there isn't a defaultValue for radio button, what should we do here?",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"_match",
"!... | Does the specified value match one of those we are looking for?
@param value Value to be compared | [
"Does",
"the",
"specified",
"value",
"match",
"one",
"of",
"those",
"we",
"are",
"looking",
"for?"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/RadioButtonGroup.java#L254-L265 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/service/ClientConfigurationService.java | ClientConfigurationService.getMapWidgetInfo | public static void getMapWidgetInfo(final String applicationId, final String mapId, final String name,
final WidgetConfigurationCallback callback) {
"""
Get the configuration for a specific widget. This method will search within the context of a specific map. This
means that it will find maps, tool-bars and la... | java | public static void getMapWidgetInfo(final String applicationId, final String mapId, final String name,
final WidgetConfigurationCallback callback) {
if (!CONFIG.containsKey(applicationId)) {
if (addCallback(applicationId, new DelayedCallback(mapId, name, callback))) {
configurationLoader.loadClientApplicati... | [
"public",
"static",
"void",
"getMapWidgetInfo",
"(",
"final",
"String",
"applicationId",
",",
"final",
"String",
"mapId",
",",
"final",
"String",
"name",
",",
"final",
"WidgetConfigurationCallback",
"callback",
")",
"{",
"if",
"(",
"!",
"CONFIG",
".",
"containsK... | Get the configuration for a specific widget. This method will search within the context of a specific map. This
means that it will find maps, tool-bars and layer trees as well as the widget configurations within a map.
@param applicationId
The application name wherein to search for the widget configuration.
@param map... | [
"Get",
"the",
"configuration",
"for",
"a",
"specific",
"widget",
".",
"This",
"method",
"will",
"search",
"within",
"the",
"context",
"of",
"a",
"specific",
"map",
".",
"This",
"means",
"that",
"it",
"will",
"find",
"maps",
"tool",
"-",
"bars",
"and",
"l... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/service/ClientConfigurationService.java#L134-L143 |
redkale/redkale-plugins | src/org/redkalex/source/mysql/CharsetMapping.java | CharsetMapping.getJavaEncodingForMysqlCharset | public static String getJavaEncodingForMysqlCharset(String mysqlCharsetName, String javaEncoding) {
"""
MySQL charset could map to several Java encodings.
So here we choose the one according to next rules:
if there is no static mapping for this charset then return javaEncoding value as is because this
could be ... | java | public static String getJavaEncodingForMysqlCharset(String mysqlCharsetName, String javaEncoding) {
String res = javaEncoding;
MysqlCharset cs = CHARSET_NAME_TO_CHARSET.get(mysqlCharsetName);
if (cs != null) {
res = cs.getMatchingJavaEncoding(javaEncoding);
}
re... | [
"public",
"static",
"String",
"getJavaEncodingForMysqlCharset",
"(",
"String",
"mysqlCharsetName",
",",
"String",
"javaEncoding",
")",
"{",
"String",
"res",
"=",
"javaEncoding",
";",
"MysqlCharset",
"cs",
"=",
"CHARSET_NAME_TO_CHARSET",
".",
"get",
"(",
"mysqlCharsetN... | MySQL charset could map to several Java encodings.
So here we choose the one according to next rules:
if there is no static mapping for this charset then return javaEncoding value as is because this
could be a custom charset for example
if static mapping exists and javaEncoding equals to one of Java encoding canonical ... | [
"MySQL",
"charset",
"could",
"map",
"to",
"several",
"Java",
"encodings",
".",
"So",
"here",
"we",
"choose",
"the",
"one",
"according",
"to",
"next",
"rules",
":",
"if",
"there",
"is",
"no",
"static",
"mapping",
"for",
"this",
"charset",
"then",
"return",
... | train | https://github.com/redkale/redkale-plugins/blob/a1edfc906a444ae19fe6aababce2957c9b5ea9d2/src/org/redkalex/source/mysql/CharsetMapping.java#L655-L662 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.setFeatureStyle | public static boolean setFeatureStyle(PolygonOptions polygonOptions, FeatureStyle featureStyle, float density) {
"""
Set the feature style into the polygon options
@param polygonOptions polygon options
@param featureStyle feature style
@param density display density: {@link android.util.DisplayMetric... | java | public static boolean setFeatureStyle(PolygonOptions polygonOptions, FeatureStyle featureStyle, float density) {
boolean featureStyleSet = false;
if (featureStyle != null) {
featureStyleSet = setStyle(polygonOptions, featureStyle.getStyle(), density);
}
return featureSty... | [
"public",
"static",
"boolean",
"setFeatureStyle",
"(",
"PolygonOptions",
"polygonOptions",
",",
"FeatureStyle",
"featureStyle",
",",
"float",
"density",
")",
"{",
"boolean",
"featureStyleSet",
"=",
"false",
";",
"if",
"(",
"featureStyle",
"!=",
"null",
")",
"{",
... | Set the feature style into the polygon options
@param polygonOptions polygon options
@param featureStyle feature style
@param density display density: {@link android.util.DisplayMetrics#density}
@return true if style was set into the polygon options | [
"Set",
"the",
"feature",
"style",
"into",
"the",
"polygon",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L567-L578 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/AbstractPrimitiveBindTransform.java | AbstractPrimitiveBindTransform.generateParseOnXml | @Override
public void generateParseOnXml(BindTypeContext context, MethodSpec.Builder methodBuilder, String parserName, TypeName beanClass, String beanName, BindProperty property) {
"""
/* (non-Javadoc)
@see com.abubusoft.kripton.processor.bind.transform.BindTransform#generateParseOnXml(com.abubusoft.kripton.proc... | java | @Override
public void generateParseOnXml(BindTypeContext context, MethodSpec.Builder methodBuilder, String parserName, TypeName beanClass, String beanName, BindProperty property) {
XmlType xmlType = property.xmlInfo.xmlType;
if (property.hasTypeAdapter()) {
// there's an type adapter
methodBuilder.addCode("... | [
"@",
"Override",
"public",
"void",
"generateParseOnXml",
"(",
"BindTypeContext",
"context",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"String",
"parserName",
",",
"TypeName",
"beanClass",
",",
"String",
"beanName",
",",
"BindProperty",
"property",
")"... | /* (non-Javadoc)
@see com.abubusoft.kripton.processor.bind.transform.BindTransform#generateParseOnXml(com.abubusoft.kripton.processor.bind.BindTypeContext, com.squareup.javapoet.MethodSpec.Builder, java.lang.String, com.squareup.javapoet.TypeName, java.lang.String, com.abubusoft.kripton.processor.bind.model.BindPropert... | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/AbstractPrimitiveBindTransform.java#L142-L183 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/ListExtractor.java | ListExtractor.extractObject | public Object extractObject(ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts,boolean jsonify)
throws AttributeNotFoundException {
"""
Extract a list and, if to be jsonified, put it into an {@link JSONArray}. An index can be used (on top of
the extra args stack) in order to spe... | java | public Object extractObject(ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts,boolean jsonify)
throws AttributeNotFoundException {
List list = (List) pValue;
int length = pConverter.getCollectionLength(list.size());
String pathPart = pPathParts.isEmpty() ? nul... | [
"public",
"Object",
"extractObject",
"(",
"ObjectToJsonConverter",
"pConverter",
",",
"Object",
"pValue",
",",
"Stack",
"<",
"String",
">",
"pPathParts",
",",
"boolean",
"jsonify",
")",
"throws",
"AttributeNotFoundException",
"{",
"List",
"list",
"=",
"(",
"List",... | Extract a list and, if to be jsonified, put it into an {@link JSONArray}. An index can be used (on top of
the extra args stack) in order to specify a single value within the list.
@param pConverter the global converter in order to be able do dispatch for
serializing inner data types
@param pValue the value to convert ... | [
"Extract",
"a",
"list",
"and",
"if",
"to",
"be",
"jsonified",
"put",
"it",
"into",
"an",
"{",
"@link",
"JSONArray",
"}",
".",
"An",
"index",
"can",
"be",
"used",
"(",
"on",
"top",
"of",
"the",
"extra",
"args",
"stack",
")",
"in",
"order",
"to",
"sp... | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ListExtractor.java#L57-L67 |
camunda/camunda-bpm-platform-osgi | camunda-bpm-osgi/src/main/java/org/camunda/bpm/extension/osgi/internal/ProcessDefinitionParser.java | ProcessDefinitionParser.parsePaths | private static List<URL> parsePaths(List<PathElement> paths, Bundle bundle) {
"""
Takes the list of {@link PathElement}s and uses the bundle to find the
URLs of those elements.
@param paths
@param bundle
@return
"""
List<URL> pathList = new ArrayList<URL>();
for (PathElement path : paths) {
String... | java | private static List<URL> parsePaths(List<PathElement> paths, Bundle bundle) {
List<URL> pathList = new ArrayList<URL>();
for (PathElement path : paths) {
String name = path.getName();
if (name.endsWith("/")) {
// we have a directory
addEntries(bundle, name, "*.*", pathList);
} else {
// we have... | [
"private",
"static",
"List",
"<",
"URL",
">",
"parsePaths",
"(",
"List",
"<",
"PathElement",
">",
"paths",
",",
"Bundle",
"bundle",
")",
"{",
"List",
"<",
"URL",
">",
"pathList",
"=",
"new",
"ArrayList",
"<",
"URL",
">",
"(",
")",
";",
"for",
"(",
... | Takes the list of {@link PathElement}s and uses the bundle to find the
URLs of those elements.
@param paths
@param bundle
@return | [
"Takes",
"the",
"list",
"of",
"{",
"@link",
"PathElement",
"}",
"s",
"and",
"uses",
"the",
"bundle",
"to",
"find",
"the",
"URLs",
"of",
"those",
"elements",
"."
] | train | https://github.com/camunda/camunda-bpm-platform-osgi/blob/b91c6a68895947b320a7a5edf0db7158e945c4bb/camunda-bpm-osgi/src/main/java/org/camunda/bpm/extension/osgi/internal/ProcessDefinitionParser.java#L62-L89 |
jfinal/jfinal | src/main/java/com/jfinal/core/Controller.java | Controller.setAttrs | public Controller setAttrs(Map<String, Object> attrMap) {
"""
Stores attributes in this request, key of the map as attribute name and value of the map as attribute value
@param attrMap key and value as attribute of the map to be stored
"""
for (Map.Entry<String, Object> entry : attrMap.entrySet())
requ... | java | public Controller setAttrs(Map<String, Object> attrMap) {
for (Map.Entry<String, Object> entry : attrMap.entrySet())
request.setAttribute(entry.getKey(), entry.getValue());
return this;
} | [
"public",
"Controller",
"setAttrs",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"attrMap",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
"entry",
":",
"attrMap",
".",
"entrySet",
"(",
")",
")",
"request",
".",
"setA... | Stores attributes in this request, key of the map as attribute name and value of the map as attribute value
@param attrMap key and value as attribute of the map to be stored | [
"Stores",
"attributes",
"in",
"this",
"request",
"key",
"of",
"the",
"map",
"as",
"attribute",
"name",
"and",
"value",
"of",
"the",
"map",
"as",
"attribute",
"value"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/core/Controller.java#L150-L154 |
casmi/casmi | src/main/java/casmi/graphics/color/RGBColor.java | RGBColor.lerpColor | public static Color lerpColor(ColorSet colorSet1, ColorSet colorSet2, double amt) {
"""
Calculates a color or colors between two color at a specific increment.
@param colorSet1
interpolate from this color
@param colorSet2
interpolate to this color
@param amt
between 0.0 and 1.0
@return
The calculated color... | java | public static Color lerpColor(ColorSet colorSet1, ColorSet colorSet2, double amt) {
return lerpColor(RGBColor.color(colorSet1), RGBColor.color(colorSet2), amt);
} | [
"public",
"static",
"Color",
"lerpColor",
"(",
"ColorSet",
"colorSet1",
",",
"ColorSet",
"colorSet2",
",",
"double",
"amt",
")",
"{",
"return",
"lerpColor",
"(",
"RGBColor",
".",
"color",
"(",
"colorSet1",
")",
",",
"RGBColor",
".",
"color",
"(",
"colorSet2"... | Calculates a color or colors between two color at a specific increment.
@param colorSet1
interpolate from this color
@param colorSet2
interpolate to this color
@param amt
between 0.0 and 1.0
@return
The calculated color values. | [
"Calculates",
"a",
"color",
"or",
"colors",
"between",
"two",
"color",
"at",
"a",
"specific",
"increment",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/color/RGBColor.java#L207-L209 |
jbehave/jbehave-core | jbehave-core/src/main/java/org/jbehave/core/io/StoryFinder.java | StoryFinder.findPaths | public List<String> findPaths(String searchIn, String include, String exclude) {
"""
Finds paths from a source path, allowing for include/exclude patterns,
which can be comma-separated values of multiple patterns.
Paths found are normalised by {@link StoryFinder#normalise(List<String>)}
@param searchIn the ... | java | public List<String> findPaths(String searchIn, String include, String exclude) {
return findPaths(searchIn, asCSVList(include), asCSVList(exclude));
} | [
"public",
"List",
"<",
"String",
">",
"findPaths",
"(",
"String",
"searchIn",
",",
"String",
"include",
",",
"String",
"exclude",
")",
"{",
"return",
"findPaths",
"(",
"searchIn",
",",
"asCSVList",
"(",
"include",
")",
",",
"asCSVList",
"(",
"exclude",
")"... | Finds paths from a source path, allowing for include/exclude patterns,
which can be comma-separated values of multiple patterns.
Paths found are normalised by {@link StoryFinder#normalise(List<String>)}
@param searchIn the source path to search in
@param include the CSV include pattern, or <code>null</code> if none
@... | [
"Finds",
"paths",
"from",
"a",
"source",
"path",
"allowing",
"for",
"include",
"/",
"exclude",
"patterns",
"which",
"can",
"be",
"comma",
"-",
"separated",
"values",
"of",
"multiple",
"patterns",
"."
] | train | https://github.com/jbehave/jbehave-core/blob/bdd6a6199528df3c35087e72d4644870655b23e6/jbehave-core/src/main/java/org/jbehave/core/io/StoryFinder.java#L104-L106 |
jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/Predicates.java | Predicates.anyBitsSet | public static Predicate anyBitsSet(final String expr, final long bits) {
"""
Adds a clause that checks whether ANY set bits in a bitmask are present
in a numeric expression.
@param expr
SQL numeric expression to check.
@param bits
Integer containing the bits for which to check.
"""
return new Pr... | java | public static Predicate anyBitsSet(final String expr, final long bits) {
return new Predicate() {
private String param;
public void init(AbstractSqlCreator creator) {
param = creator.allocateParameter();
creator.setParameter(param, bits);
}
... | [
"public",
"static",
"Predicate",
"anyBitsSet",
"(",
"final",
"String",
"expr",
",",
"final",
"long",
"bits",
")",
"{",
"return",
"new",
"Predicate",
"(",
")",
"{",
"private",
"String",
"param",
";",
"public",
"void",
"init",
"(",
"AbstractSqlCreator",
"creat... | Adds a clause that checks whether ANY set bits in a bitmask are present
in a numeric expression.
@param expr
SQL numeric expression to check.
@param bits
Integer containing the bits for which to check. | [
"Adds",
"a",
"clause",
"that",
"checks",
"whether",
"ANY",
"set",
"bits",
"in",
"a",
"bitmask",
"are",
"present",
"in",
"a",
"numeric",
"expression",
"."
] | train | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/Predicates.java#L74-L85 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java | FacesImpl.findSimilarWithServiceResponseAsync | public Observable<ServiceResponse<List<SimilarFace>>> findSimilarWithServiceResponseAsync(UUID faceId, FindSimilarOptionalParameter findSimilarOptionalParameter) {
"""
Given query face's faceId, find the similar-looking faces from a faceId array or a faceListId.
@param faceId FaceId of the query face. User need... | java | public Observable<ServiceResponse<List<SimilarFace>>> findSimilarWithServiceResponseAsync(UUID faceId, FindSimilarOptionalParameter findSimilarOptionalParameter) {
if (this.client.azureRegion() == null) {
throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot ... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"SimilarFace",
">",
">",
">",
"findSimilarWithServiceResponseAsync",
"(",
"UUID",
"faceId",
",",
"FindSimilarOptionalParameter",
"findSimilarOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
"client... | Given query face's faceId, find the similar-looking faces from a faceId array or a faceListId.
@param faceId FaceId of the query face. User needs to call Face - Detect first to get a valid faceId. Note that this faceId is not persisted and will expire 24 hours after the detection call
@param findSimilarOptionalParamet... | [
"Given",
"query",
"face",
"s",
"faceId",
"find",
"the",
"similar",
"-",
"looking",
"faces",
"from",
"a",
"faceId",
"array",
"or",
"a",
"faceListId",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java#L162-L175 |
apache/flink | flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraCommitter.java | CassandraCommitter.createResource | @Override
public void createResource() throws Exception {
"""
Generates the necessary tables to store information.
@throws Exception
"""
cluster = builder.getCluster();
session = cluster.connect();
session.execute(String.format("CREATE KEYSPACE IF NOT EXISTS %s with replication={'class':'SimpleStrat... | java | @Override
public void createResource() throws Exception {
cluster = builder.getCluster();
session = cluster.connect();
session.execute(String.format("CREATE KEYSPACE IF NOT EXISTS %s with replication={'class':'SimpleStrategy', 'replication_factor':1};", keySpace));
session.execute(String.format("CREATE TABLE ... | [
"@",
"Override",
"public",
"void",
"createResource",
"(",
")",
"throws",
"Exception",
"{",
"cluster",
"=",
"builder",
".",
"getCluster",
"(",
")",
";",
"session",
"=",
"cluster",
".",
"connect",
"(",
")",
";",
"session",
".",
"execute",
"(",
"String",
".... | Generates the necessary tables to store information.
@throws Exception | [
"Generates",
"the",
"necessary",
"tables",
"to",
"store",
"information",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraCommitter.java#L78-L96 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/FootFlagEncoder.java | FootFlagEncoder.getSpeed | @Override
double getSpeed(boolean reverse, IntsRef edgeFlags) {
"""
/*
This method is a current hack, to allow ferries to be actually faster than our current storable maxSpeed.
"""
double speed = super.getSpeed(reverse, edgeFlags);
if (speed == getMaxSpeed()) {
// We cannot be ... | java | @Override
double getSpeed(boolean reverse, IntsRef edgeFlags) {
double speed = super.getSpeed(reverse, edgeFlags);
if (speed == getMaxSpeed()) {
// We cannot be sure if it was a long or a short trip
return SHORT_TRIP_FERRY_SPEED;
}
return speed;
} | [
"@",
"Override",
"double",
"getSpeed",
"(",
"boolean",
"reverse",
",",
"IntsRef",
"edgeFlags",
")",
"{",
"double",
"speed",
"=",
"super",
".",
"getSpeed",
"(",
"reverse",
",",
"edgeFlags",
")",
";",
"if",
"(",
"speed",
"==",
"getMaxSpeed",
"(",
")",
")",... | /*
This method is a current hack, to allow ferries to be actually faster than our current storable maxSpeed. | [
"/",
"*",
"This",
"method",
"is",
"a",
"current",
"hack",
"to",
"allow",
"ferries",
"to",
"be",
"actually",
"faster",
"than",
"our",
"current",
"storable",
"maxSpeed",
"."
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/FootFlagEncoder.java#L370-L378 |
brettwooldridge/HikariCP | src/main/java/com/zaxxer/hikari/metrics/dropwizard/CodahaleHealthChecker.java | CodahaleHealthChecker.registerHealthChecks | public static void registerHealthChecks(final HikariPool pool, final HikariConfig hikariConfig, final HealthCheckRegistry registry) {
"""
Register Dropwizard health checks.
@param pool the pool to register health checks for
@param hikariConfig the pool configuration
@param registry the HealthCheckRegistry int... | java | public static void registerHealthChecks(final HikariPool pool, final HikariConfig hikariConfig, final HealthCheckRegistry registry)
{
final Properties healthCheckProperties = hikariConfig.getHealthCheckProperties();
final MetricRegistry metricRegistry = (MetricRegistry) hikariConfig.getMetricRegistry();
... | [
"public",
"static",
"void",
"registerHealthChecks",
"(",
"final",
"HikariPool",
"pool",
",",
"final",
"HikariConfig",
"hikariConfig",
",",
"final",
"HealthCheckRegistry",
"registry",
")",
"{",
"final",
"Properties",
"healthCheckProperties",
"=",
"hikariConfig",
".",
"... | Register Dropwizard health checks.
@param pool the pool to register health checks for
@param hikariConfig the pool configuration
@param registry the HealthCheckRegistry into which checks will be registered | [
"Register",
"Dropwizard",
"health",
"checks",
"."
] | train | https://github.com/brettwooldridge/HikariCP/blob/c509ec1a3f1e19769ee69323972f339cf098ff4b/src/main/java/com/zaxxer/hikari/metrics/dropwizard/CodahaleHealthChecker.java#L58-L75 |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java | BasicBinder.registerBinding | public final <S, T> void registerBinding(Class<S> source, Class<T> target, Binding<S, T> converter, Class<? extends Annotation> qualifier) {
"""
Register a Binding with the given source and target class.
A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
The sou... | java | public final <S, T> void registerBinding(Class<S> source, Class<T> target, Binding<S, T> converter, Class<? extends Annotation> qualifier) {
registerBinding(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier), converter);
} | [
"public",
"final",
"<",
"S",
",",
"T",
">",
"void",
"registerBinding",
"(",
"Class",
"<",
"S",
">",
"source",
",",
"Class",
"<",
"T",
">",
"target",
",",
"Binding",
"<",
"S",
",",
"T",
">",
"converter",
",",
"Class",
"<",
"?",
"extends",
"Annotatio... | Register a Binding with the given source and target class.
A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
The source class is considered the owning class of the binding. The source can be marshalled
into the target class. Similarly, the target can be unmarshalled to... | [
"Register",
"a",
"Binding",
"with",
"the",
"given",
"source",
"and",
"target",
"class",
".",
"A",
"binding",
"unifies",
"a",
"marshaller",
"and",
"an",
"unmarshaller",
"and",
"both",
"must",
"be",
"available",
"to",
"resolve",
"a",
"binding",
"."
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L596-L598 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServiceObjectivesInner.java | ServiceObjectivesInner.listByServerAsync | public Observable<List<ServiceObjectiveInner>> listByServerAsync(String resourceGroupName, String serverName) {
"""
Returns database service objectives.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal... | java | public Observable<List<ServiceObjectiveInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<ServiceObjectiveInner>>, List<ServiceObjectiveInner>>() {
@Override
... | [
"public",
"Observable",
"<",
"List",
"<",
"ServiceObjectiveInner",
">",
">",
"listByServerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
")... | Returns database service objectives.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the validation
@retu... | [
"Returns",
"database",
"service",
"objectives",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServiceObjectivesInner.java#L193-L200 |
mozilla/rhino | src/org/mozilla/javascript/Context.java | Context.newArray | public Scriptable newArray(Scriptable scope, Object[] elements) {
"""
Create an array with a set of initial elements.
@param scope the scope to create the object in.
@param elements the initial elements. Each object in this array
must be an acceptable JavaScript type and type
of array should be exactly Objec... | java | public Scriptable newArray(Scriptable scope, Object[] elements)
{
if (elements.getClass().getComponentType() != ScriptRuntime.ObjectClass)
throw new IllegalArgumentException();
NativeArray result = new NativeArray(elements);
ScriptRuntime.setBuiltinProtoAndParent(result, scope,
... | [
"public",
"Scriptable",
"newArray",
"(",
"Scriptable",
"scope",
",",
"Object",
"[",
"]",
"elements",
")",
"{",
"if",
"(",
"elements",
".",
"getClass",
"(",
")",
".",
"getComponentType",
"(",
")",
"!=",
"ScriptRuntime",
".",
"ObjectClass",
")",
"throw",
"ne... | Create an array with a set of initial elements.
@param scope the scope to create the object in.
@param elements the initial elements. Each object in this array
must be an acceptable JavaScript type and type
of array should be exactly Object[], not
SomeObjectSubclass[].
@return the new array object. | [
"Create",
"an",
"array",
"with",
"a",
"set",
"of",
"initial",
"elements",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Context.java#L1712-L1720 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ForkJoinPool.java | ForkJoinPool.runWorker | final void runWorker(WorkQueue w) {
"""
Top-level runloop for workers, called by ForkJoinWorkerThread.run.
"""
w.growArray(); // allocate queue
int bound = (w.config & SPARE_WORKER) != 0 ? 0 : POLL_LIMIT;
long seed = w.hint * 0xdaba0b6eb09322e3L; /... | java | final void runWorker(WorkQueue w) {
w.growArray(); // allocate queue
int bound = (w.config & SPARE_WORKER) != 0 ? 0 : POLL_LIMIT;
long seed = w.hint * 0xdaba0b6eb09322e3L; // initial random seed
if ((runState & STOP) == 0) {
for (long r ... | [
"final",
"void",
"runWorker",
"(",
"WorkQueue",
"w",
")",
"{",
"w",
".",
"growArray",
"(",
")",
";",
"// allocate queue",
"int",
"bound",
"=",
"(",
"w",
".",
"config",
"&",
"SPARE_WORKER",
")",
"!=",
"0",
"?",
"0",
":",
"POLL_LIMIT",
";",
"long",
"se... | Top-level runloop for workers, called by ForkJoinWorkerThread.run. | [
"Top",
"-",
"level",
"runloop",
"for",
"workers",
"called",
"by",
"ForkJoinWorkerThread",
".",
"run",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ForkJoinPool.java#L1926-L1941 |
Jasig/uPortal | uPortal-groups/uPortal-groups-filesystem/src/main/java/org/apereo/portal/groups/filesystem/FileSystemGroupStore.java | FileSystemGroupStore.findParentGroups | protected Iterator findParentGroups(IEntityGroup group) throws GroupsException {
"""
Returns an <code>Iterator</code> over the <code>Collection</code> of <code>IEntityGroups
</code> that the <code>IGroupMember</code> belongs to.
@return java.util.Iterator
@param group org.apereo.portal.groups.IEntityGroup
... | java | protected Iterator findParentGroups(IEntityGroup group) throws GroupsException {
if (log.isDebugEnabled()) log.debug(DEBUG_CLASS_NAME + ".findParentGroups(): for " + group);
List groups = new ArrayList();
{
String typeName = group.getLeafType().getName();
File parent = g... | [
"protected",
"Iterator",
"findParentGroups",
"(",
"IEntityGroup",
"group",
")",
"throws",
"GroupsException",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"log",
".",
"debug",
"(",
"DEBUG_CLASS_NAME",
"+",
"\".findParentGroups(): for \"",
"+",
"grou... | Returns an <code>Iterator</code> over the <code>Collection</code> of <code>IEntityGroups
</code> that the <code>IGroupMember</code> belongs to.
@return java.util.Iterator
@param group org.apereo.portal.groups.IEntityGroup | [
"Returns",
"an",
"<code",
">",
"Iterator<",
"/",
"code",
">",
"over",
"the",
"<code",
">",
"Collection<",
"/",
"code",
">",
"of",
"<code",
">",
"IEntityGroups",
"<",
"/",
"code",
">",
"that",
"the",
"<code",
">",
"IGroupMember<",
"/",
"code",
">",
"bel... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-filesystem/src/main/java/org/apereo/portal/groups/filesystem/FileSystemGroupStore.java#L308-L333 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-container/src/main/java/com/google/cloud/container/v1/ClusterManagerClient.java | ClusterManagerClient.listClusters | public final ListClustersResponse listClusters(String projectId, String zone) {
"""
Lists all clusters owned by a project in either the specified zone or all zones.
<p>Sample code:
<pre><code>
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String z... | java | public final ListClustersResponse listClusters(String projectId, String zone) {
ListClustersRequest request =
ListClustersRequest.newBuilder().setProjectId(projectId).setZone(zone).build();
return listClusters(request);
} | [
"public",
"final",
"ListClustersResponse",
"listClusters",
"(",
"String",
"projectId",
",",
"String",
"zone",
")",
"{",
"ListClustersRequest",
"request",
"=",
"ListClustersRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"projectId",
")",
".",
"set... | Lists all clusters owned by a project in either the specified zone or all zones.
<p>Sample code:
<pre><code>
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
ListClustersResponse response = clusterManagerClient.listClusters(projectId, zone);
}
... | [
"Lists",
"all",
"clusters",
"owned",
"by",
"a",
"project",
"in",
"either",
"the",
"specified",
"zone",
"or",
"all",
"zones",
"."
] | 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#L213-L218 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/calib/CalibrationDetectorChessboard2.java | CalibrationDetectorChessboard2.gridChess | public static List<Point2D_F64> gridChess(int numRows, int numCols, double squareWidth) {
"""
This target is composed of a checkered chess board like squares. Each corner of an interior square
touches an adjacent square, but the sides are separated. Only interior square corners provide
calibration points.
@... | java | public static List<Point2D_F64> gridChess(int numRows, int numCols, double squareWidth)
{
List<Point2D_F64> all = new ArrayList<>();
// convert it into the number of calibration points
numCols = numCols - 1;
numRows = numRows - 1;
// center the grid around the origin. length of a size divided by two
doub... | [
"public",
"static",
"List",
"<",
"Point2D_F64",
">",
"gridChess",
"(",
"int",
"numRows",
",",
"int",
"numCols",
",",
"double",
"squareWidth",
")",
"{",
"List",
"<",
"Point2D_F64",
">",
"all",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// convert it int... | This target is composed of a checkered chess board like squares. Each corner of an interior square
touches an adjacent square, but the sides are separated. Only interior square corners provide
calibration points.
@param numRows Number of grid rows in the calibration target
@param numCols Number of grid columns in th... | [
"This",
"target",
"is",
"composed",
"of",
"a",
"checkered",
"chess",
"board",
"like",
"squares",
".",
"Each",
"corner",
"of",
"an",
"interior",
"square",
"touches",
"an",
"adjacent",
"square",
"but",
"the",
"sides",
"are",
"separated",
".",
"Only",
"interior... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/calib/CalibrationDetectorChessboard2.java#L143-L164 |
alkacon/opencms-core | src/org/opencms/ade/sitemap/CmsModelPageHelper.java | CmsModelPageHelper.addModelPageToSitemapConfiguration | public void addModelPageToSitemapConfiguration(CmsResource sitemapConfig, CmsResource modelPage, boolean disabled)
throws CmsException {
"""
Adds a model page to the sitemap config.<p>
@param sitemapConfig the sitemap configuration resource
@param modelPage the model page to add
@param disabled true if th... | java | public void addModelPageToSitemapConfiguration(CmsResource sitemapConfig, CmsResource modelPage, boolean disabled)
throws CmsException {
CmsFile sitemapConfigFile = m_cms.readFile(sitemapConfig);
CmsXmlContent content = CmsXmlContentFactory.unmarshal(m_cms, sitemapConfigFile);
CmsConfigurat... | [
"public",
"void",
"addModelPageToSitemapConfiguration",
"(",
"CmsResource",
"sitemapConfig",
",",
"CmsResource",
"modelPage",
",",
"boolean",
"disabled",
")",
"throws",
"CmsException",
"{",
"CmsFile",
"sitemapConfigFile",
"=",
"m_cms",
".",
"readFile",
"(",
"sitemapConf... | Adds a model page to the sitemap config.<p>
@param sitemapConfig the sitemap configuration resource
@param modelPage the model page to add
@param disabled true if the model page should be added as 'disabled'
@throws CmsException if something goes wrong | [
"Adds",
"a",
"model",
"page",
"to",
"the",
"sitemap",
"config",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/sitemap/CmsModelPageHelper.java#L127-L159 |
raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.loadXmlDocument | @Nonnull
public static Document loadXmlDocument(@Nonnull final InputStream inStream, @Nullable final String charset, final boolean autoClose) throws SAXException, IOException, ParserConfigurationException {
"""
Load and parse XML document from input stream.
@param inStream stream to read document
@param auto... | java | @Nonnull
public static Document loadXmlDocument(@Nonnull final InputStream inStream, @Nullable final String charset, final boolean autoClose) throws SAXException, IOException, ParserConfigurationException {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
factory.setFe... | [
"@",
"Nonnull",
"public",
"static",
"Document",
"loadXmlDocument",
"(",
"@",
"Nonnull",
"final",
"InputStream",
"inStream",
",",
"@",
"Nullable",
"final",
"String",
"charset",
",",
"final",
"boolean",
"autoClose",
")",
"throws",
"SAXException",
",",
"IOException",... | Load and parse XML document from input stream.
@param inStream stream to read document
@param autoClose true if stream must be closed, false otherwise
@return parsed document
@throws IOException
@throws ParserConfigurationException
@throws SAXException
@since 1.4.0 | [
"Load",
"and",
"parse",
"XML",
"document",
"from",
"input",
"stream",
"."
] | train | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L160-L199 |
OpenBEL/openbel-framework | org.openbel.framework.api/src/main/java/org/openbel/framework/api/BasicPathFinder.java | BasicPathFinder.runDepthFirstSearch | private void runDepthFirstSearch(final Kam kam,
final KamNode cnode,
final KamNode source,
final Set<KamNode> targets,
int depth,
final SetStack<KamNode> nodeStack,
final SetStack<KamEdge> edgeStack,
final List<SimplePath> pathResults) ... | java | private void runDepthFirstSearch(final Kam kam,
final KamNode cnode,
final KamNode source,
final Set<KamNode> targets,
int depth,
final SetStack<KamNode> nodeStack,
final SetStack<KamEdge> edgeStack,
final List<SimplePath> pathResults) ... | [
"private",
"void",
"runDepthFirstSearch",
"(",
"final",
"Kam",
"kam",
",",
"final",
"KamNode",
"cnode",
",",
"final",
"KamNode",
"source",
",",
"final",
"Set",
"<",
"KamNode",
">",
"targets",
",",
"int",
"depth",
",",
"final",
"SetStack",
"<",
"KamNode",
"... | Runs a recursive depth-first search from a {@link KamNode} in search of
the <tt>target</tt> node. When a {@link SimplePath} is found to the
<tt>target</tt> the {@link Stack} of {@link KamEdge} is collected and
the algorithm continues.<br/><br/>
<p>
This depth-first search exhaustively walks the entire {@link Kam}
and ... | [
"Runs",
"a",
"recursive",
"depth",
"-",
"first",
"search",
"from",
"a",
"{",
"@link",
"KamNode",
"}",
"in",
"search",
"of",
"the",
"<tt",
">",
"target<",
"/",
"tt",
">",
"node",
".",
"When",
"a",
"{",
"@link",
"SimplePath",
"}",
"is",
"found",
"to",
... | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.api/src/main/java/org/openbel/framework/api/BasicPathFinder.java#L318-L356 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/admin/program/esjp/EFapsClassLoader.java | EFapsClassLoader.getOfflineInstance | public static synchronized EFapsClassLoader getOfflineInstance(final ClassLoader _parent) {
"""
Get the current EFapsClassLoader.
This static method is used to provide a way to use the same classloader
in different threads, due to the reason that using different classloader
instances might bring the problem of ... | java | public static synchronized EFapsClassLoader getOfflineInstance(final ClassLoader _parent)
{
if (EFapsClassLoader.CLASSLOADER == null) {
EFapsClassLoader.CLASSLOADER = new EFapsClassLoader(_parent, true);
}
return EFapsClassLoader.CLASSLOADER;
} | [
"public",
"static",
"synchronized",
"EFapsClassLoader",
"getOfflineInstance",
"(",
"final",
"ClassLoader",
"_parent",
")",
"{",
"if",
"(",
"EFapsClassLoader",
".",
"CLASSLOADER",
"==",
"null",
")",
"{",
"EFapsClassLoader",
".",
"CLASSLOADER",
"=",
"new",
"EFapsClass... | Get the current EFapsClassLoader.
This static method is used to provide a way to use the same classloader
in different threads, due to the reason that using different classloader
instances might bring the problem of "instanceof" return unexpected results.
@param _parent parent classloader
@return the current EFapsClass... | [
"Get",
"the",
"current",
"EFapsClassLoader",
".",
"This",
"static",
"method",
"is",
"used",
"to",
"provide",
"a",
"way",
"to",
"use",
"the",
"same",
"classloader",
"in",
"different",
"threads",
"due",
"to",
"the",
"reason",
"that",
"using",
"different",
"cla... | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/program/esjp/EFapsClassLoader.java#L246-L252 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/AhoCorasick/AhoCorasickDoubleArrayTrie.java | AhoCorasickDoubleArrayTrie.load | public boolean load(ByteArray byteArray, V[] value) {
"""
载入
@param byteArray 一个字节数组
@param value 值数组
@return 成功与否
"""
if (byteArray == null) return false;
size = byteArray.nextInt();
base = new int[size + 65535]; // 多留一些,防止越界
check = new int[size + 65535];
fa... | java | public boolean load(ByteArray byteArray, V[] value)
{
if (byteArray == null) return false;
size = byteArray.nextInt();
base = new int[size + 65535]; // 多留一些,防止越界
check = new int[size + 65535];
fail = new int[size + 65535];
output = new int[size + 65535][];
i... | [
"public",
"boolean",
"load",
"(",
"ByteArray",
"byteArray",
",",
"V",
"[",
"]",
"value",
")",
"{",
"if",
"(",
"byteArray",
"==",
"null",
")",
"return",
"false",
";",
"size",
"=",
"byteArray",
".",
"nextInt",
"(",
")",
";",
"base",
"=",
"new",
"int",
... | 载入
@param byteArray 一个字节数组
@param value 值数组
@return 成功与否 | [
"载入"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/AhoCorasick/AhoCorasickDoubleArrayTrie.java#L247-L277 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/MessageBirdServiceImpl.java | MessageBirdServiceImpl.getPathVariables | private String getPathVariables(final Map<String, Object> map) {
"""
Build a path variable for GET requests
@param map map for getting path variables
@return String
"""
final StringBuilder bpath = new StringBuilder();
for (Map.Entry<String, Object> param : map.entrySet()) {
if (... | java | private String getPathVariables(final Map<String, Object> map) {
final StringBuilder bpath = new StringBuilder();
for (Map.Entry<String, Object> param : map.entrySet()) {
if (bpath.length() > 1) {
bpath.append("&");
}
try {
bpath.append... | [
"private",
"String",
"getPathVariables",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"final",
"StringBuilder",
"bpath",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object"... | Build a path variable for GET requests
@param map map for getting path variables
@return String | [
"Build",
"a",
"path",
"variable",
"for",
"GET",
"requests"
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdServiceImpl.java#L532-L545 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeGridPoints.java | ST_MakeGridPoints.createGridPoints | public static ResultSet createGridPoints(Connection connection, Value value, double deltaX, double deltaY) throws SQLException {
"""
Create a regular grid of points using the first input value to compute
the full extent.
@param connection
@param value could be the name of a table or a geometry.
@param deltaX... | java | public static ResultSet createGridPoints(Connection connection, Value value, double deltaX, double deltaY) throws SQLException {
if(value == null){
return null;
}
if (value instanceof ValueString) {
GridRowSet gridRowSet = new GridRowSet(connection, deltaX, deltaY, value.... | [
"public",
"static",
"ResultSet",
"createGridPoints",
"(",
"Connection",
"connection",
",",
"Value",
"value",
",",
"double",
"deltaX",
",",
"double",
"deltaY",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
"... | Create a regular grid of points using the first input value to compute
the full extent.
@param connection
@param value could be the name of a table or a geometry.
@param deltaX the X cell size
@param deltaY the Y cell size
@return a resultset that contains all cells as a set of polygons
@throws SQLException | [
"Create",
"a",
"regular",
"grid",
"of",
"points",
"using",
"the",
"first",
"input",
"value",
"to",
"compute",
"the",
"full",
"extent",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeGridPoints.java#L66-L82 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/logging/Logger.java | Logger.logDebug | public final void logDebug(@NonNull final Class<?> tag, @NonNull final String message) {
"""
Logs a specific message on the log level DEBUG.
@param tag
The tag, which identifies the source of the log message, as an instance of the class
{@link Class}. The tag may not be null
@param message
The message, whic... | java | public final void logDebug(@NonNull final Class<?> tag, @NonNull final String message) {
Condition.INSTANCE.ensureNotNull(tag, "The tag may not be null");
Condition.INSTANCE.ensureNotNull(message, "The message may not be null");
Condition.INSTANCE.ensureNotEmpty(message, "The message may not be ... | [
"public",
"final",
"void",
"logDebug",
"(",
"@",
"NonNull",
"final",
"Class",
"<",
"?",
">",
"tag",
",",
"@",
"NonNull",
"final",
"String",
"message",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"tag",
",",
"\"The tag may not be null\"... | Logs a specific message on the log level DEBUG.
@param tag
The tag, which identifies the source of the log message, as an instance of the class
{@link Class}. The tag may not be null
@param message
The message, which should be logged, as a {@link String}. The message may neither be
null, nor empty | [
"Logs",
"a",
"specific",
"message",
"on",
"the",
"log",
"level",
"DEBUG",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/logging/Logger.java#L127-L135 |
wwadge/bonecp | bonecp/src/main/java/com/jolbox/bonecp/BoneCPConfig.java | BoneCPConfig.setConnectionTimeout | public void setConnectionTimeout(long connectionTimeout, TimeUnit timeUnit) {
"""
Sets the maximum time to wait before a call to getConnection is timed out.
Setting this to zero is similar to setting it to Long.MAX_VALUE
@param connectionTimeout
@param timeUnit the unit of the connectionTimeout argument
... | java | public void setConnectionTimeout(long connectionTimeout, TimeUnit timeUnit) {
this.connectionTimeoutInMs = TimeUnit.MILLISECONDS.convert(connectionTimeout, timeUnit);
} | [
"public",
"void",
"setConnectionTimeout",
"(",
"long",
"connectionTimeout",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"this",
".",
"connectionTimeoutInMs",
"=",
"TimeUnit",
".",
"MILLISECONDS",
".",
"convert",
"(",
"connectionTimeout",
",",
"timeUnit",
")",
";",
"}"
... | Sets the maximum time to wait before a call to getConnection is timed out.
Setting this to zero is similar to setting it to Long.MAX_VALUE
@param connectionTimeout
@param timeUnit the unit of the connectionTimeout argument | [
"Sets",
"the",
"maximum",
"time",
"to",
"wait",
"before",
"a",
"call",
"to",
"getConnection",
"is",
"timed",
"out",
"."
] | train | https://github.com/wwadge/bonecp/blob/74bc3287025fc137ca28909f0f7693edae37a15d/bonecp/src/main/java/com/jolbox/bonecp/BoneCPConfig.java#L1027-L1029 |
enioka/jqm | jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/Helpers.java | Helpers.initSingleParam | static void initSingleParam(String key, String initValue, DbConn cnx) {
"""
Checks if a parameter exists. If it exists, it is left untouched. If it doesn't, it is created. Only works for parameters which key
is unique. Must be called from within an open transaction.
"""
try
{
cnx.r... | java | static void initSingleParam(String key, String initValue, DbConn cnx)
{
try
{
cnx.runSelectSingle("globalprm_select_by_key", 2, String.class, key);
return;
}
catch (NoResultException e)
{
GlobalParameter.create(cnx, key, initValue);
... | [
"static",
"void",
"initSingleParam",
"(",
"String",
"key",
",",
"String",
"initValue",
",",
"DbConn",
"cnx",
")",
"{",
"try",
"{",
"cnx",
".",
"runSelectSingle",
"(",
"\"globalprm_select_by_key\"",
",",
"2",
",",
"String",
".",
"class",
",",
"key",
")",
";... | Checks if a parameter exists. If it exists, it is left untouched. If it doesn't, it is created. Only works for parameters which key
is unique. Must be called from within an open transaction. | [
"Checks",
"if",
"a",
"parameter",
"exists",
".",
"If",
"it",
"exists",
"it",
"is",
"left",
"untouched",
".",
"If",
"it",
"doesn",
"t",
"it",
"is",
"created",
".",
"Only",
"works",
"for",
"parameters",
"which",
"key",
"is",
"unique",
".",
"Must",
"be",
... | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/Helpers.java#L219-L234 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/LongExtensions.java | LongExtensions.operator_doubleLessThan | @Pure
@Inline(value="($1 << $2)", constantExpression=true)
public static long operator_doubleLessThan(long a, int distance) {
"""
The binary <code>signed left shift</code> operator. This is the equivalent to the java <code><<</code> operator.
Fills in a zero as the least significant bit.
@param a
a lo... | java | @Pure
@Inline(value="($1 << $2)", constantExpression=true)
public static long operator_doubleLessThan(long a, int distance) {
return a << distance;
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"($1 << $2)\"",
",",
"constantExpression",
"=",
"true",
")",
"public",
"static",
"long",
"operator_doubleLessThan",
"(",
"long",
"a",
",",
"int",
"distance",
")",
"{",
"return",
"a",
"<<",
"distance",
";",
"... | The binary <code>signed left shift</code> operator. This is the equivalent to the java <code><<</code> operator.
Fills in a zero as the least significant bit.
@param a
a long.
@param distance
the number of times to shift.
@return <code>a<<distance</code> | [
"The",
"binary",
"<code",
">",
"signed",
"left",
"shift<",
"/",
"code",
">",
"operator",
".",
"This",
"is",
"the",
"equivalent",
"to",
"the",
"java",
"<code",
">",
"<",
";",
"<",
";",
"<",
"/",
"code",
">",
"operator",
".",
"Fills",
"in",
"a",
... | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/LongExtensions.java#L107-L111 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java | UnconditionalValueDerefSet.setDerefSet | public void setDerefSet(ValueNumber vn, Set<Location> derefSet) {
"""
Set a value as being unconditionally dereferenced at the given set of
locations.
@param vn
the value
@param derefSet
the Set of dereference Locations
"""
if (UnconditionalValueDerefAnalysis.DEBUG) {
System.out.prin... | java | public void setDerefSet(ValueNumber vn, Set<Location> derefSet) {
if (UnconditionalValueDerefAnalysis.DEBUG) {
System.out.println("Adding dereference of " + vn + " for # " + System.identityHashCode(this) + " to " + derefSet);
}
valueNumbersUnconditionallyDereferenced.set(vn.getNumber... | [
"public",
"void",
"setDerefSet",
"(",
"ValueNumber",
"vn",
",",
"Set",
"<",
"Location",
">",
"derefSet",
")",
"{",
"if",
"(",
"UnconditionalValueDerefAnalysis",
".",
"DEBUG",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Adding dereference of \"",
"+... | Set a value as being unconditionally dereferenced at the given set of
locations.
@param vn
the value
@param derefSet
the Set of dereference Locations | [
"Set",
"a",
"value",
"as",
"being",
"unconditionally",
"dereferenced",
"at",
"the",
"given",
"set",
"of",
"locations",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefSet.java#L263-L272 |
nakamura5akihito/six-util | src/main/java/jp/go/aist/six/util/search/RelationalBinding.java | RelationalBinding.notEqualBinding | public static RelationalBinding notEqualBinding(
final String property,
final Object value
) {
"""
Creates a 'NOT_EQUAL' binding.
@param property
the property.
@param value
the value to which the property should be related.
@return
a 'NOT_EQUAL' binding.
"""
... | java | public static RelationalBinding notEqualBinding(
final String property,
final Object value
)
{
return (new RelationalBinding( property, Relation.NOT_EQUAL, value ));
} | [
"public",
"static",
"RelationalBinding",
"notEqualBinding",
"(",
"final",
"String",
"property",
",",
"final",
"Object",
"value",
")",
"{",
"return",
"(",
"new",
"RelationalBinding",
"(",
"property",
",",
"Relation",
".",
"NOT_EQUAL",
",",
"value",
")",
")",
";... | Creates a 'NOT_EQUAL' binding.
@param property
the property.
@param value
the value to which the property should be related.
@return
a 'NOT_EQUAL' binding. | [
"Creates",
"a",
"NOT_EQUAL",
"binding",
"."
] | train | https://github.com/nakamura5akihito/six-util/blob/a6db388a345e220cea2b1fa6324d15c80c6278b6/src/main/java/jp/go/aist/six/util/search/RelationalBinding.java#L70-L76 |
app55/app55-java | src/support/java/com/googlecode/openbeans/beancontext/BeanContextServicesSupport.java | BeanContextServicesSupport.revokeService | public void revokeService(Class serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow) {
"""
Revokes a service in this bean context.
<p>
The given service provider is unregistered and a <code>BeanContextServiceRevokedEvent</code> is fired. All registered service listeners and... | java | public void revokeService(Class serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow)
{
if (serviceClass == null || serviceProvider == null)
{
throw new NullPointerException();
}
synchronized (globalHierarchyLock)
{
synchronized (services)
{
BCSSServiceProv... | [
"public",
"void",
"revokeService",
"(",
"Class",
"serviceClass",
",",
"BeanContextServiceProvider",
"serviceProvider",
",",
"boolean",
"revokeCurrentServicesNow",
")",
"{",
"if",
"(",
"serviceClass",
"==",
"null",
"||",
"serviceProvider",
"==",
"null",
")",
"{",
"th... | Revokes a service in this bean context.
<p>
The given service provider is unregistered and a <code>BeanContextServiceRevokedEvent</code> is fired. All registered service listeners and current
service users get notified.
</p>
@param serviceClass
the service class
@param serviceProvider
the service provider
@param revok... | [
"Revokes",
"a",
"service",
"in",
"this",
"bean",
"context",
".",
"<p",
">",
"The",
"given",
"service",
"provider",
"is",
"unregistered",
"and",
"a",
"<code",
">",
"BeanContextServiceRevokedEvent<",
"/",
"code",
">",
"is",
"fired",
".",
"All",
"registered",
"... | train | https://github.com/app55/app55-java/blob/73e51d0f3141a859dfbd37ca9becef98477e553e/src/support/java/com/googlecode/openbeans/beancontext/BeanContextServicesSupport.java#L916-L951 |
eclipse/xtext-core | org.eclipse.xtext.ide/xtend-gen/org/eclipse/xtext/ide/editor/contentassist/IdeContentProposalCreator.java | IdeContentProposalCreator.createSnippet | public ContentAssistEntry createSnippet(final String proposal, final String label, final ContentAssistContext context) {
"""
Returns an entry of kind snippet with the given proposal and label and the prefix from the context, or null if the proposal is not valid.
@since 2.16
"""
final Procedure1<ContentAss... | java | public ContentAssistEntry createSnippet(final String proposal, final String label, final ContentAssistContext context) {
final Procedure1<ContentAssistEntry> _function = (ContentAssistEntry it) -> {
it.setLabel(label);
};
return this.createProposal(proposal, context.getPrefix(), context, ContentAssist... | [
"public",
"ContentAssistEntry",
"createSnippet",
"(",
"final",
"String",
"proposal",
",",
"final",
"String",
"label",
",",
"final",
"ContentAssistContext",
"context",
")",
"{",
"final",
"Procedure1",
"<",
"ContentAssistEntry",
">",
"_function",
"=",
"(",
"ContentAss... | Returns an entry of kind snippet with the given proposal and label and the prefix from the context, or null if the proposal is not valid.
@since 2.16 | [
"Returns",
"an",
"entry",
"of",
"kind",
"snippet",
"with",
"the",
"given",
"proposal",
"and",
"label",
"and",
"the",
"prefix",
"from",
"the",
"context",
"or",
"null",
"if",
"the",
"proposal",
"is",
"not",
"valid",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.ide/xtend-gen/org/eclipse/xtext/ide/editor/contentassist/IdeContentProposalCreator.java#L44-L49 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayUtil.java | ArrayUtil.haveEqualArrays | public static boolean haveEqualArrays(int[] arra, int[] arrb, int count) {
"""
Returns true if the first count elements of arra and arrb are identical
subarrays of integers
"""
if (count > arra.length || count > arrb.length) {
return false;
}
for (int j = 0; j < count; j+... | java | public static boolean haveEqualArrays(int[] arra, int[] arrb, int count) {
if (count > arra.length || count > arrb.length) {
return false;
}
for (int j = 0; j < count; j++) {
if (arra[j] != arrb[j]) {
return false;
}
}
return... | [
"public",
"static",
"boolean",
"haveEqualArrays",
"(",
"int",
"[",
"]",
"arra",
",",
"int",
"[",
"]",
"arrb",
",",
"int",
"count",
")",
"{",
"if",
"(",
"count",
">",
"arra",
".",
"length",
"||",
"count",
">",
"arrb",
".",
"length",
")",
"{",
"retur... | Returns true if the first count elements of arra and arrb are identical
subarrays of integers | [
"Returns",
"true",
"if",
"the",
"first",
"count",
"elements",
"of",
"arra",
"and",
"arrb",
"are",
"identical",
"subarrays",
"of",
"integers"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayUtil.java#L377-L390 |
glyptodon/guacamole-client | guacamole/src/main/java/org/apache/guacamole/tunnel/StreamInterceptingTunnel.java | StreamInterceptingTunnel.interceptStream | public void interceptStream(int index, InputStream stream)
throws GuacamoleException {
"""
Intercept the given stream, continuously writing the contents of the
given InputStream as blobs. The stream will automatically end when
when the end of the InputStream is reached. If there is no such
stream, t... | java | public void interceptStream(int index, InputStream stream)
throws GuacamoleException {
// Log beginning of intercepted stream
logger.debug("Intercepting input stream #{} of tunnel \"{}\".",
index, getUUID());
try {
inputStreamFilter.interceptStream(index... | [
"public",
"void",
"interceptStream",
"(",
"int",
"index",
",",
"InputStream",
"stream",
")",
"throws",
"GuacamoleException",
"{",
"// Log beginning of intercepted stream",
"logger",
".",
"debug",
"(",
"\"Intercepting input stream #{} of tunnel \\\"{}\\\".\"",
",",
"index",
... | Intercept the given stream, continuously writing the contents of the
given InputStream as blobs. The stream will automatically end when
when the end of the InputStream is reached. If there is no such
stream, then the InputStream will be closed immediately. This function
will block until all data from the InputStream ha... | [
"Intercept",
"the",
"given",
"stream",
"continuously",
"writing",
"the",
"contents",
"of",
"the",
"given",
"InputStream",
"as",
"blobs",
".",
"The",
"stream",
"will",
"automatically",
"end",
"when",
"when",
"the",
"end",
"of",
"the",
"InputStream",
"is",
"reac... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/tunnel/StreamInterceptingTunnel.java#L128-L145 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/services/impl/JPAPersistenceManagerImpl.java | JPAPersistenceManagerImpl.createPsu | private PersistenceServiceUnit createPsu(int jobInstanceVersion, int jobExecutionVersion) throws Exception {
"""
Creates a PersistenceServiceUnit using the specified entity versions.
"""
return databaseStore.createPersistenceServiceUnit(getJobInstanceEntityClass(jobInstanceVersion).getClassLoader(),
... | java | private PersistenceServiceUnit createPsu(int jobInstanceVersion, int jobExecutionVersion) throws Exception {
return databaseStore.createPersistenceServiceUnit(getJobInstanceEntityClass(jobInstanceVersion).getClassLoader(),
getJobExecutionEntityClass(jobE... | [
"private",
"PersistenceServiceUnit",
"createPsu",
"(",
"int",
"jobInstanceVersion",
",",
"int",
"jobExecutionVersion",
")",
"throws",
"Exception",
"{",
"return",
"databaseStore",
".",
"createPersistenceServiceUnit",
"(",
"getJobInstanceEntityClass",
"(",
"jobInstanceVersion",... | Creates a PersistenceServiceUnit using the specified entity versions. | [
"Creates",
"a",
"PersistenceServiceUnit",
"using",
"the",
"specified",
"entity",
"versions",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/services/impl/JPAPersistenceManagerImpl.java#L270-L278 |
casmi/casmi | src/main/java/casmi/graphics/object/Camera.java | Camera.setOrientation | public void setOrientation(double upX, double upY, double upZ) {
"""
Sets which axis is facing upward.
@param upX
Setting which axis is facing upward; usually 0.0, 1.0, or -1.0.
@param upY
Setting which axis is facing upward; usually 0.0, 1.0, or -1.0.
@param upZ
Setting which axis is facing upward; usuall... | java | public void setOrientation(double upX, double upY, double upZ) {
this.upX = upX;
this.upY = upY;
this.upZ = upZ;
} | [
"public",
"void",
"setOrientation",
"(",
"double",
"upX",
",",
"double",
"upY",
",",
"double",
"upZ",
")",
"{",
"this",
".",
"upX",
"=",
"upX",
";",
"this",
".",
"upY",
"=",
"upY",
";",
"this",
".",
"upZ",
"=",
"upZ",
";",
"}"
] | Sets which axis is facing upward.
@param upX
Setting which axis is facing upward; usually 0.0, 1.0, or -1.0.
@param upY
Setting which axis is facing upward; usually 0.0, 1.0, or -1.0.
@param upZ
Setting which axis is facing upward; usually 0.0, 1.0, or -1.0. | [
"Sets",
"which",
"axis",
"is",
"facing",
"upward",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/object/Camera.java#L179-L183 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/source/extractor/extract/sftp/SftpFsHelper.java | SftpFsHelper.getSftpChannel | public ChannelSftp getSftpChannel() throws SftpException {
"""
Create new channel every time a command needs to be executed. This is required to support execution of multiple
commands in parallel. All created channels are cleaned up when the session is closed.
@return a new {@link ChannelSftp}
@throws SftpE... | java | public ChannelSftp getSftpChannel() throws SftpException {
try {
ChannelSftp channelSftp = (ChannelSftp) this.session.openChannel("sftp");
channelSftp.connect();
return channelSftp;
} catch (JSchException e) {
throw new SftpException(0, "Cannot open a channel to SFTP server", e);
}
... | [
"public",
"ChannelSftp",
"getSftpChannel",
"(",
")",
"throws",
"SftpException",
"{",
"try",
"{",
"ChannelSftp",
"channelSftp",
"=",
"(",
"ChannelSftp",
")",
"this",
".",
"session",
".",
"openChannel",
"(",
"\"sftp\"",
")",
";",
"channelSftp",
".",
"connect",
"... | Create new channel every time a command needs to be executed. This is required to support execution of multiple
commands in parallel. All created channels are cleaned up when the session is closed.
@return a new {@link ChannelSftp}
@throws SftpException | [
"Create",
"new",
"channel",
"every",
"time",
"a",
"command",
"needs",
"to",
"be",
"executed",
".",
"This",
"is",
"required",
"to",
"support",
"execution",
"of",
"multiple",
"commands",
"in",
"parallel",
".",
"All",
"created",
"channels",
"are",
"cleaned",
"u... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/extract/sftp/SftpFsHelper.java#L98-L107 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.removeAll | @SafeVarargs
public static char[] removeAll(final char[] a, final char... elements) {
"""
Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection)
"""
if (N.isNullOrEmpty(a)) {
... | java | @SafeVarargs
public static char[] removeAll(final char[] a, final char... elements) {
if (N.isNullOrEmpty(a)) {
return N.EMPTY_CHAR_ARRAY;
} else if (N.isNullOrEmpty(elements)) {
return a.clone();
} else if (elements.length == 1) {
return removeAllO... | [
"@",
"SafeVarargs",
"public",
"static",
"char",
"[",
"]",
"removeAll",
"(",
"final",
"char",
"[",
"]",
"a",
",",
"final",
"char",
"...",
"elements",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"a",
")",
")",
"{",
"return",
"N",
".",
"EMPTY... | Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection) | [
"Returns",
"a",
"new",
"array",
"with",
"removes",
"all",
"the",
"occurrences",
"of",
"specified",
"elements",
"from",
"<code",
">",
"a<",
"/",
"code",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L23374-L23387 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/AttributeService.java | AttributeService.setAttribute | public void setAttribute(File file, String attribute, Object value, boolean create) {
"""
Sets the value of the given attribute to the given value for the given file.
"""
String view = getViewName(attribute);
String attr = getSingleAttribute(attribute);
setAttributeInternal(file, view, attr, value,... | java | public void setAttribute(File file, String attribute, Object value, boolean create) {
String view = getViewName(attribute);
String attr = getSingleAttribute(attribute);
setAttributeInternal(file, view, attr, value, create);
} | [
"public",
"void",
"setAttribute",
"(",
"File",
"file",
",",
"String",
"attribute",
",",
"Object",
"value",
",",
"boolean",
"create",
")",
"{",
"String",
"view",
"=",
"getViewName",
"(",
"attribute",
")",
";",
"String",
"attr",
"=",
"getSingleAttribute",
"(",... | Sets the value of the given attribute to the given value for the given file. | [
"Sets",
"the",
"value",
"of",
"the",
"given",
"attribute",
"to",
"the",
"given",
"value",
"for",
"the",
"given",
"file",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/AttributeService.java#L228-L232 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/dbhandling/TorqueDBHandling.java | TorqueDBHandling.createInitScripts | public void createInitScripts() throws PlatformException {
"""
Creates the initialization scripts (creation of tables etc.) but does
not perform them.
@throws PlatformException If some error occurred
"""
Project project = new Project();
TorqueSQLTask sqlTask = new TorqueSQLTask(... | java | public void createInitScripts() throws PlatformException
{
Project project = new Project();
TorqueSQLTask sqlTask = new TorqueSQLTask();
File schemaDir = null;
File sqlDir = null;
_initScripts.clear();
try
{
... | [
"public",
"void",
"createInitScripts",
"(",
")",
"throws",
"PlatformException",
"{",
"Project",
"project",
"=",
"new",
"Project",
"(",
")",
";",
"TorqueSQLTask",
"sqlTask",
"=",
"new",
"TorqueSQLTask",
"(",
")",
";",
"File",
"schemaDir",
"=",
"null",
";",
"F... | Creates the initialization scripts (creation of tables etc.) but does
not perform them.
@throws PlatformException If some error occurred | [
"Creates",
"the",
"initialization",
"scripts",
"(",
"creation",
"of",
"tables",
"etc",
".",
")",
"but",
"does",
"not",
"perform",
"them",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/dbhandling/TorqueDBHandling.java#L322-L381 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.primitiveArrayGet | protected static List primitiveArrayGet(Object self, Range range) {
"""
Implements the getAt(Range) method for primitive type arrays.
@param self an array object
@param range the range of indices of interest
@return the returned values from the array corresponding to the range
@since 1.5.0
"""
L... | java | protected static List primitiveArrayGet(Object self, Range range) {
List answer = new ArrayList();
for (Object next : range) {
int idx = DefaultTypeTransformation.intUnbox(next);
answer.add(primitiveArrayGet(self, idx));
}
return answer;
} | [
"protected",
"static",
"List",
"primitiveArrayGet",
"(",
"Object",
"self",
",",
"Range",
"range",
")",
"{",
"List",
"answer",
"=",
"new",
"ArrayList",
"(",
")",
";",
"for",
"(",
"Object",
"next",
":",
"range",
")",
"{",
"int",
"idx",
"=",
"DefaultTypeTra... | Implements the getAt(Range) method for primitive type arrays.
@param self an array object
@param range the range of indices of interest
@return the returned values from the array corresponding to the range
@since 1.5.0 | [
"Implements",
"the",
"getAt",
"(",
"Range",
")",
"method",
"for",
"primitive",
"type",
"arrays",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L14556-L14563 |
i-net-software/jlessc | src/com/inet/lib/less/ColorUtils.java | ColorUtils.hsla | static double hsla( double h, double s, double l, double a ) {
"""
Create a color value.
@param h
hue value
@param s
saturation
@param l
lightness
@param a
alpha
@return a color value as long
"""
h = (h % 360) / 360;
s = clamp(s); l = clamp(l); a = clamp(a);
double m2 = l <... | java | static double hsla( double h, double s, double l, double a ) {
h = (h % 360) / 360;
s = clamp(s); l = clamp(l); a = clamp(a);
double m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
double m1 = l * 2 - m2;
return rgba( hslaHue(h + 1.0/3, m1, m2) * 255,
hslaHue... | [
"static",
"double",
"hsla",
"(",
"double",
"h",
",",
"double",
"s",
",",
"double",
"l",
",",
"double",
"a",
")",
"{",
"h",
"=",
"(",
"h",
"%",
"360",
")",
"/",
"360",
";",
"s",
"=",
"clamp",
"(",
"s",
")",
";",
"l",
"=",
"clamp",
"(",
"l",
... | Create a color value.
@param h
hue value
@param s
saturation
@param l
lightness
@param a
alpha
@return a color value as long | [
"Create",
"a",
"color",
"value",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/ColorUtils.java#L234-L246 |
msteiger/jxmapviewer2 | jxmapviewer2/src/main/java/org/jxmapviewer/viewer/AbstractTileFactory.java | AbstractTileFactory.getTile | @Override
public Tile getTile(int x, int y, int zoom) {
"""
Returns the tile that is located at the given tilePoint
for this zoom. For example, if getMapSize() returns 10x20
for this zoom, and the tilePoint is (3,5), then the
appropriate tile will be located and returned.
"""
return getTile(x, y... | java | @Override
public Tile getTile(int x, int y, int zoom)
{
return getTile(x, y, zoom, true);
} | [
"@",
"Override",
"public",
"Tile",
"getTile",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"zoom",
")",
"{",
"return",
"getTile",
"(",
"x",
",",
"y",
",",
"zoom",
",",
"true",
")",
";",
"}"
] | Returns the tile that is located at the given tilePoint
for this zoom. For example, if getMapSize() returns 10x20
for this zoom, and the tilePoint is (3,5), then the
appropriate tile will be located and returned. | [
"Returns",
"the",
"tile",
"that",
"is",
"located",
"at",
"the",
"given",
"tilePoint",
"for",
"this",
"zoom",
".",
"For",
"example",
"if",
"getMapSize",
"()",
"returns",
"10x20",
"for",
"this",
"zoom",
"and",
"the",
"tilePoint",
"is",
"(",
"3",
"5",
")",
... | train | https://github.com/msteiger/jxmapviewer2/blob/82639273b0aac983b6026fb90aa925c0cf596410/jxmapviewer2/src/main/java/org/jxmapviewer/viewer/AbstractTileFactory.java#L75-L79 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java | NetworkInterfacesInner.beginCreateOrUpdate | public NetworkInterfaceInner beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) {
"""
Creates or updates a network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network interface.
@param... | java | public NetworkInterfaceInner beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().single().body();
} | [
"public",
"NetworkInterfaceInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkInterfaceName",
",",
"NetworkInterfaceInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"ne... | Creates or updates a network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network interface.
@param parameters Parameters supplied to the create or update network interface operation.
@throws IllegalArgumentException thrown if parameters fail the valid... | [
"Creates",
"or",
"updates",
"a",
"network",
"interface",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java#L568-L570 |
alkacon/opencms-core | src/org/opencms/search/CmsSearchManager.java | CmsSearchManager.getDocumentFactory | public I_CmsDocumentFactory getDocumentFactory(String resourceType, String mimeType) {
"""
Returns a lucene document factory for given resource type and MIME type.<p>
The type of the document factory is selected according to the configuration
in <code>opencms-search.xml</code>.<p>
@param resourceType the r... | java | public I_CmsDocumentFactory getDocumentFactory(String resourceType, String mimeType) {
I_CmsDocumentFactory result = null;
if (resourceType != null) {
// create the factory lookup key for the document
String documentTypeKey = A_CmsVfsDocument.getDocumentKey(resourceType, mimeTyp... | [
"public",
"I_CmsDocumentFactory",
"getDocumentFactory",
"(",
"String",
"resourceType",
",",
"String",
"mimeType",
")",
"{",
"I_CmsDocumentFactory",
"result",
"=",
"null",
";",
"if",
"(",
"resourceType",
"!=",
"null",
")",
"{",
"// create the factory lookup key for the d... | Returns a lucene document factory for given resource type and MIME type.<p>
The type of the document factory is selected according to the configuration
in <code>opencms-search.xml</code>.<p>
@param resourceType the resource type name
@param mimeType the MIME type
@return a lucene document factory or null in case no... | [
"Returns",
"a",
"lucene",
"document",
"factory",
"for",
"given",
"resource",
"type",
"and",
"MIME",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchManager.java#L1141-L1156 |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/reader/EventReader.java | EventReader.cleanupMessage | private void cleanupMessage(boolean filterSourceOut, boolean downloadLogsSuccess, boolean processSourceSuccess, CloudTrailSource source) {
"""
Clean up the message after CPL finishes the processing.
<p>
<li>If the source is filtered out, the message will be deleted with {@link ProgressState#deleteFilteredMessage... | java | private void cleanupMessage(boolean filterSourceOut, boolean downloadLogsSuccess, boolean processSourceSuccess, CloudTrailSource source) {
if (filterSourceOut) {
deleteMessageAfterProcessSource(ProgressState.deleteFilteredMessage, source);
} else if (processSourceSuccess || sqsManager.should... | [
"private",
"void",
"cleanupMessage",
"(",
"boolean",
"filterSourceOut",
",",
"boolean",
"downloadLogsSuccess",
",",
"boolean",
"processSourceSuccess",
",",
"CloudTrailSource",
"source",
")",
"{",
"if",
"(",
"filterSourceOut",
")",
"{",
"deleteMessageAfterProcessSource",
... | Clean up the message after CPL finishes the processing.
<p>
<li>If the source is filtered out, the message will be deleted with {@link ProgressState#deleteFilteredMessage}.</li>
<li>If the processing is successful, the message with be deleted with {@link ProgressState#deleteMessage}.</li>
<li>If the processing failed d... | [
"Clean",
"up",
"the",
"message",
"after",
"CPL",
"finishes",
"the",
"processing",
".",
"<p",
">",
"<li",
">",
"If",
"the",
"source",
"is",
"filtered",
"out",
"the",
"message",
"will",
"be",
"deleted",
"with",
"{"
] | train | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/reader/EventReader.java#L209-L215 |
ogaclejapan/SmartTabLayout | utils-v4/src/main/java/com/ogaclejapan/smarttablayout/utils/v4/Bundler.java | Bundler.putBinder | @TargetApi(18)
public Bundler putBinder(String key, IBinder value) {
"""
Inserts an {@link android.os.IBinder} value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
<p class="note">You should be very careful when using this function. In many... | java | @TargetApi(18)
public Bundler putBinder(String key, IBinder value) {
bundle.putBinder(key, value);
return this;
} | [
"@",
"TargetApi",
"(",
"18",
")",
"public",
"Bundler",
"putBinder",
"(",
"String",
"key",
",",
"IBinder",
"value",
")",
"{",
"bundle",
".",
"putBinder",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts an {@link android.os.IBinder} value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
<p class="note">You should be very careful when using this function. In many
places where Bundles are used (such as inside of Intent objects), the Bundle
can l... | [
"Inserts",
"an",
"{",
"@link",
"android",
".",
"os",
".",
"IBinder",
"}",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
... | train | https://github.com/ogaclejapan/SmartTabLayout/blob/712e81a92f1e12a3c33dcbda03d813e0162e8589/utils-v4/src/main/java/com/ogaclejapan/smarttablayout/utils/v4/Bundler.java#L364-L368 |
BlueBrain/bluima | modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java | diff_match_patch.diff_toDelta | public String diff_toDelta(LinkedList<Diff> diffs) {
"""
Crush the diff into an encoded string which describes the operations
required to transform text1 into text2. E.g. =3\t-2\t+ing -> Keep 3
chars, delete 2 chars, insert 'ing'. Operations are tab-separated.
Inserted text is escaped using %xx notation.
@pa... | java | public String diff_toDelta(LinkedList<Diff> diffs) {
StringBuilder text = new StringBuilder();
for (Diff aDiff : diffs) {
switch (aDiff.operation) {
case INSERT:
try {
text.append("+")
.append(URLEncoder.encode(aDiff... | [
"public",
"String",
"diff_toDelta",
"(",
"LinkedList",
"<",
"Diff",
">",
"diffs",
")",
"{",
"StringBuilder",
"text",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Diff",
"aDiff",
":",
"diffs",
")",
"{",
"switch",
"(",
"aDiff",
".",
"operation"... | Crush the diff into an encoded string which describes the operations
required to transform text1 into text2. E.g. =3\t-2\t+ing -> Keep 3
chars, delete 2 chars, insert 'ing'. Operations are tab-separated.
Inserted text is escaped using %xx notation.
@param diffs
Array of Diff objects.
@return Delta text. | [
"Crush",
"the",
"diff",
"into",
"an",
"encoded",
"string",
"which",
"describes",
"the",
"operations",
"required",
"to",
"transform",
"text1",
"into",
"text2",
".",
"E",
".",
"g",
".",
"=",
"3",
"\\",
"t",
"-",
"2",
"\\",
"t",
"+",
"ing",
"-",
">",
... | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java#L1551-L1580 |
Sciss/abc4j | abc/src/main/java/abc/ui/swing/JChord.java | JChord.createNormalizedChord | protected JChord createNormalizedChord(MultiNote mNote, ScoreMetrics mtrx, Point2D base) {
"""
Invoked when a multi note is decomposed into multi notes with same strict
duration.
"""
return new JChord(mNote, getClef(), mtrx, base);
} | java | protected JChord createNormalizedChord(MultiNote mNote, ScoreMetrics mtrx, Point2D base) {
return new JChord(mNote, getClef(), mtrx, base);
} | [
"protected",
"JChord",
"createNormalizedChord",
"(",
"MultiNote",
"mNote",
",",
"ScoreMetrics",
"mtrx",
",",
"Point2D",
"base",
")",
"{",
"return",
"new",
"JChord",
"(",
"mNote",
",",
"getClef",
"(",
")",
",",
"mtrx",
",",
"base",
")",
";",
"}"
] | Invoked when a multi note is decomposed into multi notes with same strict
duration. | [
"Invoked",
"when",
"a",
"multi",
"note",
"is",
"decomposed",
"into",
"multi",
"notes",
"with",
"same",
"strict",
"duration",
"."
] | train | https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/JChord.java#L150-L152 |
KyoriPowered/text | api/src/main/java/net/kyori/text/ScoreComponent.java | ScoreComponent.of | public static ScoreComponent of(final @NonNull String name, final @NonNull String objective, final @Nullable String value) {
"""
Creates a score component with a name, objective, and optional value.
@param name the score name
@param objective the score objective
@param value the value
@return the score compo... | java | public static ScoreComponent of(final @NonNull String name, final @NonNull String objective, final @Nullable String value) {
return builder()
.name(name)
.objective(objective)
.value(value)
.build();
} | [
"public",
"static",
"ScoreComponent",
"of",
"(",
"final",
"@",
"NonNull",
"String",
"name",
",",
"final",
"@",
"NonNull",
"String",
"objective",
",",
"final",
"@",
"Nullable",
"String",
"value",
")",
"{",
"return",
"builder",
"(",
")",
".",
"name",
"(",
... | Creates a score component with a name, objective, and optional value.
@param name the score name
@param objective the score objective
@param value the value
@return the score component | [
"Creates",
"a",
"score",
"component",
"with",
"a",
"name",
"objective",
"and",
"optional",
"value",
"."
] | train | https://github.com/KyoriPowered/text/blob/4496c593bf89e8fb036dd6efe26f8ac60f7655c9/api/src/main/java/net/kyori/text/ScoreComponent.java#L96-L102 |
JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BasicChronology.java | BasicChronology.getYearMonthDayMillis | long getYearMonthDayMillis(int year, int month, int dayOfMonth) {
"""
Get the milliseconds for a particular date.
@param year The year to use.
@param month The month to use
@param dayOfMonth The day of the month to use
@return millis from 1970-01-01T00:00:00Z
"""
long millis = getYearMillis(year)... | java | long getYearMonthDayMillis(int year, int month, int dayOfMonth) {
long millis = getYearMillis(year);
millis += getTotalMillisByYearMonth(year, month);
return millis + (dayOfMonth - 1) * (long)DateTimeConstants.MILLIS_PER_DAY;
} | [
"long",
"getYearMonthDayMillis",
"(",
"int",
"year",
",",
"int",
"month",
",",
"int",
"dayOfMonth",
")",
"{",
"long",
"millis",
"=",
"getYearMillis",
"(",
"year",
")",
";",
"millis",
"+=",
"getTotalMillisByYearMonth",
"(",
"year",
",",
"month",
")",
";",
"... | Get the milliseconds for a particular date.
@param year The year to use.
@param month The month to use
@param dayOfMonth The day of the month to use
@return millis from 1970-01-01T00:00:00Z | [
"Get",
"the",
"milliseconds",
"for",
"a",
"particular",
"date",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BasicChronology.java#L411-L415 |
apache/incubator-gobblin | gobblin-compaction/src/main/java/org/apache/gobblin/compaction/verify/CompactionAuditCountVerifier.java | CompactionAuditCountVerifier.passed | private Result passed (String datasetName, Map<String, Long> countsByTier, String referenceTier) {
"""
Compare record count between {@link CompactionAuditCountVerifier#gobblinTier} and {@link CompactionAuditCountVerifier#referenceTiers}.
@param datasetName the name of dataset
@param countsByTier the tier-to-coun... | java | private Result passed (String datasetName, Map<String, Long> countsByTier, String referenceTier) {
if (!countsByTier.containsKey(this.gobblinTier)) {
log.info("Missing entry for dataset: " + datasetName + " in gobblin tier: " + this.gobblinTier + "; setting count to 0.");
}
if (!countsByTier.containsK... | [
"private",
"Result",
"passed",
"(",
"String",
"datasetName",
",",
"Map",
"<",
"String",
",",
"Long",
">",
"countsByTier",
",",
"String",
"referenceTier",
")",
"{",
"if",
"(",
"!",
"countsByTier",
".",
"containsKey",
"(",
"this",
".",
"gobblinTier",
")",
")... | Compare record count between {@link CompactionAuditCountVerifier#gobblinTier} and {@link CompactionAuditCountVerifier#referenceTiers}.
@param datasetName the name of dataset
@param countsByTier the tier-to-count mapping retrieved by {@link AuditCountClient#fetch(String, long, long)}
@param referenceTier the tiers we wa... | [
"Compare",
"record",
"count",
"between",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/verify/CompactionAuditCountVerifier.java#L152-L172 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/context/MethodGenericsContext.java | MethodGenericsContext.parameterTypeAs | public GenericsContext parameterTypeAs(final int pos, final Class<?> asType) {
"""
Create generics context for actual class, passed into parameter type (assuming you have access to that instance
or know exact type). Context will contain correct generics for known declaration type (middle type in
target type hier... | java | public GenericsContext parameterTypeAs(final int pos, final Class<?> asType) {
checkParameter(pos);
return inlyingTypeAs(meth.getGenericParameterTypes()[pos], asType);
} | [
"public",
"GenericsContext",
"parameterTypeAs",
"(",
"final",
"int",
"pos",
",",
"final",
"Class",
"<",
"?",
">",
"asType",
")",
"{",
"checkParameter",
"(",
"pos",
")",
";",
"return",
"inlyingTypeAs",
"(",
"meth",
".",
"getGenericParameterTypes",
"(",
")",
"... | Create generics context for actual class, passed into parameter type (assuming you have access to that instance
or know exact type). Context will contain correct generics for known declaration type (middle type in
target type hierarchy). This is useful when analyzing object instance (introspecting actual object).
<p>
O... | [
"Create",
"generics",
"context",
"for",
"actual",
"class",
"passed",
"into",
"parameter",
"type",
"(",
"assuming",
"you",
"have",
"access",
"to",
"that",
"instance",
"or",
"know",
"exact",
"type",
")",
".",
"Context",
"will",
"contain",
"correct",
"generics",
... | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/context/MethodGenericsContext.java#L177-L180 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getSummonerSpells | public Future<Collection<SummonerSpell>> getSummonerSpells(SpellData data, String version, String locale, boolean dataById) {
"""
<p>
Get a list of all summoner spells as Java Collection
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param data Additional informatio... | java | public Future<Collection<SummonerSpell>> getSummonerSpells(SpellData data, String version, String locale, boolean dataById) {
return new DummyFuture<>(handler.getSummonerSpells(data, version, locale, dataById));
} | [
"public",
"Future",
"<",
"Collection",
"<",
"SummonerSpell",
">",
">",
"getSummonerSpells",
"(",
"SpellData",
"data",
",",
"String",
"version",
",",
"String",
"locale",
",",
"boolean",
"dataById",
")",
"{",
"return",
"new",
"DummyFuture",
"<>",
"(",
"handler",... | <p>
Get a list of all summoner spells as Java Collection
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param data Additional information to retrieve
@param version Data dragon version for returned data
@param locale Locale code for returned data
@param dataById If specified... | [
"<p",
">",
"Get",
"a",
"list",
"of",
"all",
"summoner",
"spells",
"as",
"Java",
"Collection",
"<",
"/",
"p",
">",
"This",
"method",
"does",
"not",
"count",
"towards",
"the",
"rate",
"limit",
"and",
"is",
"not",
"affected",
"by",
"the",
"throttle"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L782-L784 |
phax/ph-commons | ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java | JAXBMarshallerHelper.setSunIndentString | public static void setSunIndentString (@Nonnull final Marshaller aMarshaller, @Nullable final String sIndentString) {
"""
Set the Sun specific property for the indent string.
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param sIndentString
the value to be set
"""
... | java | public static void setSunIndentString (@Nonnull final Marshaller aMarshaller, @Nullable final String sIndentString)
{
final String sPropertyName = SUN_INDENT_STRING;
_setProperty (aMarshaller, sPropertyName, sIndentString);
} | [
"public",
"static",
"void",
"setSunIndentString",
"(",
"@",
"Nonnull",
"final",
"Marshaller",
"aMarshaller",
",",
"@",
"Nullable",
"final",
"String",
"sIndentString",
")",
"{",
"final",
"String",
"sPropertyName",
"=",
"SUN_INDENT_STRING",
";",
"_setProperty",
"(",
... | Set the Sun specific property for the indent string.
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param sIndentString
the value to be set | [
"Set",
"the",
"Sun",
"specific",
"property",
"for",
"the",
"indent",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java#L205-L209 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java | CmsDomUtil.getRelativeY | public static int getRelativeY(int y, Element target) {
"""
Gets the vertical position of the given y-coordinate relative to a given element.<p>
@param y the coordinate to use
@param target the element whose coordinate system is to be used
@return the relative vertical position
@see com.google.gwt.event.... | java | public static int getRelativeY(int y, Element target) {
return (y - target.getAbsoluteTop()) + /* target.getScrollTop() +*/target.getOwnerDocument().getScrollTop();
} | [
"public",
"static",
"int",
"getRelativeY",
"(",
"int",
"y",
",",
"Element",
"target",
")",
"{",
"return",
"(",
"y",
"-",
"target",
".",
"getAbsoluteTop",
"(",
")",
")",
"+",
"/* target.getScrollTop() +*/",
"target",
".",
"getOwnerDocument",
"(",
")",
".",
... | Gets the vertical position of the given y-coordinate relative to a given element.<p>
@param y the coordinate to use
@param target the element whose coordinate system is to be used
@return the relative vertical position
@see com.google.gwt.event.dom.client.MouseEvent#getRelativeY(com.google.gwt.dom.client.Element) | [
"Gets",
"the",
"vertical",
"position",
"of",
"the",
"given",
"y",
"-",
"coordinate",
"relative",
"to",
"a",
"given",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java#L1494-L1497 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java | NotificationHubsInner.listKeysAsync | public Observable<ResourceListKeysInner> listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) {
"""
Gets the Primary and Secondary ConnectionStrings to the NotificationHub.
@param resourceGroupName The name of the resource group.
@param namespa... | java | public Observable<ResourceListKeysInner> listKeysAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) {
return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName).map(new Func1<ServiceResponse<R... | [
"public",
"Observable",
"<",
"ResourceListKeysInner",
">",
"listKeysAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"namespaceName",
",",
"String",
"notificationHubName",
",",
"String",
"authorizationRuleName",
")",
"{",
"return",
"listKeysWithServiceResponseAsyn... | Gets the Primary and Secondary ConnectionStrings to the NotificationHub.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param notificationHubName The notification hub name.
@param authorizationRuleName The connection string of the NotificationHub for the specified au... | [
"Gets",
"the",
"Primary",
"and",
"Secondary",
"ConnectionStrings",
"to",
"the",
"NotificationHub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java#L1493-L1500 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/sql/ObjectReader.java | ObjectReader.readObject | public Object readObject(Object pId, Class pObjClass,
Hashtable pMapping, Hashtable pWhere)
throws SQLException {
"""
Reads the object with the given id from the database, using the given
mapping.
This is the most general form of readObject().
@param id An object uniqu... | java | public Object readObject(Object pId, Class pObjClass,
Hashtable pMapping, Hashtable pWhere)
throws SQLException {
ObjectMapper om = new ObjectMapper(pObjClass, pMapping);
return readObject0(pId, pObjClass, om, pWhere);
} | [
"public",
"Object",
"readObject",
"(",
"Object",
"pId",
",",
"Class",
"pObjClass",
",",
"Hashtable",
"pMapping",
",",
"Hashtable",
"pWhere",
")",
"throws",
"SQLException",
"{",
"ObjectMapper",
"om",
"=",
"new",
"ObjectMapper",
"(",
"pObjClass",
",",
"pMapping",
... | Reads the object with the given id from the database, using the given
mapping.
This is the most general form of readObject().
@param id An object uniquely identifying the object to read
@param objClass The class of the object to read
@param mapping The hashtable containing the object mapping
@param where An hashtable... | [
"Reads",
"the",
"object",
"with",
"the",
"given",
"id",
"from",
"the",
"database",
"using",
"the",
"given",
"mapping",
".",
"This",
"is",
"the",
"most",
"general",
"form",
"of",
"readObject",
"()",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/sql/ObjectReader.java#L586-L591 |
mozilla/rhino | src/org/mozilla/javascript/Parser.java | Parser.nowAllSet | private static final boolean nowAllSet(int before, int after, int mask) {
"""
Returns whether or not the bits in the mask have changed to all set.
@param before bits before change
@param after bits after change
@param mask mask for bits
@return {@code true} if all the bits in the mask are set in "after"
but n... | java | private static final boolean nowAllSet(int before, int after, int mask) {
return ((before & mask) != mask) && ((after & mask) == mask);
} | [
"private",
"static",
"final",
"boolean",
"nowAllSet",
"(",
"int",
"before",
",",
"int",
"after",
",",
"int",
"mask",
")",
"{",
"return",
"(",
"(",
"before",
"&",
"mask",
")",
"!=",
"mask",
")",
"&&",
"(",
"(",
"after",
"&",
"mask",
")",
"==",
"mask... | Returns whether or not the bits in the mask have changed to all set.
@param before bits before change
@param after bits after change
@param mask mask for bits
@return {@code true} if all the bits in the mask are set in "after"
but not in "before" | [
"Returns",
"whether",
"or",
"not",
"the",
"bits",
"in",
"the",
"mask",
"have",
"changed",
"to",
"all",
"set",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Parser.java#L1908-L1910 |
Wadpam/guja | guja-gae/src/main/java/com/wadpam/guja/servlet/GAEBlobServlet.java | GAEBlobServlet.doGet | @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
"""
Url paths supported
/api/blob/upload (GET) Generate upload url
/api/blob?key=<> (GET) Serve a blob
"""
if (req.getRequestURI().endsWith("upload")) {
getUploadUrl(req, resp);... | java | @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
if (req.getRequestURI().endsWith("upload")) {
getUploadUrl(req, resp);
} else if (req.getRequestURI().endsWith("latest")) {
getLatestByName(req, resp);
} else if (null != req... | [
"@",
"Override",
"protected",
"void",
"doGet",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"if",
"(",
"req",
".",
"getRequestURI",
"(",
")",
".",
"endsWith",
"(",
"\"upload\"",... | Url paths supported
/api/blob/upload (GET) Generate upload url
/api/blob?key=<> (GET) Serve a blob | [
"Url",
"paths",
"supported",
"/",
"api",
"/",
"blob",
"/",
"upload",
"(",
"GET",
")",
"Generate",
"upload",
"url",
"/",
"api",
"/",
"blob?key",
"=",
"<",
">",
"(",
"GET",
")",
"Serve",
"a",
"blob"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-gae/src/main/java/com/wadpam/guja/servlet/GAEBlobServlet.java#L58-L69 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.logException | protected void logException(CharSequence msg, Exception e) {
"""
Logs an exception with an introductory message in addition to the
exception's getMessage().
@param msg message
@param e exception
@see Exception#getMessage
"""
System.err.println(msg + ":" + e.getMessage());
e.printStackTrace();
} | java | protected void logException(CharSequence msg, Exception e) {
System.err.println(msg + ":" + e.getMessage());
e.printStackTrace();
} | [
"protected",
"void",
"logException",
"(",
"CharSequence",
"msg",
",",
"Exception",
"e",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"msg",
"+",
"\":\"",
"+",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"e",
".",
"printStackTrace",
"(",
")",
... | Logs an exception with an introductory message in addition to the
exception's getMessage().
@param msg message
@param e exception
@see Exception#getMessage | [
"Logs",
"an",
"exception",
"with",
"an",
"introductory",
"message",
"in",
"addition",
"to",
"the",
"exception",
"s",
"getMessage",
"()",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L1124-L1127 |
buschmais/jqa-maven-plugin | src/main/java/com/buschmais/jqassistant/scm/maven/ProjectResolver.java | ProjectResolver.getRulesDirectory | static File getRulesDirectory(MavenProject rootModule, String rulesDirectory) {
"""
Returns the directory containing rules.
@param rootModule The root module of the project.
@param rulesDirectory The name of the directory used for identifying the root module.
@return The file representing the directory.
... | java | static File getRulesDirectory(MavenProject rootModule, String rulesDirectory) {
File rules = new File(rulesDirectory);
return rules.isAbsolute() ? rules : new File(rootModule.getBasedir().getAbsolutePath() + File.separator + rulesDirectory);
} | [
"static",
"File",
"getRulesDirectory",
"(",
"MavenProject",
"rootModule",
",",
"String",
"rulesDirectory",
")",
"{",
"File",
"rules",
"=",
"new",
"File",
"(",
"rulesDirectory",
")",
";",
"return",
"rules",
".",
"isAbsolute",
"(",
")",
"?",
"rules",
":",
"new... | Returns the directory containing rules.
@param rootModule The root module of the project.
@param rulesDirectory The name of the directory used for identifying the root module.
@return The file representing the directory. | [
"Returns",
"the",
"directory",
"containing",
"rules",
"."
] | train | https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/ProjectResolver.java#L130-L133 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.fbml_setRefHandle | public boolean fbml_setRefHandle(CharSequence handle, CharSequence fbmlMarkup)
throws FacebookException, IOException {
"""
Associates a "<code>handle</code>" with FBML markup so that the handle can be used within the
<a href="http://wiki.developers.facebook.com/index.php/Fb:ref">fb:ref</a> FBML tag.
A handle... | java | public boolean fbml_setRefHandle(CharSequence handle, CharSequence fbmlMarkup)
throws FacebookException, IOException {
return extractBoolean(this.callMethod(FacebookMethod.FBML_SET_REF_HANDLE,
new Pair<String, CharSequence>("handle", handle),
... | [
"public",
"boolean",
"fbml_setRefHandle",
"(",
"CharSequence",
"handle",
",",
"CharSequence",
"fbmlMarkup",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"return",
"extractBoolean",
"(",
"this",
".",
"callMethod",
"(",
"FacebookMethod",
".",
"FBML_SET_R... | Associates a "<code>handle</code>" with FBML markup so that the handle can be used within the
<a href="http://wiki.developers.facebook.com/index.php/Fb:ref">fb:ref</a> FBML tag.
A handle is unique within an application and allows an application to publish identical FBML
to many user profiles and do subsequent updates w... | [
"Associates",
"a",
"<code",
">",
"handle<",
"/",
"code",
">",
"with",
"FBML",
"markup",
"so",
"that",
"the",
"handle",
"can",
"be",
"used",
"within",
"the",
"<a",
"href",
"=",
"http",
":",
"//",
"wiki",
".",
"developers",
".",
"facebook",
".",
"com",
... | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L1596-L1603 |
jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/Action.java | Action.withDelay | public T withDelay(TimeUnit timeUnit, long value) {
"""
The delay before responding with this request as a Delay object, for example new Delay(TimeUnit.SECONDS, 3)
@param timeUnit a the time unit, for example TimeUnit.SECONDS
@param value a the number of time units to delay the response
"""
this... | java | public T withDelay(TimeUnit timeUnit, long value) {
this.delay = new Delay(timeUnit, value);
return (T) this;
} | [
"public",
"T",
"withDelay",
"(",
"TimeUnit",
"timeUnit",
",",
"long",
"value",
")",
"{",
"this",
".",
"delay",
"=",
"new",
"Delay",
"(",
"timeUnit",
",",
"value",
")",
";",
"return",
"(",
"T",
")",
"this",
";",
"}"
] | The delay before responding with this request as a Delay object, for example new Delay(TimeUnit.SECONDS, 3)
@param timeUnit a the time unit, for example TimeUnit.SECONDS
@param value a the number of time units to delay the response | [
"The",
"delay",
"before",
"responding",
"with",
"this",
"request",
"as",
"a",
"Delay",
"object",
"for",
"example",
"new",
"Delay",
"(",
"TimeUnit",
".",
"SECONDS",
"3",
")"
] | train | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/Action.java#L30-L33 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/ruts/message/objective/ObjectiveMessageResources.java | ObjectiveMessageResources.wrapBundle | protected MessageResourceBundleObjectiveWrapper wrapBundle(String messageName, MessageResourceBundle bundle, Integer extendsLevel) {
"""
Wrap the bundle with detail info of message resource. <br>
The parents also wrapped.
@param messageName The message name for the bundle. (NotNull)
@param bundle The bundle of ... | java | protected MessageResourceBundleObjectiveWrapper wrapBundle(String messageName, MessageResourceBundle bundle, Integer extendsLevel) {
final boolean existsDefaultLangProperties = existsDefaultLangProperties(messageName);
final List<MessageResourceBundle> bundleList = new ArrayList<MessageResourceBundle>()... | [
"protected",
"MessageResourceBundleObjectiveWrapper",
"wrapBundle",
"(",
"String",
"messageName",
",",
"MessageResourceBundle",
"bundle",
",",
"Integer",
"extendsLevel",
")",
"{",
"final",
"boolean",
"existsDefaultLangProperties",
"=",
"existsDefaultLangProperties",
"(",
"mes... | Wrap the bundle with detail info of message resource. <br>
The parents also wrapped.
@param messageName The message name for the bundle. (NotNull)
@param bundle The bundle of message resource. (NotNull)
@param extendsLevel The level as integer for extends. e.g. first extends is 1 (NullAllowed: when application)
@return... | [
"Wrap",
"the",
"bundle",
"with",
"detail",
"info",
"of",
"message",
"resource",
".",
"<br",
">",
"The",
"parents",
"also",
"wrapped",
"."
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/ruts/message/objective/ObjectiveMessageResources.java#L545-L562 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.isMonitorNotify | public static boolean isMonitorNotify(Instruction ins, ConstantPoolGen cpg) {
"""
Determine if given Instruction is a monitor wait.
@param ins
the Instruction
@param cpg
the ConstantPoolGen for the Instruction
@return true if the instruction is a monitor wait, false if not
"""
if (!(ins instan... | java | public static boolean isMonitorNotify(Instruction ins, ConstantPoolGen cpg) {
if (!(ins instanceof InvokeInstruction)) {
return false;
}
if (ins.getOpcode() == Const.INVOKESTATIC) {
return false;
}
InvokeInstruction inv = (InvokeInstruction) ins;
... | [
"public",
"static",
"boolean",
"isMonitorNotify",
"(",
"Instruction",
"ins",
",",
"ConstantPoolGen",
"cpg",
")",
"{",
"if",
"(",
"!",
"(",
"ins",
"instanceof",
"InvokeInstruction",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"ins",
".",
"getOpco... | Determine if given Instruction is a monitor wait.
@param ins
the Instruction
@param cpg
the ConstantPoolGen for the Instruction
@return true if the instruction is a monitor wait, false if not | [
"Determine",
"if",
"given",
"Instruction",
"is",
"a",
"monitor",
"wait",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L204-L217 |
google/closure-templates | java/src/com/google/template/soy/pysrc/restricted/PyExprUtils.java | PyExprUtils.genPyNullCheck | public static PyExpr genPyNullCheck(PyExpr expr) {
"""
Generates a Python null (None) check expression for the given {@link PyExpr}.
"""
ImmutableList<PyExpr> exprs = ImmutableList.of(expr, new PyExpr("None", Integer.MAX_VALUE));
// Note: is/is not is Python's identity comparison. It's used for None ch... | java | public static PyExpr genPyNullCheck(PyExpr expr) {
ImmutableList<PyExpr> exprs = ImmutableList.of(expr, new PyExpr("None", Integer.MAX_VALUE));
// Note: is/is not is Python's identity comparison. It's used for None checks for performance.
String conditionalExpr = genExprWithNewToken(Operator.EQUAL, exprs, "... | [
"public",
"static",
"PyExpr",
"genPyNullCheck",
"(",
"PyExpr",
"expr",
")",
"{",
"ImmutableList",
"<",
"PyExpr",
">",
"exprs",
"=",
"ImmutableList",
".",
"of",
"(",
"expr",
",",
"new",
"PyExpr",
"(",
"\"None\"",
",",
"Integer",
".",
"MAX_VALUE",
")",
")",
... | Generates a Python null (None) check expression for the given {@link PyExpr}. | [
"Generates",
"a",
"Python",
"null",
"(",
"None",
")",
"check",
"expression",
"for",
"the",
"given",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/restricted/PyExprUtils.java#L137-L142 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/MetaApi.java | MetaApi.getHeadersAsync | public com.squareup.okhttp.Call getHeadersAsync(final ApiCallback<Map<String, String>> callback)
throws ApiException {
"""
Debug request headers (asynchronously) Echo the request headers for
debugging purposes. Note that the 'Connection' header and any
'X-' headers are not included
... | java | public com.squareup.okhttp.Call getHeadersAsync(final ApiCallback<Map<String, String>> callback)
throws ApiException {
com.squareup.okhttp.Call call = getHeadersValidateBeforeCall(callback);
Type localVarReturnType = new TypeToken<Map<String, String>>() {
}.getType();
apiCli... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"getHeadersAsync",
"(",
"final",
"ApiCallback",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"callback",
")",
"throws",
"ApiException",
"{",
"com",
".",
"squareup",
".",
"okhttp",
".",
... | Debug request headers (asynchronously) Echo the request headers for
debugging purposes. Note that the 'Connection' header and any
'X-' headers are not included
@param callback
The callback to be executed when the API call finishes
@return The request call
@throws ApiException
If fail to process the API... | [
"Debug",
"request",
"headers",
"(",
"asynchronously",
")",
"Echo",
"the",
"request",
"headers",
"for",
"debugging",
"purposes",
".",
"Note",
"that",
"the",
"'",
";",
"Connection'",
";",
"header",
"and",
"any",
"'",
";",
"X",
"-",
"'",
";",
"hea... | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/MetaApi.java#L143-L151 |
JadiraOrg/jadira | jms/src/main/java/org/jadira/jms/template/BatchedJmsTemplate.java | BatchedJmsTemplate.receiveSelectedBatch | public List<Message> receiveSelectedBatch(String destinationName, String messageSelector) throws JmsException {
"""
Receive a batch of up to default batch size for given destination name and message selector. Other than batching this method is the same as {@link JmsTemplate#receiveSelected(String, String)}
@retur... | java | public List<Message> receiveSelectedBatch(String destinationName, String messageSelector) throws JmsException {
return receiveSelectedBatch(destinationName, messageSelector, getBatchSize());
} | [
"public",
"List",
"<",
"Message",
">",
"receiveSelectedBatch",
"(",
"String",
"destinationName",
",",
"String",
"messageSelector",
")",
"throws",
"JmsException",
"{",
"return",
"receiveSelectedBatch",
"(",
"destinationName",
",",
"messageSelector",
",",
"getBatchSize",
... | Receive a batch of up to default batch size for given destination name and message selector. Other than batching this method is the same as {@link JmsTemplate#receiveSelected(String, String)}
@return A list of {@link Message}
@param destinationName The destination name
@param messageSelector The Selector
@throws JmsExc... | [
"Receive",
"a",
"batch",
"of",
"up",
"to",
"default",
"batch",
"size",
"for",
"given",
"destination",
"name",
"and",
"message",
"selector",
".",
"Other",
"than",
"batching",
"this",
"method",
"is",
"the",
"same",
"as",
"{"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/jms/src/main/java/org/jadira/jms/template/BatchedJmsTemplate.java#L245-L247 |
Azure/azure-sdk-for-java | cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java | AccountsInner.listSkus | public CognitiveServicesAccountEnumerateSkusResultInner listSkus(String resourceGroupName, String accountName) {
"""
List available SKUs for the requested Cognitive Services account.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountName The name of Cognitive... | java | public CognitiveServicesAccountEnumerateSkusResultInner listSkus(String resourceGroupName, String accountName) {
return listSkusWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body();
} | [
"public",
"CognitiveServicesAccountEnumerateSkusResultInner",
"listSkus",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
")",
"{",
"return",
"listSkusWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
")",
".",
"toBlocking",
"(",
")"... | List available SKUs for the requested Cognitive Services account.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountName The name of Cognitive Services account.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorException thrown if... | [
"List",
"available",
"SKUs",
"for",
"the",
"requested",
"Cognitive",
"Services",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java#L988-L990 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/ValueMap.java | ValueMap.getInt | public int getInt(String key, int defaultValue) {
"""
Returns the value mapped by {@code key} if it exists and is a integer or can be coerced to a
integer. Returns {@code defaultValue} otherwise.
"""
Object value = get(key);
if (value instanceof Integer) {
return (int) value;
}
if (value... | java | public int getInt(String key, int defaultValue) {
Object value = get(key);
if (value instanceof Integer) {
return (int) value;
}
if (value instanceof Number) {
return ((Number) value).intValue();
} else if (value instanceof String) {
try {
return Integer.valueOf((String) va... | [
"public",
"int",
"getInt",
"(",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"Object",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"instanceof",
"Integer",
")",
"{",
"return",
"(",
"int",
")",
"value",
";",
"}",
"if",
"... | Returns the value mapped by {@code key} if it exists and is a integer or can be coerced to a
integer. Returns {@code defaultValue} otherwise. | [
"Returns",
"the",
"value",
"mapped",
"by",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/ValueMap.java#L175-L189 |
Javen205/IJPay | src/main/java/com/jpay/util/HttpKitExt.java | HttpKitExt.downloadMaterial | protected static InputStream downloadMaterial(String url, String params) throws IOException {
"""
获取永久素材
@param url
素材地址
@return params post参数
@return InputStream 流,考虑到这里可能返回json或file
@throws IOException
"""
URL _url = new URL(url);
HttpURLConnection conn = (HttpURLConnection) _url.openConnection();... | java | protected static InputStream downloadMaterial(String url, String params) throws IOException {
URL _url = new URL(url);
HttpURLConnection conn = (HttpURLConnection) _url.openConnection();
// 连接超时
conn.setConnectTimeout(25000);
// 读取超时 --服务器响应比较慢,增大时间
conn.setReadTimeout(25000);
conn.setRequestMethod("POST"... | [
"protected",
"static",
"InputStream",
"downloadMaterial",
"(",
"String",
"url",
",",
"String",
"params",
")",
"throws",
"IOException",
"{",
"URL",
"_url",
"=",
"new",
"URL",
"(",
"url",
")",
";",
"HttpURLConnection",
"conn",
"=",
"(",
"HttpURLConnection",
")",... | 获取永久素材
@param url
素材地址
@return params post参数
@return InputStream 流,考虑到这里可能返回json或file
@throws IOException | [
"获取永久素材"
] | train | https://github.com/Javen205/IJPay/blob/78da6be4b70675abc6a41df74817532fa257ef29/src/main/java/com/jpay/util/HttpKitExt.java#L113-L133 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/batchai/v2018_03_01/implementation/FileServersInner.java | FileServersInner.getByResourceGroup | public FileServerInner getByResourceGroup(String resourceGroupName, String fileServerName) {
"""
Gets information about the specified Cluster.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param fileServerName The name of the file server within the specified resource group... | java | public FileServerInner getByResourceGroup(String resourceGroupName, String fileServerName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, fileServerName).toBlocking().single().body();
} | [
"public",
"FileServerInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"fileServerName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"fileServerName",
")",
".",
"toBlocking",
"(",
")",
"."... | Gets information about the specified Cluster.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param fileServerName The name of the file server within the specified resource group. File server names can only contain a combination of alphanumeric characters along with dash (-) and und... | [
"Gets",
"information",
"about",
"the",
"specified",
"Cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/batchai/v2018_03_01/implementation/FileServersInner.java#L445-L447 |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ServiceExtensionLoader.java | ServiceExtensionLoader.createExtension | private <T extends Assignable> T createExtension(Class<T> extensionImplClass, Archive<?> archive) {
"""
Creates an instance of <code>extensionImplClass</code> using <code>archive</code> as the parameter for its
one-argument list constructor.
@param <T>
@param extensionImplClass
@param archive
@return
""... | java | private <T extends Assignable> T createExtension(Class<T> extensionImplClass, Archive<?> archive) {
T extension;
Constructor<T> extensionImplConstructor = findConstructor(extensionImplClass);
@SuppressWarnings("unchecked")
Class<T> constructorArg = (Class<T>) extensionImplConstructor.g... | [
"private",
"<",
"T",
"extends",
"Assignable",
">",
"T",
"createExtension",
"(",
"Class",
"<",
"T",
">",
"extensionImplClass",
",",
"Archive",
"<",
"?",
">",
"archive",
")",
"{",
"T",
"extension",
";",
"Constructor",
"<",
"T",
">",
"extensionImplConstructor",... | Creates an instance of <code>extensionImplClass</code> using <code>archive</code> as the parameter for its
one-argument list constructor.
@param <T>
@param extensionImplClass
@param archive
@return | [
"Creates",
"an",
"instance",
"of",
"<code",
">",
"extensionImplClass<",
"/",
"code",
">",
"using",
"<code",
">",
"archive<",
"/",
"code",
">",
"as",
"the",
"parameter",
"for",
"its",
"one",
"-",
"argument",
"list",
"constructor",
"."
] | train | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ServiceExtensionLoader.java#L344-L370 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.