repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 204 | func_name stringlengths 5 103 | whole_func_string stringlengths 87 3.44k | language stringclasses 1
value | func_code_string stringlengths 87 3.44k | func_code_tokens listlengths 21 714 | func_documentation_string stringlengths 61 1.95k | func_documentation_tokens listlengths 1 482 | split_name stringclasses 1
value | func_code_url stringlengths 102 309 |
|---|---|---|---|---|---|---|---|---|---|---|
UrielCh/ovh-java-sdk | ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java | ApiOvhSms.virtualNumbers_number_serviceInfos_PUT | public void virtualNumbers_number_serviceInfos_PUT(String number, OvhService body) throws IOException {
String qPath = "/sms/virtualNumbers/{number}/serviceInfos";
StringBuilder sb = path(qPath, number);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void virtualNumbers_number_serviceInfos_PUT(String number, OvhService body) throws IOException {
String qPath = "/sms/virtualNumbers/{number}/serviceInfos";
StringBuilder sb = path(qPath, number);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"virtualNumbers_number_serviceInfos_PUT",
"(",
"String",
"number",
",",
"OvhService",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/sms/virtualNumbers/{number}/serviceInfos\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPa... | Alter this object properties
REST: PUT /sms/virtualNumbers/{number}/serviceInfos
@param body [required] New object properties
@param number [required] Your virtual number | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L1761-L1765 |
google/closure-templates | java/src/com/google/template/soy/shared/internal/SharedRuntime.java | SharedRuntime.compareString | public static boolean compareString(String string, SoyValue other) {
// This follows similarly to the Javascript specification, to ensure similar operation
// over Javascript and Java: http://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3
if (other instanceof StringData || other instanceof SanitizedCon... | java | public static boolean compareString(String string, SoyValue other) {
// This follows similarly to the Javascript specification, to ensure similar operation
// over Javascript and Java: http://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3
if (other instanceof StringData || other instanceof SanitizedCon... | [
"public",
"static",
"boolean",
"compareString",
"(",
"String",
"string",
",",
"SoyValue",
"other",
")",
"{",
"// This follows similarly to the Javascript specification, to ensure similar operation",
"// over Javascript and Java: http://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3",
... | Determines if the operand's string form can be equality-compared with a string. | [
"Determines",
"if",
"the",
"operand",
"s",
"string",
"form",
"can",
"be",
"equality",
"-",
"compared",
"with",
"a",
"string",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/shared/internal/SharedRuntime.java#L122-L138 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcHttpAsyncClient.java | JsonRpcHttpAsyncClient.readResponse | private <T> T readResponse(Type returnType, InputStream ips) throws Throwable {
JsonNode response = mapper.readTree(new NoCloseInputStream(ips));
logger.debug("JSON-PRC Response: {}", response);
if (!response.isObject()) {
throw new JsonRpcClientException(0, "Invalid JSON-RPC response", response);
}
Object... | java | private <T> T readResponse(Type returnType, InputStream ips) throws Throwable {
JsonNode response = mapper.readTree(new NoCloseInputStream(ips));
logger.debug("JSON-PRC Response: {}", response);
if (!response.isObject()) {
throw new JsonRpcClientException(0, "Invalid JSON-RPC response", response);
}
Object... | [
"private",
"<",
"T",
">",
"T",
"readResponse",
"(",
"Type",
"returnType",
",",
"InputStream",
"ips",
")",
"throws",
"Throwable",
"{",
"JsonNode",
"response",
"=",
"mapper",
".",
"readTree",
"(",
"new",
"NoCloseInputStream",
"(",
"ips",
")",
")",
";",
"logg... | Reads a JSON-PRC response from the server. This blocks until a response
is received.
@param returnType the expected return type
@param ips the {@link InputStream} to read from
@return the object returned by the JSON-RPC response
@throws Throwable on error | [
"Reads",
"a",
"JSON",
"-",
"PRC",
"response",
"from",
"the",
"server",
".",
"This",
"blocks",
"until",
"a",
"response",
"is",
"received",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcHttpAsyncClient.java#L380-L399 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mock/CommonsAssert.java | CommonsAssert.assertEquals | public static <T> void assertEquals (@Nullable final T x, @Nullable final T y)
{
assertEquals ((String) null, x, y);
} | java | public static <T> void assertEquals (@Nullable final T x, @Nullable final T y)
{
assertEquals ((String) null, x, y);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"assertEquals",
"(",
"@",
"Nullable",
"final",
"T",
"x",
",",
"@",
"Nullable",
"final",
"T",
"y",
")",
"{",
"assertEquals",
"(",
"(",
"String",
")",
"null",
",",
"x",
",",
"y",
")",
";",
"}"
] | Like JUnit assertEquals but using {@link EqualsHelper}.
@param x
Fist object. May be <code>null</code>
@param y
Second object. May be <code>null</code>. | [
"Like",
"JUnit",
"assertEquals",
"but",
"using",
"{",
"@link",
"EqualsHelper",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mock/CommonsAssert.java#L170-L173 |
citrusframework/citrus | modules/citrus-selenium/src/main/java/com/consol/citrus/selenium/actions/FindElementAction.java | FindElementAction.validateElementProperty | private void validateElementProperty(String propertyName, String controlValue, String resultValue, TestContext context) {
if (StringUtils.hasText(controlValue)) {
String control = context.replaceDynamicContentInString(controlValue);
if (ValidationMatcherUtils.isValidationMatcherExpressi... | java | private void validateElementProperty(String propertyName, String controlValue, String resultValue, TestContext context) {
if (StringUtils.hasText(controlValue)) {
String control = context.replaceDynamicContentInString(controlValue);
if (ValidationMatcherUtils.isValidationMatcherExpressi... | [
"private",
"void",
"validateElementProperty",
"(",
"String",
"propertyName",
",",
"String",
"controlValue",
",",
"String",
"resultValue",
",",
"TestContext",
"context",
")",
"{",
"if",
"(",
"StringUtils",
".",
"hasText",
"(",
"controlValue",
")",
")",
"{",
"Stri... | Validates web element property value with validation matcher support.
@param propertyName
@param controlValue
@param resultValue
@param context | [
"Validates",
"web",
"element",
"property",
"value",
"with",
"validation",
"matcher",
"support",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-selenium/src/main/java/com/consol/citrus/selenium/actions/FindElementAction.java#L114-L124 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updateEntityRoleWithServiceResponseAsync | public Observable<ServiceResponse<OperationStatus>> updateEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateEntityRoleOptionalParameter updateEntityRoleOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Para... | java | public Observable<ServiceResponse<OperationStatus>> updateEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateEntityRoleOptionalParameter updateEntityRoleOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Para... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"OperationStatus",
">",
">",
"updateEntityRoleWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
",",
"UpdateEntityRoleOptionalParameter",
"upd... | Update an entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role ID.
@param updateEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgument... | [
"Update",
"an",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L10893-L10912 |
SpartaTech/sparta-spring-web-utils | src/main/java/org/sparta/springwebutils/SpringContextUtils.java | SpringContextUtils.buildListableBeanFactory | private static DefaultListableBeanFactory buildListableBeanFactory(Map<String, ?> extraBeans) {
//new empty context
final DefaultListableBeanFactory parentBeanFactory = new DefaultListableBeanFactory();
//Injection of the new beans in the context
for (String key : extraBeans.k... | java | private static DefaultListableBeanFactory buildListableBeanFactory(Map<String, ?> extraBeans) {
//new empty context
final DefaultListableBeanFactory parentBeanFactory = new DefaultListableBeanFactory();
//Injection of the new beans in the context
for (String key : extraBeans.k... | [
"private",
"static",
"DefaultListableBeanFactory",
"buildListableBeanFactory",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"extraBeans",
")",
"{",
"//new empty context",
"final",
"DefaultListableBeanFactory",
"parentBeanFactory",
"=",
"new",
"DefaultListableBeanFactory",
"(",... | Builds a listable bean factory with the given beans.
@param extraBeans
@return new Created BeanFactory | [
"Builds",
"a",
"listable",
"bean",
"factory",
"with",
"the",
"given",
"beans",
"."
] | train | https://github.com/SpartaTech/sparta-spring-web-utils/blob/f5382474d46a6048d58707fc64e7936277e8b2ce/src/main/java/org/sparta/springwebutils/SpringContextUtils.java#L112-L121 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.split | public static <T> List<List<T>> split(final Collection<? extends T> c, final int size) {
if (size < 1) {
throw new IllegalArgumentException("The parameter 'size' can not be zero or less than zero");
}
if (N.isNullOrEmpty(c)) {
return new ArrayList<>();
}
... | java | public static <T> List<List<T>> split(final Collection<? extends T> c, final int size) {
if (size < 1) {
throw new IllegalArgumentException("The parameter 'size' can not be zero or less than zero");
}
if (N.isNullOrEmpty(c)) {
return new ArrayList<>();
}
... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"List",
"<",
"T",
">",
">",
"split",
"(",
"final",
"Collection",
"<",
"?",
"extends",
"T",
">",
"c",
",",
"final",
"int",
"size",
")",
"{",
"if",
"(",
"size",
"<",
"1",
")",
"{",
"throw",
"new",
... | Returns consecutive sub lists of a collection, each of the same size (the final list may be smaller).
or an empty List if the specified collection is null or empty. The order of elements in the original collection is kept
@param c
@param size
@return | [
"Returns",
"consecutive",
"sub",
"lists",
"of",
"a",
"collection",
"each",
"of",
"the",
"same",
"size",
"(",
"the",
"final",
"list",
"may",
"be",
"smaller",
")",
".",
"or",
"an",
"empty",
"List",
"if",
"the",
"specified",
"collection",
"is",
"null",
"or"... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L18665-L18675 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/security/CryptoPrimitives.java | CryptoPrimitives.certificationRequestToPEM | private String certificationRequestToPEM(PKCS10CertificationRequest csr) throws IOException {
PemObject pemCSR = new PemObject("CERTIFICATE REQUEST", csr.getEncoded());
StringWriter str = new StringWriter();
JcaPEMWriter pemWriter = new JcaPEMWriter(str);
pemWriter.writeObject(pemCSR);
... | java | private String certificationRequestToPEM(PKCS10CertificationRequest csr) throws IOException {
PemObject pemCSR = new PemObject("CERTIFICATE REQUEST", csr.getEncoded());
StringWriter str = new StringWriter();
JcaPEMWriter pemWriter = new JcaPEMWriter(str);
pemWriter.writeObject(pemCSR);
... | [
"private",
"String",
"certificationRequestToPEM",
"(",
"PKCS10CertificationRequest",
"csr",
")",
"throws",
"IOException",
"{",
"PemObject",
"pemCSR",
"=",
"new",
"PemObject",
"(",
"\"CERTIFICATE REQUEST\"",
",",
"csr",
".",
"getEncoded",
"(",
")",
")",
";",
"StringW... | certificationRequestToPEM - Convert a PKCS10CertificationRequest to PEM
format.
@param csr The Certificate to convert
@return An equivalent PEM format certificate.
@throws IOException | [
"certificationRequestToPEM",
"-",
"Convert",
"a",
"PKCS10CertificationRequest",
"to",
"PEM",
"format",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/security/CryptoPrimitives.java#L815-L824 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/KNNDistancesSampler.java | KNNDistancesSampler.run | public KNNDistanceOrderResult run(Database database, Relation<O> relation) {
final DistanceQuery<O> distanceQuery = database.getDistanceQuery(relation, getDistanceFunction());
final KNNQuery<O> knnQuery = database.getKNNQuery(distanceQuery, k + 1);
final int size = (int) ((sample <= 1.) ? Math.ceil(relatio... | java | public KNNDistanceOrderResult run(Database database, Relation<O> relation) {
final DistanceQuery<O> distanceQuery = database.getDistanceQuery(relation, getDistanceFunction());
final KNNQuery<O> knnQuery = database.getKNNQuery(distanceQuery, k + 1);
final int size = (int) ((sample <= 1.) ? Math.ceil(relatio... | [
"public",
"KNNDistanceOrderResult",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"O",
">",
"relation",
")",
"{",
"final",
"DistanceQuery",
"<",
"O",
">",
"distanceQuery",
"=",
"database",
".",
"getDistanceQuery",
"(",
"relation",
",",
"getDistanceFu... | Provides an order of the kNN-distances for all objects within the specified
database.
@param database Database
@param relation Relation
@return Result | [
"Provides",
"an",
"order",
"of",
"the",
"kNN",
"-",
"distances",
"for",
"all",
"objects",
"within",
"the",
"specified",
"database",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/KNNDistancesSampler.java#L137-L155 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java | CmsSerialDateView.showCurrentDates | public void showCurrentDates(Collection<CmsPair<Date, Boolean>> dates) {
m_overviewList.setDatesWithCheckState(dates);
m_overviewPopup.center();
} | java | public void showCurrentDates(Collection<CmsPair<Date, Boolean>> dates) {
m_overviewList.setDatesWithCheckState(dates);
m_overviewPopup.center();
} | [
"public",
"void",
"showCurrentDates",
"(",
"Collection",
"<",
"CmsPair",
"<",
"Date",
",",
"Boolean",
">",
">",
"dates",
")",
"{",
"m_overviewList",
".",
"setDatesWithCheckState",
"(",
"dates",
")",
";",
"m_overviewPopup",
".",
"center",
"(",
")",
";",
"}"
] | Shows the provided list of dates as current dates.
@param dates the current dates to show, accompanied with the information if they are exceptions or not. | [
"Shows",
"the",
"provided",
"list",
"of",
"dates",
"as",
"current",
"dates",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L339-L344 |
Netflix/conductor | core/src/main/java/com/netflix/conductor/service/WorkflowServiceImpl.java | WorkflowServiceImpl.rerunWorkflow | @Service
public String rerunWorkflow(String workflowId, RerunWorkflowRequest request) {
request.setReRunFromWorkflowId(workflowId);
return workflowExecutor.rerun(request);
} | java | @Service
public String rerunWorkflow(String workflowId, RerunWorkflowRequest request) {
request.setReRunFromWorkflowId(workflowId);
return workflowExecutor.rerun(request);
} | [
"@",
"Service",
"public",
"String",
"rerunWorkflow",
"(",
"String",
"workflowId",
",",
"RerunWorkflowRequest",
"request",
")",
"{",
"request",
".",
"setReRunFromWorkflowId",
"(",
"workflowId",
")",
";",
"return",
"workflowExecutor",
".",
"rerun",
"(",
"request",
"... | Reruns the workflow from a specific task.
@param workflowId WorkflowId of the workflow you want to rerun.
@param request (@link RerunWorkflowRequest) for the workflow.
@return WorkflowId of the rerun workflow. | [
"Reruns",
"the",
"workflow",
"from",
"a",
"specific",
"task",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/service/WorkflowServiceImpl.java#L279-L283 |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/thesis/ThesisTimelineQueryReportPage.java | ThesisTimelineQueryReportPage.createStatistics | private QueryFieldDataStatistics createStatistics(List<Double> data, double min, double max, double step) {
Map<Double, String> dataNames = new HashMap<>();
for (double d = min; d <= max; d += step) {
String caption = step % 1 == 0 ? Long.toString(Math.round(d)) : Double.toString(d);
dataNames.... | java | private QueryFieldDataStatistics createStatistics(List<Double> data, double min, double max, double step) {
Map<Double, String> dataNames = new HashMap<>();
for (double d = min; d <= max; d += step) {
String caption = step % 1 == 0 ? Long.toString(Math.round(d)) : Double.toString(d);
dataNames.... | [
"private",
"QueryFieldDataStatistics",
"createStatistics",
"(",
"List",
"<",
"Double",
">",
"data",
",",
"double",
"min",
",",
"double",
"max",
",",
"double",
"step",
")",
"{",
"Map",
"<",
"Double",
",",
"String",
">",
"dataNames",
"=",
"new",
"HashMap",
"... | Creates statistics object
@param data data
@param min min
@param max max
@param step step
@return statistics object | [
"Creates",
"statistics",
"object"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/thesis/ThesisTimelineQueryReportPage.java#L142-L151 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java | JsonModelCoder.encodeNullToBlank | public void encodeNullToBlank(Writer writer, T obj) throws IOException {
if (obj == null) {
writer.write("{}");
writer.flush();
return;
}
encodeNullToNull(writer, obj);
} | java | public void encodeNullToBlank(Writer writer, T obj) throws IOException {
if (obj == null) {
writer.write("{}");
writer.flush();
return;
}
encodeNullToNull(writer, obj);
} | [
"public",
"void",
"encodeNullToBlank",
"(",
"Writer",
"writer",
",",
"T",
"obj",
")",
"throws",
"IOException",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"writer",
".",
"write",
"(",
"\"{}\"",
")",
";",
"writer",
".",
"flush",
"(",
")",
";",
"ret... | Encodes the given value into the JSON format, and writes it using the given writer.<br>
Writes "{}" if null is given.
@param writer {@link Writer} to be used for writing value
@param obj Value to encoded
@throws IOException | [
"Encodes",
"the",
"given",
"value",
"into",
"the",
"JSON",
"format",
"and",
"writes",
"it",
"using",
"the",
"given",
"writer",
".",
"<br",
">",
"Writes",
"{}",
"if",
"null",
"is",
"given",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java#L411-L419 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfStamperImp.java | PdfStamperImp.setTransition | void setTransition(PdfTransition transition, int page) {
PdfDictionary pg = reader.getPageN(page);
if (transition == null)
pg.remove(PdfName.TRANS);
else
pg.put(PdfName.TRANS, transition.getTransitionDictionary());
markUsed(pg);
} | java | void setTransition(PdfTransition transition, int page) {
PdfDictionary pg = reader.getPageN(page);
if (transition == null)
pg.remove(PdfName.TRANS);
else
pg.put(PdfName.TRANS, transition.getTransitionDictionary());
markUsed(pg);
} | [
"void",
"setTransition",
"(",
"PdfTransition",
"transition",
",",
"int",
"page",
")",
"{",
"PdfDictionary",
"pg",
"=",
"reader",
".",
"getPageN",
"(",
"page",
")",
";",
"if",
"(",
"transition",
"==",
"null",
")",
"pg",
".",
"remove",
"(",
"PdfName",
".",... | Sets the transition for the page
@param transition the transition object. A <code>null</code> removes the transition
@param page the page where the transition will be applied. The first page is 1 | [
"Sets",
"the",
"transition",
"for",
"the",
"page"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfStamperImp.java#L1432-L1439 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslContext.java | SslContext.newHandler | public SslHandler newHandler(ByteBufAllocator alloc, Executor delegatedTaskExecutor) {
return newHandler(alloc, startTls, delegatedTaskExecutor);
} | java | public SslHandler newHandler(ByteBufAllocator alloc, Executor delegatedTaskExecutor) {
return newHandler(alloc, startTls, delegatedTaskExecutor);
} | [
"public",
"SslHandler",
"newHandler",
"(",
"ByteBufAllocator",
"alloc",
",",
"Executor",
"delegatedTaskExecutor",
")",
"{",
"return",
"newHandler",
"(",
"alloc",
",",
"startTls",
",",
"delegatedTaskExecutor",
")",
";",
"}"
] | Creates a new {@link SslHandler}.
<p>If {@link SslProvider#OPENSSL_REFCNT} is used then the returned {@link SslHandler} will release the engine
that is wrapped. If the returned {@link SslHandler} is not inserted into a pipeline then you may leak native
memory!
<p><b>Beware</b>: the underlying generated {@link SSLEngine... | [
"Creates",
"a",
"new",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContext.java#L924-L926 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.UShortArray | public JBBPDslBuilder UShortArray(final String name, final String sizeExpression) {
final Item item = new Item(BinType.USHORT_ARRAY, name, this.byteOrder);
item.sizeExpression = assertExpressionChars(sizeExpression);
this.addItem(item);
return this;
} | java | public JBBPDslBuilder UShortArray(final String name, final String sizeExpression) {
final Item item = new Item(BinType.USHORT_ARRAY, name, this.byteOrder);
item.sizeExpression = assertExpressionChars(sizeExpression);
this.addItem(item);
return this;
} | [
"public",
"JBBPDslBuilder",
"UShortArray",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"sizeExpression",
")",
"{",
"final",
"Item",
"item",
"=",
"new",
"Item",
"(",
"BinType",
".",
"USHORT_ARRAY",
",",
"name",
",",
"this",
".",
"byteOrder",
")",
... | Add named fixed unsigned short array which size calculated through expression.
@param name name of the field, if null then anonymous
@param sizeExpression expression to be used to calculate size, must not be null
@return the builder instance, must not be null | [
"Add",
"named",
"fixed",
"unsigned",
"short",
"array",
"which",
"size",
"calculated",
"through",
"expression",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L1058-L1063 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationCalibration.java | EvaluationCalibration.getResidualPlot | public Histogram getResidualPlot(int labelClassIdx) {
String title = "Residual Plot - Predictions for Label Class " + labelClassIdx;
int[] counts = residualPlotByLabelClass.getColumn(labelClassIdx).dup().data().asInt();
return new Histogram(title, 0.0, 1.0, counts);
} | java | public Histogram getResidualPlot(int labelClassIdx) {
String title = "Residual Plot - Predictions for Label Class " + labelClassIdx;
int[] counts = residualPlotByLabelClass.getColumn(labelClassIdx).dup().data().asInt();
return new Histogram(title, 0.0, 1.0, counts);
} | [
"public",
"Histogram",
"getResidualPlot",
"(",
"int",
"labelClassIdx",
")",
"{",
"String",
"title",
"=",
"\"Residual Plot - Predictions for Label Class \"",
"+",
"labelClassIdx",
";",
"int",
"[",
"]",
"counts",
"=",
"residualPlotByLabelClass",
".",
"getColumn",
"(",
"... | Get the residual plot, only for examples of the specified class.. The residual plot is defined as a histogram of<br>
|label_i - prob(class_i | input)| for all and examples; for this particular method, only predictions where
i == labelClassIdx are included.<br>
In general, small residuals indicate a superior classifier ... | [
"Get",
"the",
"residual",
"plot",
"only",
"for",
"examples",
"of",
"the",
"specified",
"class",
"..",
"The",
"residual",
"plot",
"is",
"defined",
"as",
"a",
"histogram",
"of<br",
">",
"|label_i",
"-",
"prob",
"(",
"class_i",
"|",
"input",
")",
"|",
"for"... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationCalibration.java#L443-L447 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java | ReceiveMessageBuilder.headerFragment | public T headerFragment(Object model) {
Assert.notNull(applicationContext, "Citrus application context is not initialized!");
if (!CollectionUtils.isEmpty(applicationContext.getBeansOfType(Marshaller.class))) {
return headerFragment(model, applicationContext.getBean(Marshaller.class));
... | java | public T headerFragment(Object model) {
Assert.notNull(applicationContext, "Citrus application context is not initialized!");
if (!CollectionUtils.isEmpty(applicationContext.getBeansOfType(Marshaller.class))) {
return headerFragment(model, applicationContext.getBean(Marshaller.class));
... | [
"public",
"T",
"headerFragment",
"(",
"Object",
"model",
")",
"{",
"Assert",
".",
"notNull",
"(",
"applicationContext",
",",
"\"Citrus application context is not initialized!\"",
")",
";",
"if",
"(",
"!",
"CollectionUtils",
".",
"isEmpty",
"(",
"applicationContext",
... | Expect this message header data as model object which is marshalled to a character sequence using the default object to xml mapper that
is available in Spring bean application context.
@param model
@return | [
"Expect",
"this",
"message",
"header",
"data",
"as",
"model",
"object",
"which",
"is",
"marshalled",
"to",
"a",
"character",
"sequence",
"using",
"the",
"default",
"object",
"to",
"xml",
"mapper",
"that",
"is",
"available",
"in",
"Spring",
"bean",
"application... | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L340-L350 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getHierarchicalEntityRole | public EntityRole getHierarchicalEntityRole(UUID appId, String versionId, UUID hEntityId, UUID roleId) {
return getHierarchicalEntityRoleWithServiceResponseAsync(appId, versionId, hEntityId, roleId).toBlocking().single().body();
} | java | public EntityRole getHierarchicalEntityRole(UUID appId, String versionId, UUID hEntityId, UUID roleId) {
return getHierarchicalEntityRoleWithServiceResponseAsync(appId, versionId, hEntityId, roleId).toBlocking().single().body();
} | [
"public",
"EntityRole",
"getHierarchicalEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"hEntityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"getHierarchicalEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"hEnti... | Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@param roleId entity role ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request i... | [
"Get",
"one",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L13160-L13162 |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/Report.java | Report.addToTab | public Report addToTab(String tabName, String key, Object value) {
diagnostics.metaData.addToTab(tabName, key, value);
return this;
} | java | public Report addToTab(String tabName, String key, Object value) {
diagnostics.metaData.addToTab(tabName, key, value);
return this;
} | [
"public",
"Report",
"addToTab",
"(",
"String",
"tabName",
",",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"diagnostics",
".",
"metaData",
".",
"addToTab",
"(",
"tabName",
",",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add a key value pair to a metadata tab.
@param tabName the name of the tab to add the key value pair to
@param key the key of the metadata to add
@param value the metadata value to add
@return the modified report | [
"Add",
"a",
"key",
"value",
"pair",
"to",
"a",
"metadata",
"tab",
"."
] | train | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/Report.java#L190-L193 |
tvesalainen/lpg | src/main/java/org/vesalainen/grammar/state/NFAState.java | NFAState.epsilonClosure | public Set<NFAState<T>> epsilonClosure(Scope<DFAState<T>> scope)
{
Set<NFAState<T>> set = new HashSet<>();
set.add(this);
return epsilonClosure(scope, set);
} | java | public Set<NFAState<T>> epsilonClosure(Scope<DFAState<T>> scope)
{
Set<NFAState<T>> set = new HashSet<>();
set.add(this);
return epsilonClosure(scope, set);
} | [
"public",
"Set",
"<",
"NFAState",
"<",
"T",
">",
">",
"epsilonClosure",
"(",
"Scope",
"<",
"DFAState",
"<",
"T",
">",
">",
"scope",
")",
"{",
"Set",
"<",
"NFAState",
"<",
"T",
">>",
"set",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"set",
".",
... | Creates a dfa state from all nfa states that can be reached from this state
with epsilon move.
@param scope
@return | [
"Creates",
"a",
"dfa",
"state",
"from",
"all",
"nfa",
"states",
"that",
"can",
"be",
"reached",
"from",
"this",
"state",
"with",
"epsilon",
"move",
"."
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/grammar/state/NFAState.java#L431-L436 |
bbottema/outlook-message-parser | src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java | OutlookMessageParser.analyzeDocumentEntry | private OutlookFieldInformation analyzeDocumentEntry(final DocumentEntry de) {
final String name = de.getName();
// we are only interested in document entries
// with names starting with __substg1.
LOGGER.trace("Document entry: {}", name);
if (name.startsWith(PROPERTY_STREAM_PREFIX)) {
final String clazz;
... | java | private OutlookFieldInformation analyzeDocumentEntry(final DocumentEntry de) {
final String name = de.getName();
// we are only interested in document entries
// with names starting with __substg1.
LOGGER.trace("Document entry: {}", name);
if (name.startsWith(PROPERTY_STREAM_PREFIX)) {
final String clazz;
... | [
"private",
"OutlookFieldInformation",
"analyzeDocumentEntry",
"(",
"final",
"DocumentEntry",
"de",
")",
"{",
"final",
"String",
"name",
"=",
"de",
".",
"getName",
"(",
")",
";",
"// we are only interested in document entries",
"// with names starting with __substg1.",
"LOGG... | Analyzes the {@link DocumentEntry} and returns
a {@link OutlookFieldInformation} object containing the
class (the field name, so to say) and type of
the entry.
@param de The {@link DocumentEntry} that should be examined.
@return A {@link OutlookFieldInformation} object containing class and type of the document entry o... | [
"Analyzes",
"the",
"{",
"@link",
"DocumentEntry",
"}",
"and",
"returns",
"a",
"{",
"@link",
"OutlookFieldInformation",
"}",
"object",
"containing",
"the",
"class",
"(",
"the",
"field",
"name",
"so",
"to",
"say",
")",
"and",
"type",
"of",
"the",
"entry",
".... | train | https://github.com/bbottema/outlook-message-parser/blob/ea7d59da33c8a62dfc2e0aa64d2f8f7c903ccb0e/src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java#L520-L550 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/ObjectUtils.java | ObjectUtils.isCompatibleWithThrowsClause | public static boolean isCompatibleWithThrowsClause(Throwable ex, Class<?>... declaredExceptions) {
if (!isCheckedException(ex)) {
return true;
}
if (declaredExceptions != null) {
for (Class<?> declaredException : declaredExceptions) {
if (declaredException... | java | public static boolean isCompatibleWithThrowsClause(Throwable ex, Class<?>... declaredExceptions) {
if (!isCheckedException(ex)) {
return true;
}
if (declaredExceptions != null) {
for (Class<?> declaredException : declaredExceptions) {
if (declaredException... | [
"public",
"static",
"boolean",
"isCompatibleWithThrowsClause",
"(",
"Throwable",
"ex",
",",
"Class",
"<",
"?",
">",
"...",
"declaredExceptions",
")",
"{",
"if",
"(",
"!",
"isCheckedException",
"(",
"ex",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"("... | Check whether the given exception is compatible with the specified
exception types, as declared in a throws clause.
@param ex the exception to check
@param declaredExceptions the exception types declared in the throws clause
@return whether the given exception is compatible | [
"Check",
"whether",
"the",
"given",
"exception",
"is",
"compatible",
"with",
"the",
"specified",
"exception",
"types",
"as",
"declared",
"in",
"a",
"throws",
"clause",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/ObjectUtils.java#L48-L60 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/AABBUtils.java | AABBUtils.writeToNBT | public static void writeToNBT(NBTTagCompound tag, AxisAlignedBB aabb, String prefix)
{
if (tag == null || aabb == null)
return;
prefix = prefix == null ? "" : prefix + ".";
tag.setDouble(prefix + "minX", aabb.minX);
tag.setDouble(prefix + "minY", aabb.minY);
tag.setDouble(prefix + "minZ", aabb.minZ);
t... | java | public static void writeToNBT(NBTTagCompound tag, AxisAlignedBB aabb, String prefix)
{
if (tag == null || aabb == null)
return;
prefix = prefix == null ? "" : prefix + ".";
tag.setDouble(prefix + "minX", aabb.minX);
tag.setDouble(prefix + "minY", aabb.minY);
tag.setDouble(prefix + "minZ", aabb.minZ);
t... | [
"public",
"static",
"void",
"writeToNBT",
"(",
"NBTTagCompound",
"tag",
",",
"AxisAlignedBB",
"aabb",
",",
"String",
"prefix",
")",
"{",
"if",
"(",
"tag",
"==",
"null",
"||",
"aabb",
"==",
"null",
")",
"return",
";",
"prefix",
"=",
"prefix",
"==",
"null"... | Writes a {@link AxisAlignedBB} to a {@link NBTTagCompound} with the specified prefix.
@param tag the tag
@param aabb the aabb
@param prefix the prefix | [
"Writes",
"a",
"{",
"@link",
"AxisAlignedBB",
"}",
"to",
"a",
"{",
"@link",
"NBTTagCompound",
"}",
"with",
"the",
"specified",
"prefix",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/AABBUtils.java#L266-L278 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuStringUtil.java | GosuStringUtil.lastIndexOf | public static int lastIndexOf(String str, char searchChar, int startPos) {
if (isEmpty(str)) {
return -1;
}
return str.lastIndexOf(searchChar, startPos);
} | java | public static int lastIndexOf(String str, char searchChar, int startPos) {
if (isEmpty(str)) {
return -1;
}
return str.lastIndexOf(searchChar, startPos);
} | [
"public",
"static",
"int",
"lastIndexOf",
"(",
"String",
"str",
",",
"char",
"searchChar",
",",
"int",
"startPos",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"str",
")",
")",
"{",
"return",
"-",
"1",
";",
"}",
"return",
"str",
".",
"lastIndexOf",
"(",
"sea... | <p>Finds the last index within a String from a start position,
handling <code>null</code>.
This method uses {@link String#lastIndexOf(int, int)}.</p>
<p>A <code>null</code> or empty ("") String will return <code>-1</code>.
A negative start position returns <code>-1</code>.
A start position greater than the string leng... | [
"<p",
">",
"Finds",
"the",
"last",
"index",
"within",
"a",
"String",
"from",
"a",
"start",
"position",
"handling",
"<code",
">",
"null<",
"/",
"code",
">",
".",
"This",
"method",
"uses",
"{",
"@link",
"String#lastIndexOf",
"(",
"int",
"int",
")",
"}",
... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuStringUtil.java#L886-L891 |
alkacon/opencms-core | src/org/opencms/ade/contenteditor/CmsContentTypeVisitor.java | CmsContentTypeVisitor.readDefaultValue | private String readDefaultValue(I_CmsXmlSchemaType schemaType, String path) {
return m_contentHandler.getDefault(getCmsObject(), m_file, schemaType, path, m_locale);
} | java | private String readDefaultValue(I_CmsXmlSchemaType schemaType, String path) {
return m_contentHandler.getDefault(getCmsObject(), m_file, schemaType, path, m_locale);
} | [
"private",
"String",
"readDefaultValue",
"(",
"I_CmsXmlSchemaType",
"schemaType",
",",
"String",
"path",
")",
"{",
"return",
"m_contentHandler",
".",
"getDefault",
"(",
"getCmsObject",
"(",
")",
",",
"m_file",
",",
"schemaType",
",",
"path",
",",
"m_locale",
")"... | Reads the default value for the given type.<p>
@param schemaType the schema type
@param path the element path
@return the default value | [
"Reads",
"the",
"default",
"value",
"for",
"the",
"given",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/contenteditor/CmsContentTypeVisitor.java#L746-L749 |
netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Snappy.java | Snappy.findMatchingLength | private static int findMatchingLength(ByteBuf in, int minIndex, int inIndex, int maxIndex) {
int matched = 0;
while (inIndex <= maxIndex - 4 &&
in.getInt(inIndex) == in.getInt(minIndex + matched)) {
inIndex += 4;
matched += 4;
}
while (inIndex < ... | java | private static int findMatchingLength(ByteBuf in, int minIndex, int inIndex, int maxIndex) {
int matched = 0;
while (inIndex <= maxIndex - 4 &&
in.getInt(inIndex) == in.getInt(minIndex + matched)) {
inIndex += 4;
matched += 4;
}
while (inIndex < ... | [
"private",
"static",
"int",
"findMatchingLength",
"(",
"ByteBuf",
"in",
",",
"int",
"minIndex",
",",
"int",
"inIndex",
",",
"int",
"maxIndex",
")",
"{",
"int",
"matched",
"=",
"0",
";",
"while",
"(",
"inIndex",
"<=",
"maxIndex",
"-",
"4",
"&&",
"in",
"... | Iterates over the supplied input buffer between the supplied minIndex and
maxIndex to find how long our matched copy overlaps with an already-written
literal value.
@param in The input buffer to scan over
@param minIndex The index in the input buffer to start scanning from
@param inIndex The index of the start of our ... | [
"Iterates",
"over",
"the",
"supplied",
"input",
"buffer",
"between",
"the",
"supplied",
"minIndex",
"and",
"maxIndex",
"to",
"find",
"how",
"long",
"our",
"matched",
"copy",
"overlaps",
"with",
"an",
"already",
"-",
"written",
"literal",
"value",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java#L179-L194 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/server/VanillaDb.java | VanillaDb.newPlanner | public static Planner newPlanner() {
QueryPlanner qplanner;
UpdatePlanner uplanner;
try {
qplanner = (QueryPlanner) queryPlannerCls.newInstance();
uplanner = (UpdatePlanner) updatePlannerCls.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
e.printStackTrace();
r... | java | public static Planner newPlanner() {
QueryPlanner qplanner;
UpdatePlanner uplanner;
try {
qplanner = (QueryPlanner) queryPlannerCls.newInstance();
uplanner = (UpdatePlanner) updatePlannerCls.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
e.printStackTrace();
r... | [
"public",
"static",
"Planner",
"newPlanner",
"(",
")",
"{",
"QueryPlanner",
"qplanner",
";",
"UpdatePlanner",
"uplanner",
";",
"try",
"{",
"qplanner",
"=",
"(",
"QueryPlanner",
")",
"queryPlannerCls",
".",
"newInstance",
"(",
")",
";",
"uplanner",
"=",
"(",
... | Creates a planner for SQL commands. To change how the planner works,
modify this method.
@return the system's planner for SQL commands | [
"Creates",
"a",
"planner",
"for",
"SQL",
"commands",
".",
"To",
"change",
"how",
"the",
"planner",
"works",
"modify",
"this",
"method",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/server/VanillaDb.java#L283-L296 |
vladmihalcea/db-util | src/main/java/com/vladmihalcea/sql/SQLStatementCountValidator.java | SQLStatementCountValidator.assertDeleteCount | public static void assertDeleteCount(long expectedDeleteCount) {
QueryCount queryCount = QueryCountHolder.getGrandTotal();
long recordedDeleteCount = queryCount.getDelete();
if (expectedDeleteCount != recordedDeleteCount) {
throw new SQLDeleteCountMismatchException(expectedDeleteCoun... | java | public static void assertDeleteCount(long expectedDeleteCount) {
QueryCount queryCount = QueryCountHolder.getGrandTotal();
long recordedDeleteCount = queryCount.getDelete();
if (expectedDeleteCount != recordedDeleteCount) {
throw new SQLDeleteCountMismatchException(expectedDeleteCoun... | [
"public",
"static",
"void",
"assertDeleteCount",
"(",
"long",
"expectedDeleteCount",
")",
"{",
"QueryCount",
"queryCount",
"=",
"QueryCountHolder",
".",
"getGrandTotal",
"(",
")",
";",
"long",
"recordedDeleteCount",
"=",
"queryCount",
".",
"getDelete",
"(",
")",
"... | Assert delete statement count
@param expectedDeleteCount expected delete statement count | [
"Assert",
"delete",
"statement",
"count"
] | train | https://github.com/vladmihalcea/db-util/blob/81c8c8421253c9869db1d4e221668d7afbd69fd0/src/main/java/com/vladmihalcea/sql/SQLStatementCountValidator.java#L132-L138 |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java | AbstractParser.getTransactionCounter | protected int getTransactionCounter() throws CommunicationException {
int ret = UNKNOW;
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Get Transaction Counter ATC");
}
byte[] data = template.get().getProvider().transceive(new CommandApdu(CommandEnum.GET_DATA, 0x9F, 0x36, 0).toBytes());
if (ResponseUtils.isSu... | java | protected int getTransactionCounter() throws CommunicationException {
int ret = UNKNOW;
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Get Transaction Counter ATC");
}
byte[] data = template.get().getProvider().transceive(new CommandApdu(CommandEnum.GET_DATA, 0x9F, 0x36, 0).toBytes());
if (ResponseUtils.isSu... | [
"protected",
"int",
"getTransactionCounter",
"(",
")",
"throws",
"CommunicationException",
"{",
"int",
"ret",
"=",
"UNKNOW",
";",
"if",
"(",
"LOGGER",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Get Transaction Counter ATC\"",
")",... | Method used to get Transaction counter
@return the number of card transaction
@throws CommunicationException communication error | [
"Method",
"used",
"to",
"get",
"Transaction",
"counter"
] | train | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/AbstractParser.java#L169-L183 |
betfair/cougar | cougar-framework/cougar-zipkin-common/src/main/java/com/betfair/cougar/modules/zipkin/impl/ZipkinAnnotationsStore.java | ZipkinAnnotationsStore.addAnnotation | @Nonnull
public ZipkinAnnotationsStore addAnnotation(@Nonnull String key, @Nonnull String value) {
return addBinaryAnnotation(key, value, defaultEndpoint);
} | java | @Nonnull
public ZipkinAnnotationsStore addAnnotation(@Nonnull String key, @Nonnull String value) {
return addBinaryAnnotation(key, value, defaultEndpoint);
} | [
"@",
"Nonnull",
"public",
"ZipkinAnnotationsStore",
"addAnnotation",
"(",
"@",
"Nonnull",
"String",
"key",
",",
"@",
"Nonnull",
"String",
"value",
")",
"{",
"return",
"addBinaryAnnotation",
"(",
"key",
",",
"value",
",",
"defaultEndpoint",
")",
";",
"}"
] | Adds a (binary) string annotation for an event.
@param key The key of the annotation
@param value The value of the annotation
@return this object | [
"Adds",
"a",
"(",
"binary",
")",
"string",
"annotation",
"for",
"an",
"event",
"."
] | train | https://github.com/betfair/cougar/blob/08d1fe338fbd0e8572a9c2305bb5796402d5b1f5/cougar-framework/cougar-zipkin-common/src/main/java/com/betfair/cougar/modules/zipkin/impl/ZipkinAnnotationsStore.java#L82-L85 |
rnorth/visible-assertions | src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java | VisibleAssertions.assertThrows | public static <T> void assertThrows(String message, Class<? extends Exception> exceptionClass, Callable<T> callable) {
T result;
try {
result = callable.call();
fail(message, "No exception was thrown (expected " + exceptionClass.getSimpleName() + " but '" + result + "' was return... | java | public static <T> void assertThrows(String message, Class<? extends Exception> exceptionClass, Callable<T> callable) {
T result;
try {
result = callable.call();
fail(message, "No exception was thrown (expected " + exceptionClass.getSimpleName() + " but '" + result + "' was return... | [
"public",
"static",
"<",
"T",
">",
"void",
"assertThrows",
"(",
"String",
"message",
",",
"Class",
"<",
"?",
"extends",
"Exception",
">",
"exceptionClass",
",",
"Callable",
"<",
"T",
">",
"callable",
")",
"{",
"T",
"result",
";",
"try",
"{",
"result",
... | Assert that a given callable throws an exception of a particular class.
<p>
The assertion passes if the callable throws exactly the same class of exception (not a subclass).
<p>
If the callable doesn't throw an exception at all, or if another class of exception is thrown, the assertion
fails.
<p>
If the assertion passe... | [
"Assert",
"that",
"a",
"given",
"callable",
"throws",
"an",
"exception",
"of",
"a",
"particular",
"class",
".",
"<p",
">",
"The",
"assertion",
"passes",
"if",
"the",
"callable",
"throws",
"exactly",
"the",
"same",
"class",
"of",
"exception",
"(",
"not",
"a... | train | https://github.com/rnorth/visible-assertions/blob/6d7a7724db40ac0e9f87279553f814b790310b3b/src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java#L376-L388 |
joniles/mpxj | src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java | ProjectTreeController.addTasks | private void addTasks(MpxjTreeNode parentNode, ChildTaskContainer parent)
{
for (Task task : parent.getChildTasks())
{
final Task t = task;
MpxjTreeNode childNode = new MpxjTreeNode(task, TASK_EXCLUDED_METHODS)
{
@Override public String toString()
{
... | java | private void addTasks(MpxjTreeNode parentNode, ChildTaskContainer parent)
{
for (Task task : parent.getChildTasks())
{
final Task t = task;
MpxjTreeNode childNode = new MpxjTreeNode(task, TASK_EXCLUDED_METHODS)
{
@Override public String toString()
{
... | [
"private",
"void",
"addTasks",
"(",
"MpxjTreeNode",
"parentNode",
",",
"ChildTaskContainer",
"parent",
")",
"{",
"for",
"(",
"Task",
"task",
":",
"parent",
".",
"getChildTasks",
"(",
")",
")",
"{",
"final",
"Task",
"t",
"=",
"task",
";",
"MpxjTreeNode",
"c... | Add tasks to the tree.
@param parentNode parent tree node
@param parent parent task container | [
"Add",
"tasks",
"to",
"the",
"tree",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java#L198-L213 |
google/j2objc | jre_emul/android/platform/libcore/xml/src/main/java/org/kxml2/io/KXmlParser.java | KXmlParser.pushContentSource | private void pushContentSource(char[] newBuffer) {
nextContentSource = new ContentSource(nextContentSource, buffer, position, limit);
buffer = newBuffer;
position = 0;
limit = newBuffer.length;
} | java | private void pushContentSource(char[] newBuffer) {
nextContentSource = new ContentSource(nextContentSource, buffer, position, limit);
buffer = newBuffer;
position = 0;
limit = newBuffer.length;
} | [
"private",
"void",
"pushContentSource",
"(",
"char",
"[",
"]",
"newBuffer",
")",
"{",
"nextContentSource",
"=",
"new",
"ContentSource",
"(",
"nextContentSource",
",",
"buffer",
",",
"position",
",",
"limit",
")",
";",
"buffer",
"=",
"newBuffer",
";",
"position... | Prepends the characters of {@code newBuffer} to be read before the
current buffer. | [
"Prepends",
"the",
"characters",
"of",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/xml/src/main/java/org/kxml2/io/KXmlParser.java#L2162-L2167 |
Bedework/bw-util | bw-util-xml/src/main/java/org/bedework/util/xml/XmlUtil.java | XmlUtil.getReqOneNodeVal | public static String getReqOneNodeVal(final Node el, final String name)
throws SAXException {
String str = getOneNodeVal(el, name);
if ((str == null) || (str.length() == 0)) {
throw new SAXException("Missing property value: " + name);
}
return str;
} | java | public static String getReqOneNodeVal(final Node el, final String name)
throws SAXException {
String str = getOneNodeVal(el, name);
if ((str == null) || (str.length() == 0)) {
throw new SAXException("Missing property value: " + name);
}
return str;
} | [
"public",
"static",
"String",
"getReqOneNodeVal",
"(",
"final",
"Node",
"el",
",",
"final",
"String",
"name",
")",
"throws",
"SAXException",
"{",
"String",
"str",
"=",
"getOneNodeVal",
"(",
"el",
",",
"name",
")",
";",
"if",
"(",
"(",
"str",
"==",
"null"... | Get the value of an element. We expect 1 child node otherwise we raise an
exception.
@param el Node whose value we want
@param name String name to make exception messages more readable
@return String node value
@throws SAXException | [
"Get",
"the",
"value",
"of",
"an",
"element",
".",
"We",
"expect",
"1",
"child",
"node",
"otherwise",
"we",
"raise",
"an",
"exception",
"."
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-xml/src/main/java/org/bedework/util/xml/XmlUtil.java#L189-L198 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/GroupService.java | GroupService.findLockableGroup | public static ILockableEntityGroup findLockableGroup(String key, String lockOwner)
throws GroupsException {
LOGGER.trace("Invoking findLockableGroup for key='{}', lockOwner='{}'", key, lockOwner);
return instance().ifindLockableGroup(key, lockOwner);
} | java | public static ILockableEntityGroup findLockableGroup(String key, String lockOwner)
throws GroupsException {
LOGGER.trace("Invoking findLockableGroup for key='{}', lockOwner='{}'", key, lockOwner);
return instance().ifindLockableGroup(key, lockOwner);
} | [
"public",
"static",
"ILockableEntityGroup",
"findLockableGroup",
"(",
"String",
"key",
",",
"String",
"lockOwner",
")",
"throws",
"GroupsException",
"{",
"LOGGER",
".",
"trace",
"(",
"\"Invoking findLockableGroup for key='{}', lockOwner='{}'\"",
",",
"key",
",",
"lockOwne... | Returns a pre-existing <code>ILockableEntityGroup</code> or null if the group is not found.
@param key String - the group key.
@param lockOwner String - the owner of the lock, typically the user.
@return org.apereo.portal.groups.ILockableEntityGroup | [
"Returns",
"a",
"pre",
"-",
"existing",
"<code",
">",
"ILockableEntityGroup<",
"/",
"code",
">",
"or",
"null",
"if",
"the",
"group",
"is",
"not",
"found",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/GroupService.java#L91-L95 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/UTF8ByteArrayUtils.java | UTF8ByteArrayUtils.findNthByte | public static int findNthByte(byte [] utf, int start, int length, byte b, int n) {
int pos = -1;
int nextStart = start;
for (int i = 0; i < n; i++) {
pos = findByte(utf, nextStart, length, b);
if (pos < 0) {
return pos;
}
nextStart = pos + 1;
}
return pos;
} | java | public static int findNthByte(byte [] utf, int start, int length, byte b, int n) {
int pos = -1;
int nextStart = start;
for (int i = 0; i < n; i++) {
pos = findByte(utf, nextStart, length, b);
if (pos < 0) {
return pos;
}
nextStart = pos + 1;
}
return pos;
} | [
"public",
"static",
"int",
"findNthByte",
"(",
"byte",
"[",
"]",
"utf",
",",
"int",
"start",
",",
"int",
"length",
",",
"byte",
"b",
",",
"int",
"n",
")",
"{",
"int",
"pos",
"=",
"-",
"1",
";",
"int",
"nextStart",
"=",
"start",
";",
"for",
"(",
... | Find the nth occurrence of the given byte b in a UTF-8 encoded string
@param utf a byte array containing a UTF-8 encoded string
@param start starting offset
@param length the length of byte array
@param b the byte to find
@param n the desired occurrence of the given byte
@return position that nth occurrence of the give... | [
"Find",
"the",
"nth",
"occurrence",
"of",
"the",
"given",
"byte",
"b",
"in",
"a",
"UTF",
"-",
"8",
"encoded",
"string"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/UTF8ByteArrayUtils.java#L73-L84 |
datasift/datasift-java | src/main/java/com/datasift/client/managedsource/sources/Yammer.java | Yammer.addOAutToken | public Yammer addOAutToken(String oAuthAccessToken, long expires, String name) {
if (oAuthAccessToken == null || oAuthAccessToken.isEmpty()) {
throw new IllegalArgumentException("A valid OAuth and refresh token is required");
}
AuthParams parameterSet = newAuthParams(name, expires);
... | java | public Yammer addOAutToken(String oAuthAccessToken, long expires, String name) {
if (oAuthAccessToken == null || oAuthAccessToken.isEmpty()) {
throw new IllegalArgumentException("A valid OAuth and refresh token is required");
}
AuthParams parameterSet = newAuthParams(name, expires);
... | [
"public",
"Yammer",
"addOAutToken",
"(",
"String",
"oAuthAccessToken",
",",
"long",
"expires",
",",
"String",
"name",
")",
"{",
"if",
"(",
"oAuthAccessToken",
"==",
"null",
"||",
"oAuthAccessToken",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"Illega... | /*
Adds an OAuth token to the managed source
@param oAuthAccessToken an oauth2 token
@param name a human friendly name for this auth token
@param expires identity resource expiry date/time as a UTC timestamp, i.e. when the token expires
@return this | [
"/",
"*",
"Adds",
"an",
"OAuth",
"token",
"to",
"the",
"managed",
"source"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/managedsource/sources/Yammer.java#L31-L38 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.forAllClassDefinitions | public void forAllClassDefinitions(String template, Properties attributes) throws XDocletException
{
for (Iterator it = _model.getClasses(); it.hasNext(); )
{
_curClassDef = (ClassDescriptorDef)it.next();
generate(template);
}
_curClassDef = null;
... | java | public void forAllClassDefinitions(String template, Properties attributes) throws XDocletException
{
for (Iterator it = _model.getClasses(); it.hasNext(); )
{
_curClassDef = (ClassDescriptorDef)it.next();
generate(template);
}
_curClassDef = null;
... | [
"public",
"void",
"forAllClassDefinitions",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"for",
"(",
"Iterator",
"it",
"=",
"_model",
".",
"getClasses",
"(",
")",
";",
"it",
".",
"hasNext",
"(",
")",
";"... | Processes the template for all class definitions.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException if an error occurs
@doc.tag type="block" | [
"Processes",
"the",
"template",
"for",
"all",
"class",
"definitions",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L172-L182 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/FileUtils.java | FileUtils.toHashMap | public static Map<String, List<String>> toHashMap(final String aFilePath) throws FileNotFoundException {
return toHashMap(aFilePath, null, (String[]) null);
} | java | public static Map<String, List<String>> toHashMap(final String aFilePath) throws FileNotFoundException {
return toHashMap(aFilePath, null, (String[]) null);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"toHashMap",
"(",
"final",
"String",
"aFilePath",
")",
"throws",
"FileNotFoundException",
"{",
"return",
"toHashMap",
"(",
"aFilePath",
",",
"null",
",",
"(",
"String",
"[",
"]... | Returns a Map representation of the supplied directory's structure. The map contains the file name as the key
and its path as the value. If a file with a name occurs more than once, multiple path values are returned for
that file name key. The map that is returned is unmodifiable.
@param aFilePath The directory of whi... | [
"Returns",
"a",
"Map",
"representation",
"of",
"the",
"supplied",
"directory",
"s",
"structure",
".",
"The",
"map",
"contains",
"the",
"file",
"name",
"as",
"the",
"key",
"and",
"its",
"path",
"as",
"the",
"value",
".",
"If",
"a",
"file",
"with",
"a",
... | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/FileUtils.java#L183-L185 |
amaembo/streamex | src/main/java/one/util/streamex/MoreCollectors.java | MoreCollectors.maxAll | public static <T> Collector<T, ?, List<T>> maxAll(Comparator<? super T> comparator) {
return maxAll(comparator, Collectors.toList());
} | java | public static <T> Collector<T, ?, List<T>> maxAll(Comparator<? super T> comparator) {
return maxAll(comparator, Collectors.toList());
} | [
"public",
"static",
"<",
"T",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"List",
"<",
"T",
">",
">",
"maxAll",
"(",
"Comparator",
"<",
"?",
"super",
"T",
">",
"comparator",
")",
"{",
"return",
"maxAll",
"(",
"comparator",
",",
"Collectors",
".",
"t... | Returns a {@code Collector} which finds all the elements which are equal
to each other and bigger than any other element according to the
specified {@link Comparator}. The found elements are collected to
{@link List}.
@param <T> the type of the input elements
@param comparator a {@code Comparator} to compare the eleme... | [
"Returns",
"a",
"{",
"@code",
"Collector",
"}",
"which",
"finds",
"all",
"the",
"elements",
"which",
"are",
"equal",
"to",
"each",
"other",
"and",
"bigger",
"than",
"any",
"other",
"element",
"according",
"to",
"the",
"specified",
"{",
"@link",
"Comparator",... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/MoreCollectors.java#L381-L383 |
integration-technology/amazon-mws-orders | src/main/java/com/amazonservices/mws/client/MwsUtl.java | MwsUtl.urlEncode | protected static String urlEncode(String value, boolean path) {
try {
value = URLEncoder.encode(value, DEFAULT_ENCODING);
} catch (Exception e) {
throw wrap(e);
}
value = replaceAll(value, plusPtn, "%20");
value = replaceAll(value, asteriskPtn, "%2A");
... | java | protected static String urlEncode(String value, boolean path) {
try {
value = URLEncoder.encode(value, DEFAULT_ENCODING);
} catch (Exception e) {
throw wrap(e);
}
value = replaceAll(value, plusPtn, "%20");
value = replaceAll(value, asteriskPtn, "%2A");
... | [
"protected",
"static",
"String",
"urlEncode",
"(",
"String",
"value",
",",
"boolean",
"path",
")",
"{",
"try",
"{",
"value",
"=",
"URLEncoder",
".",
"encode",
"(",
"value",
",",
"DEFAULT_ENCODING",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",... | URL encode a value.
@param value
@param path
true if is a path and '/' should not be encoded.
@return The encoded string. | [
"URL",
"encode",
"a",
"value",
"."
] | train | https://github.com/integration-technology/amazon-mws-orders/blob/042e8cd5b10588a30150222bf9c91faf4f130b3c/src/main/java/com/amazonservices/mws/client/MwsUtl.java#L282-L295 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/feature/Feature.java | Feature.setDateAttribute | public void setDateAttribute(String name, Date value) {
Attribute attribute = getAttributes().get(name);
if (!(attribute instanceof DateAttribute)) {
throw new IllegalStateException("Cannot set date value on attribute with different type, " +
attribute.getClass().getName() + " setting value " + value);
}
... | java | public void setDateAttribute(String name, Date value) {
Attribute attribute = getAttributes().get(name);
if (!(attribute instanceof DateAttribute)) {
throw new IllegalStateException("Cannot set date value on attribute with different type, " +
attribute.getClass().getName() + " setting value " + value);
}
... | [
"public",
"void",
"setDateAttribute",
"(",
"String",
"name",
",",
"Date",
"value",
")",
"{",
"Attribute",
"attribute",
"=",
"getAttributes",
"(",
")",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"!",
"(",
"attribute",
"instanceof",
"DateAttribute",
")",
... | Set attribute value of given type.
@param name attribute name
@param value attribute value | [
"Set",
"attribute",
"value",
"of",
"given",
"type",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/feature/Feature.java#L245-L252 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java | ST_RemoveRepeatedPoints.removeDuplicateCoordinates | public static MultiLineString removeDuplicateCoordinates(MultiLineString multiLineString, double tolerance) throws SQLException {
ArrayList<LineString> lines = new ArrayList<LineString>();
for (int i = 0; i < multiLineString.getNumGeometries(); i++) {
LineString line = (LineString) multiLine... | java | public static MultiLineString removeDuplicateCoordinates(MultiLineString multiLineString, double tolerance) throws SQLException {
ArrayList<LineString> lines = new ArrayList<LineString>();
for (int i = 0; i < multiLineString.getNumGeometries(); i++) {
LineString line = (LineString) multiLine... | [
"public",
"static",
"MultiLineString",
"removeDuplicateCoordinates",
"(",
"MultiLineString",
"multiLineString",
",",
"double",
"tolerance",
")",
"throws",
"SQLException",
"{",
"ArrayList",
"<",
"LineString",
">",
"lines",
"=",
"new",
"ArrayList",
"<",
"LineString",
">... | Removes duplicated coordinates in a MultiLineString.
@param multiLineString
@param tolerance to delete the coordinates
@return | [
"Removes",
"duplicated",
"coordinates",
"in",
"a",
"MultiLineString",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java#L140-L147 |
jwtk/jjwt | api/src/main/java/io/jsonwebtoken/lang/Assert.java | Assert.hasLength | public static void hasLength(String text, String message) {
if (!Strings.hasLength(text)) {
throw new IllegalArgumentException(message);
}
} | java | public static void hasLength(String text, String message) {
if (!Strings.hasLength(text)) {
throw new IllegalArgumentException(message);
}
} | [
"public",
"static",
"void",
"hasLength",
"(",
"String",
"text",
",",
"String",
"message",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"hasLength",
"(",
"text",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"message",
")",
";",
"}",
"}"
] | Assert that the given String is not empty; that is,
it must not be <code>null</code> and not the empty String.
<pre class="code">Assert.hasLength(name, "Name must not be empty");</pre>
@param text the String to check
@param message the exception message to use if the assertion fails
@see Strings#hasLength | [
"Assert",
"that",
"the",
"given",
"String",
"is",
"not",
"empty",
";",
"that",
"is",
"it",
"must",
"not",
"be",
"<code",
">",
"null<",
"/",
"code",
">",
"and",
"not",
"the",
"empty",
"String",
".",
"<pre",
"class",
"=",
"code",
">",
"Assert",
".",
... | train | https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/api/src/main/java/io/jsonwebtoken/lang/Assert.java#L104-L108 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java | SpiceServiceListenerNotifier.notifyObserversOfRequestProcessed | public void notifyObserversOfRequestProcessed(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners) {
RequestProcessingContext requestProcessingContext = new RequestProcessingContext();
requestProcessingContext.setExecutionThread(Thread.currentThread());
requestProcessingConte... | java | public void notifyObserversOfRequestProcessed(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners) {
RequestProcessingContext requestProcessingContext = new RequestProcessingContext();
requestProcessingContext.setExecutionThread(Thread.currentThread());
requestProcessingConte... | [
"public",
"void",
"notifyObserversOfRequestProcessed",
"(",
"CachedSpiceRequest",
"<",
"?",
">",
"request",
",",
"Set",
"<",
"RequestListener",
"<",
"?",
">",
">",
"requestListeners",
")",
"{",
"RequestProcessingContext",
"requestProcessingContext",
"=",
"new",
"Reque... | Notify interested observers of request completion.
@param request the request that has completed.
@param requestListeners the listeners to notify. | [
"Notify",
"interested",
"observers",
"of",
"request",
"completion",
"."
] | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java#L134-L139 |
mkolisnyk/cucumber-reports | cucumber-runner/src/main/java/com/github/mkolisnyk/cucumber/assertions/LazyAssert.java | LazyAssert.assertArrayEquals | public static void assertArrayEquals(String message, double[] expecteds,
double[] actuals, double delta) throws ArrayComparisonFailure {
try {
new InexactComparisonCriteria(delta).arrayEquals(message, expecteds, actuals);
} catch (AssertionError e) {
throw new LazyAss... | java | public static void assertArrayEquals(String message, double[] expecteds,
double[] actuals, double delta) throws ArrayComparisonFailure {
try {
new InexactComparisonCriteria(delta).arrayEquals(message, expecteds, actuals);
} catch (AssertionError e) {
throw new LazyAss... | [
"public",
"static",
"void",
"assertArrayEquals",
"(",
"String",
"message",
",",
"double",
"[",
"]",
"expecteds",
",",
"double",
"[",
"]",
"actuals",
",",
"double",
"delta",
")",
"throws",
"ArrayComparisonFailure",
"{",
"try",
"{",
"new",
"InexactComparisonCriter... | Asserts that two double arrays are equal. If they are not, an
{@link LazyAssertionError} is thrown with the given message.
@param message the identifying message for the {@link LazyAssertionError} (<code>null</code>
okay)
@param expecteds double array with expected values.
@param actuals double array with actual value... | [
"Asserts",
"that",
"two",
"double",
"arrays",
"are",
"equal",
".",
"If",
"they",
"are",
"not",
"an",
"{",
"@link",
"LazyAssertionError",
"}",
"is",
"thrown",
"with",
"the",
"given",
"message",
"."
] | train | https://github.com/mkolisnyk/cucumber-reports/blob/9c9a32f15f0bf1eb1d3d181a11bae9c5eec84a8e/cucumber-runner/src/main/java/com/github/mkolisnyk/cucumber/assertions/LazyAssert.java#L473-L480 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.zone_zoneName_dynHost_login_login_DELETE | public void zone_zoneName_dynHost_login_login_DELETE(String zoneName, String login) throws IOException {
String qPath = "/domain/zone/{zoneName}/dynHost/login/{login}";
StringBuilder sb = path(qPath, zoneName, login);
exec(qPath, "DELETE", sb.toString(), null);
} | java | public void zone_zoneName_dynHost_login_login_DELETE(String zoneName, String login) throws IOException {
String qPath = "/domain/zone/{zoneName}/dynHost/login/{login}";
StringBuilder sb = path(qPath, zoneName, login);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"zone_zoneName_dynHost_login_login_DELETE",
"(",
"String",
"zoneName",
",",
"String",
"login",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/zone/{zoneName}/dynHost/login/{login}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
... | Delete a DynHost login
REST: DELETE /domain/zone/{zoneName}/dynHost/login/{login}
@param zoneName [required] The internal name of your zone
@param login [required] Login | [
"Delete",
"a",
"DynHost",
"login"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L466-L470 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_publicFolderQuota_GET | public OvhPublicFolderQuota organizationName_service_exchangeService_publicFolderQuota_GET(String organizationName, String exchangeService) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/publicFolderQuota";
StringBuilder sb = path(qPath, organizationName, exchangeS... | java | public OvhPublicFolderQuota organizationName_service_exchangeService_publicFolderQuota_GET(String organizationName, String exchangeService) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/publicFolderQuota";
StringBuilder sb = path(qPath, organizationName, exchangeS... | [
"public",
"OvhPublicFolderQuota",
"organizationName_service_exchangeService_publicFolderQuota_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/exchange/{organizationName}/service/{exchangeS... | Get public folder quota usage in total available space
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/publicFolderQuota
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service | [
"Get",
"public",
"folder",
"quota",
"usage",
"in",
"total",
"available",
"space"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L364-L369 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IteratorExtensions.java | IteratorExtensions.forEach | public static <T> void forEach(Iterator<T> iterator, Procedure1<? super T> procedure) {
if (procedure == null)
throw new NullPointerException("procedure");
while(iterator.hasNext()) {
procedure.apply(iterator.next());
}
} | java | public static <T> void forEach(Iterator<T> iterator, Procedure1<? super T> procedure) {
if (procedure == null)
throw new NullPointerException("procedure");
while(iterator.hasNext()) {
procedure.apply(iterator.next());
}
} | [
"public",
"static",
"<",
"T",
">",
"void",
"forEach",
"(",
"Iterator",
"<",
"T",
">",
"iterator",
",",
"Procedure1",
"<",
"?",
"super",
"T",
">",
"procedure",
")",
"{",
"if",
"(",
"procedure",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
... | Applies {@code procedure} for each element of the given iterator.
@param iterator
the iterator. May not be <code>null</code>.
@param procedure
the procedure. May not be <code>null</code>. | [
"Applies",
"{",
"@code",
"procedure",
"}",
"for",
"each",
"element",
"of",
"the",
"given",
"iterator",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IteratorExtensions.java#L422-L428 |
mongodb/stitch-android-sdk | core/sdk/src/main/java/com/mongodb/stitch/core/internal/common/StitchError.java | StitchError.handleRichError | private static String handleRichError(final Response response, final String body) {
if (!response.getHeaders().containsKey(Headers.CONTENT_TYPE)
|| !response.getHeaders().get(Headers.CONTENT_TYPE).equals(ContentTypes.APPLICATION_JSON)) {
return body;
}
final Document doc;
try {
doc ... | java | private static String handleRichError(final Response response, final String body) {
if (!response.getHeaders().containsKey(Headers.CONTENT_TYPE)
|| !response.getHeaders().get(Headers.CONTENT_TYPE).equals(ContentTypes.APPLICATION_JSON)) {
return body;
}
final Document doc;
try {
doc ... | [
"private",
"static",
"String",
"handleRichError",
"(",
"final",
"Response",
"response",
",",
"final",
"String",
"body",
")",
"{",
"if",
"(",
"!",
"response",
".",
"getHeaders",
"(",
")",
".",
"containsKey",
"(",
"Headers",
".",
"CONTENT_TYPE",
")",
"||",
"... | Private helper method which decodes the Stitch error from the body of an HTTP `Response`
object. If the error is successfully decoded, this function will throw the error for the end
user to eventually consume. If the error cannot be decoded, this is likely not an error from
the Stitch server, and this function will ret... | [
"Private",
"helper",
"method",
"which",
"decodes",
"the",
"Stitch",
"error",
"from",
"the",
"body",
"of",
"an",
"HTTP",
"Response",
"object",
".",
"If",
"the",
"error",
"is",
"successfully",
"decoded",
"this",
"function",
"will",
"throw",
"the",
"error",
"fo... | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/sdk/src/main/java/com/mongodb/stitch/core/internal/common/StitchError.java#L72-L95 |
zackpollard/JavaTelegramBot-API | core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java | TelegramBot.editMessageCaption | public Message editMessageCaption(Message oldMessage, String caption, InlineReplyMarkup inlineReplyMarkup) {
return this.editMessageCaption(oldMessage.getChat().getId(), oldMessage.getMessageId(), caption, inlineReplyMarkup);
} | java | public Message editMessageCaption(Message oldMessage, String caption, InlineReplyMarkup inlineReplyMarkup) {
return this.editMessageCaption(oldMessage.getChat().getId(), oldMessage.getMessageId(), caption, inlineReplyMarkup);
} | [
"public",
"Message",
"editMessageCaption",
"(",
"Message",
"oldMessage",
",",
"String",
"caption",
",",
"InlineReplyMarkup",
"inlineReplyMarkup",
")",
"{",
"return",
"this",
".",
"editMessageCaption",
"(",
"oldMessage",
".",
"getChat",
"(",
")",
".",
"getId",
"(",... | This allows you to edit the caption of any captionable message you have sent previously
@param oldMessage The Message object that represents the message you want to edit
@param caption The new caption you want to display
@param inlineReplyMarkup Any InlineReplyMarkup object you want to edi... | [
"This",
"allows",
"you",
"to",
"edit",
"the",
"caption",
"of",
"any",
"captionable",
"message",
"you",
"have",
"sent",
"previously"
] | train | https://github.com/zackpollard/JavaTelegramBot-API/blob/9d100f351824042ca5fc0ea735d1fa376a13e81d/core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java#L759-L762 |
unbescape/unbescape | src/main/java/org/unbescape/html/HtmlEscape.java | HtmlEscape.escapeHtml4 | public static void escapeHtml4(final String text, final Writer writer)
throws IOException {
escapeHtml(text, writer, HtmlEscapeType.HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL,
HtmlEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT);
} | java | public static void escapeHtml4(final String text, final Writer writer)
throws IOException {
escapeHtml(text, writer, HtmlEscapeType.HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL,
HtmlEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT);
} | [
"public",
"static",
"void",
"escapeHtml4",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeHtml",
"(",
"text",
",",
"writer",
",",
"HtmlEscapeType",
".",
"HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL",
",",
... | <p>
Perform an HTML 4 level 2 (result is ASCII) <strong>escape</strong> operation on a <tt>String</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 2</em> means this method will escape:
</p>
<ul>
<li>The five markup-significant characters: <tt><</tt>, <tt>></tt>, <tt>&</tt>,
<tt>"</tt>... | [
"<p",
">",
"Perform",
"an",
"HTML",
"4",
"level",
"2",
"(",
"result",
"is",
"ASCII",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/html/HtmlEscape.java#L495-L499 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java | AbstractQueryProtocol.executeBatchRewrite | private void executeBatchRewrite(Results results,
final ClientPrepareResult prepareResult, List<ParameterHolder[]> parameterList,
boolean rewriteValues) throws SQLException {
cmdPrologue();
ParameterHolder[] parameters;
int currentIndex = 0;
int totalParameterList = parameterList.size();
... | java | private void executeBatchRewrite(Results results,
final ClientPrepareResult prepareResult, List<ParameterHolder[]> parameterList,
boolean rewriteValues) throws SQLException {
cmdPrologue();
ParameterHolder[] parameters;
int currentIndex = 0;
int totalParameterList = parameterList.size();
... | [
"private",
"void",
"executeBatchRewrite",
"(",
"Results",
"results",
",",
"final",
"ClientPrepareResult",
"prepareResult",
",",
"List",
"<",
"ParameterHolder",
"[",
"]",
">",
"parameterList",
",",
"boolean",
"rewriteValues",
")",
"throws",
"SQLException",
"{",
"cmdP... | Specific execution for batch rewrite that has specific query for memory.
@param results result
@param prepareResult prepareResult
@param parameterList parameters
@param rewriteValues is rewritable flag
@throws SQLException exception | [
"Specific",
"execution",
"for",
"batch",
"rewrite",
"that",
"has",
"specific",
"query",
"for",
"memory",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L892-L924 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormat.java | DateTimeFormat.createFormatterForStyle | private static DateTimeFormatter createFormatterForStyle(String style) {
if (style == null || style.length() != 2) {
throw new IllegalArgumentException("Invalid style specification: " + style);
}
int dateStyle = selectStyle(style.charAt(0));
int timeStyle = selectStyle(style.... | java | private static DateTimeFormatter createFormatterForStyle(String style) {
if (style == null || style.length() != 2) {
throw new IllegalArgumentException("Invalid style specification: " + style);
}
int dateStyle = selectStyle(style.charAt(0));
int timeStyle = selectStyle(style.... | [
"private",
"static",
"DateTimeFormatter",
"createFormatterForStyle",
"(",
"String",
"style",
")",
"{",
"if",
"(",
"style",
"==",
"null",
"||",
"style",
".",
"length",
"(",
")",
"!=",
"2",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid st... | Select a format from a two character style pattern. The first character
is the date style, and the second character is the time style. Specify a
character of 'S' for short style, 'M' for medium, 'L' for long, and 'F'
for full. A date or time may be omitted by specifying a style character '-'.
@param style two charact... | [
"Select",
"a",
"format",
"from",
"a",
"two",
"character",
"style",
"pattern",
".",
"The",
"first",
"character",
"is",
"the",
"date",
"style",
"and",
"the",
"second",
"character",
"is",
"the",
"time",
"style",
".",
"Specify",
"a",
"character",
"of",
"S",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormat.java#L710-L720 |
foundation-runtime/service-directory | 1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lookup/LookupManagerImpl.java | LookupManagerImpl.removeInstanceChangeListener | @Override
public void removeInstanceChangeListener(String serviceName, ServiceInstanceChangeListener listener) throws ServiceException {
ServiceInstanceUtils.validateManagerIsStarted(isStarted.get());
ServiceInstanceUtils.validateServiceName(serviceName);
if (listener == null) {
... | java | @Override
public void removeInstanceChangeListener(String serviceName, ServiceInstanceChangeListener listener) throws ServiceException {
ServiceInstanceUtils.validateManagerIsStarted(isStarted.get());
ServiceInstanceUtils.validateServiceName(serviceName);
if (listener == null) {
... | [
"@",
"Override",
"public",
"void",
"removeInstanceChangeListener",
"(",
"String",
"serviceName",
",",
"ServiceInstanceChangeListener",
"listener",
")",
"throws",
"ServiceException",
"{",
"ServiceInstanceUtils",
".",
"validateManagerIsStarted",
"(",
"isStarted",
".",
"get",
... | Remove a ServiceInstanceChangeListener from the Service.
Throws IllegalArgumentException if serviceName or listener is null.
@param serviceName
the service name
@param listener
the ServiceInstanceChangeListener for the service
@throws ServiceException | [
"Remove",
"a",
"ServiceInstanceChangeListener",
"from",
"the",
"Service",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lookup/LookupManagerImpl.java#L439-L450 |
GerdHolz/TOVAL | src/de/invation/code/toval/misc/ArrayUtils.java | ArrayUtils.arrayContainsRef | public static <T> boolean arrayContainsRef(T[] array, T value) {
for (int i = 0; i < array.length; i++) {
if (array[i] == value) {
return true;
}
}
return false;
} | java | public static <T> boolean arrayContainsRef(T[] array, T value) {
for (int i = 0; i < array.length; i++) {
if (array[i] == value) {
return true;
}
}
return false;
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"arrayContainsRef",
"(",
"T",
"[",
"]",
"array",
",",
"T",
"value",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"array",
... | Checks if the given array contains the specified value.<br>
This method works with strict reference comparison.
@param <T>
Type of array elements and <code>value</code>
@param array
Array to examine
@param value
Value to search
@return <code>true</code> if <code>array</code> contains
<code>value</code>, <code>false</c... | [
"Checks",
"if",
"the",
"given",
"array",
"contains",
"the",
"specified",
"value",
".",
"<br",
">",
"This",
"method",
"works",
"with",
"strict",
"reference",
"comparison",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/ArrayUtils.java#L234-L241 |
pmwmedia/tinylog | log4j1.2-api/src/main/java/org/apache/log4j/Logger.java | Logger.getLogger | public static Logger getLogger(final String name, final LoggerFactory factory) {
return LogManager.getLogger(name, factory);
} | java | public static Logger getLogger(final String name, final LoggerFactory factory) {
return LogManager.getLogger(name, factory);
} | [
"public",
"static",
"Logger",
"getLogger",
"(",
"final",
"String",
"name",
",",
"final",
"LoggerFactory",
"factory",
")",
"{",
"return",
"LogManager",
".",
"getLogger",
"(",
"name",
",",
"factory",
")",
";",
"}"
] | Like {@link #getLogger(String)} except that the type of logger instantiated depends on the type returned by the
{@link LoggerFactory#makeNewLoggerInstance} method of the {@code factory} parameter.
<p>
This method is intended to be used by sub-classes.
</p>
@param name
The name of the logger to retrieve.
@param facto... | [
"Like",
"{",
"@link",
"#getLogger",
"(",
"String",
")",
"}",
"except",
"that",
"the",
"type",
"of",
"logger",
"instantiated",
"depends",
"on",
"the",
"type",
"returned",
"by",
"the",
"{",
"@link",
"LoggerFactory#makeNewLoggerInstance",
"}",
"method",
"of",
"th... | train | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/log4j1.2-api/src/main/java/org/apache/log4j/Logger.java#L114-L116 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/pipeline/ChunkAnnotationUtils.java | ChunkAnnotationUtils.getAnnotatedChunk | public static Annotation getAnnotatedChunk(CoreMap annotation, int tokenStartIndex, int tokenEndIndex)
{
Integer annoTokenBegin = annotation.get(CoreAnnotations.TokenBeginAnnotation.class);
if (annoTokenBegin == null) { annoTokenBegin = 0; }
List<CoreLabel> tokens = annotation.get(CoreAnnotations.Toke... | java | public static Annotation getAnnotatedChunk(CoreMap annotation, int tokenStartIndex, int tokenEndIndex)
{
Integer annoTokenBegin = annotation.get(CoreAnnotations.TokenBeginAnnotation.class);
if (annoTokenBegin == null) { annoTokenBegin = 0; }
List<CoreLabel> tokens = annotation.get(CoreAnnotations.Toke... | [
"public",
"static",
"Annotation",
"getAnnotatedChunk",
"(",
"CoreMap",
"annotation",
",",
"int",
"tokenStartIndex",
",",
"int",
"tokenEndIndex",
")",
"{",
"Integer",
"annoTokenBegin",
"=",
"annotation",
".",
"get",
"(",
"CoreAnnotations",
".",
"TokenBeginAnnotation",
... | Create a new chunk Annotation with basic chunk information
CharacterOffsetBeginAnnotation - set to CharacterOffsetBeginAnnotation of first token in chunk
CharacterOffsetEndAnnotation - set to CharacterOffsetEndAnnotation of last token in chunk
TokensAnnotation - List of tokens in this chunk
TokenBeginAnnotation - Index... | [
"Create",
"a",
"new",
"chunk",
"Annotation",
"with",
"basic",
"chunk",
"information",
"CharacterOffsetBeginAnnotation",
"-",
"set",
"to",
"CharacterOffsetBeginAnnotation",
"of",
"first",
"token",
"in",
"chunk",
"CharacterOffsetEndAnnotation",
"-",
"set",
"to",
"Characte... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/pipeline/ChunkAnnotationUtils.java#L664-L677 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/style/stylers/AbstractStyler.java | AbstractStyler.update | @Override
public void update(Observable o, Object arg) {
Parameter p = (Parameter) o;
if (!iTextSettingsApplied) {
iTextSettingsApplied = true;
StylerFactoryHelper.SETTINGS_ANNOTATION_PROCESSOR.initSettings(itextHelper, getSettings());
}
if (CONDITONS.equals(p.getKey()) && p... | java | @Override
public void update(Observable o, Object arg) {
Parameter p = (Parameter) o;
if (!iTextSettingsApplied) {
iTextSettingsApplied = true;
StylerFactoryHelper.SETTINGS_ANNOTATION_PROCESSOR.initSettings(itextHelper, getSettings());
}
if (CONDITONS.equals(p.getKey()) && p... | [
"@",
"Override",
"public",
"void",
"update",
"(",
"Observable",
"o",
",",
"Object",
"arg",
")",
"{",
"Parameter",
"p",
"=",
"(",
"Parameter",
")",
"o",
";",
"if",
"(",
"!",
"iTextSettingsApplied",
")",
"{",
"iTextSettingsApplied",
"=",
"true",
";",
"Styl... | Will be called when a {@link Parameter} changes (when {@link Parameter#setDefault(java.io.Serializable) } or {@link Parameter#setValue(java.io.Serializable)
} is called). This method will always be called because the parameter {@link #STYLEAFTER} has a default value.
Here settings of {@link #itextHelper} will be initia... | [
"Will",
"be",
"called",
"when",
"a",
"{",
"@link",
"Parameter",
"}",
"changes",
"(",
"when",
"{",
"@link",
"Parameter#setDefault",
"(",
"java",
".",
"io",
".",
"Serializable",
")",
"}",
"or",
"{",
"@link",
"Parameter#setValue",
"(",
"java",
".",
"io",
".... | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/stylers/AbstractStyler.java#L240-L250 |
walkmod/walkmod-core | src/main/java/org/walkmod/WalkModFacade.java | WalkModFacade.addChainConfig | public void addChainConfig(ChainConfig chainCfg, boolean recursive, String before) throws Exception {
long startTime = System.currentTimeMillis();
Exception exception = null;
if (!cfg.exists()) {
init();
}
userDir = new File(System.getProperty("user.dir")).getAb... | java | public void addChainConfig(ChainConfig chainCfg, boolean recursive, String before) throws Exception {
long startTime = System.currentTimeMillis();
Exception exception = null;
if (!cfg.exists()) {
init();
}
userDir = new File(System.getProperty("user.dir")).getAb... | [
"public",
"void",
"addChainConfig",
"(",
"ChainConfig",
"chainCfg",
",",
"boolean",
"recursive",
",",
"String",
"before",
")",
"throws",
"Exception",
"{",
"long",
"startTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"Exception",
"exception",
"=",... | Adds a new chain configuration into the configuration file
@param chainCfg
chain configuration to add
@param recursive
Adds the new chain into all the submodules
@param before
Decides which is the next chain to execute.
@throws Exception
in case that the walkmod configuration file can't be read. | [
"Adds",
"a",
"new",
"chain",
"configuration",
"into",
"the",
"configuration",
"file"
] | train | https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L389-L409 |
Whiley/WhileyCompiler | src/main/java/wyil/type/util/TypeSubtractor.java | TypeSubtractor.apply | @Override
protected Type apply(Record lhs, Record rhs, LifetimeRelation lifetimes, LinkageStack stack) {
Tuple<Type.Field> lhsFields = lhs.getFields();
Tuple<Type.Field> rhsFields = rhs.getFields();
// Check the number of field matches
int matches = countFieldMatches(lhsFields,rhsFields);
if(matches < rhsFie... | java | @Override
protected Type apply(Record lhs, Record rhs, LifetimeRelation lifetimes, LinkageStack stack) {
Tuple<Type.Field> lhsFields = lhs.getFields();
Tuple<Type.Field> rhsFields = rhs.getFields();
// Check the number of field matches
int matches = countFieldMatches(lhsFields,rhsFields);
if(matches < rhsFie... | [
"@",
"Override",
"protected",
"Type",
"apply",
"(",
"Record",
"lhs",
",",
"Record",
"rhs",
",",
"LifetimeRelation",
"lifetimes",
",",
"LinkageStack",
"stack",
")",
"{",
"Tuple",
"<",
"Type",
".",
"Field",
">",
"lhsFields",
"=",
"lhs",
".",
"getFields",
"("... | <p>
Subtract one record from another. For example, subtracting
<code>{null f}</code> from <code>{int|null f}</code> leaves
<code>{int f}</code>. Unfortunately, there are relatively limited conditions
when a genuine subtraction can occur. For example, subtracting
<code>{null f, null g}</code> from <code>{int|null f, int... | [
"<p",
">",
"Subtract",
"one",
"record",
"from",
"another",
".",
"For",
"example",
"subtracting",
"<code",
">",
"{",
"null",
"f",
"}",
"<",
"/",
"code",
">",
"from",
"<code",
">",
"{",
"int|null",
"f",
"}",
"<",
"/",
"code",
">",
"leaves",
"<code",
... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/type/util/TypeSubtractor.java#L107-L143 |
landawn/AbacusUtil | src/com/landawn/abacus/util/CouchbaseExecutor.java | CouchbaseExecutor.asyncExists | @SafeVarargs
public final ContinuableFuture<Boolean> asyncExists(final String query, final Object... parameters) {
return asyncExecutor.execute(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return exists(query, parameters);
... | java | @SafeVarargs
public final ContinuableFuture<Boolean> asyncExists(final String query, final Object... parameters) {
return asyncExecutor.execute(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return exists(query, parameters);
... | [
"@",
"SafeVarargs",
"public",
"final",
"ContinuableFuture",
"<",
"Boolean",
">",
"asyncExists",
"(",
"final",
"String",
"query",
",",
"final",
"Object",
"...",
"parameters",
")",
"{",
"return",
"asyncExecutor",
".",
"execute",
"(",
"new",
"Callable",
"<",
"Boo... | Always remember to set "<code>LIMIT 1</code>" in the sql statement for better performance.
@param query
@param parameters
@return | [
"Always",
"remember",
"to",
"set",
"<code",
">",
"LIMIT",
"1<",
"/",
"code",
">",
"in",
"the",
"sql",
"statement",
"for",
"better",
"performance",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CouchbaseExecutor.java#L1201-L1209 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.booleanTemplate | @Deprecated
public static BooleanTemplate booleanTemplate(Template template, ImmutableList<?> args) {
return new BooleanTemplate(template, args);
} | java | @Deprecated
public static BooleanTemplate booleanTemplate(Template template, ImmutableList<?> args) {
return new BooleanTemplate(template, args);
} | [
"@",
"Deprecated",
"public",
"static",
"BooleanTemplate",
"booleanTemplate",
"(",
"Template",
"template",
",",
"ImmutableList",
"<",
"?",
">",
"args",
")",
"{",
"return",
"new",
"BooleanTemplate",
"(",
"template",
",",
"args",
")",
";",
"}"
] | Create a new Template expression
@deprecated Use {@link #booleanTemplate(Template, List)} instead.
@param template template
@param args template parameters
@return template expression | [
"Create",
"a",
"new",
"Template",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L1009-L1012 |
vdmeer/asciitable | src/main/java/de/vandermeer/asciitable/AT_Row.java | AT_Row.setPaddingLeftRight | public AT_Row setPaddingLeftRight(int paddingLeft, int paddingRight){
if(this.hasCells()){
for(AT_Cell cell : this.getCells()){
cell.getContext().setPaddingLeftRight(paddingLeft, paddingRight);
}
}
return this;
} | java | public AT_Row setPaddingLeftRight(int paddingLeft, int paddingRight){
if(this.hasCells()){
for(AT_Cell cell : this.getCells()){
cell.getContext().setPaddingLeftRight(paddingLeft, paddingRight);
}
}
return this;
} | [
"public",
"AT_Row",
"setPaddingLeftRight",
"(",
"int",
"paddingLeft",
",",
"int",
"paddingRight",
")",
"{",
"if",
"(",
"this",
".",
"hasCells",
"(",
")",
")",
"{",
"for",
"(",
"AT_Cell",
"cell",
":",
"this",
".",
"getCells",
"(",
")",
")",
"{",
"cell",... | Sets left and right padding for all cells in the row (only if both values are not smaller than 0).
@param paddingLeft new left padding, ignored if smaller than 0
@param paddingRight new right padding, ignored if smaller than 0
@return this to allow chaining | [
"Sets",
"left",
"and",
"right",
"padding",
"for",
"all",
"cells",
"in",
"the",
"row",
"(",
"only",
"if",
"both",
"values",
"are",
"not",
"smaller",
"than",
"0",
")",
"."
] | train | https://github.com/vdmeer/asciitable/blob/b6a73710271c89f9c749603be856ba84a969ed5f/src/main/java/de/vandermeer/asciitable/AT_Row.java#L214-L221 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseCsrsv_analysisEx | public static int cusparseCsrsv_analysisEx(
cusparseHandle handle,
int transA,
int m,
int nnz,
cusparseMatDescr descrA,
Pointer csrSortedValA,
int csrSortedValAtype,
Pointer csrSortedRowPtrA,
Pointer csrSortedColIndA,
cus... | java | public static int cusparseCsrsv_analysisEx(
cusparseHandle handle,
int transA,
int m,
int nnz,
cusparseMatDescr descrA,
Pointer csrSortedValA,
int csrSortedValAtype,
Pointer csrSortedRowPtrA,
Pointer csrSortedColIndA,
cus... | [
"public",
"static",
"int",
"cusparseCsrsv_analysisEx",
"(",
"cusparseHandle",
"handle",
",",
"int",
"transA",
",",
"int",
"m",
",",
"int",
"nnz",
",",
"cusparseMatDescr",
"descrA",
",",
"Pointer",
"csrSortedValA",
",",
"int",
"csrSortedValAtype",
",",
"Pointer",
... | Description: Solution of triangular linear system op(A) * x = alpha * f,
where A is a sparse matrix in CSR storage format, rhs f and solution x
are dense vectors. This routine implements algorithm 1 for the solve. | [
"Description",
":",
"Solution",
"of",
"triangular",
"linear",
"system",
"op",
"(",
"A",
")",
"*",
"x",
"=",
"alpha",
"*",
"f",
"where",
"A",
"is",
"a",
"sparse",
"matrix",
"in",
"CSR",
"storage",
"format",
"rhs",
"f",
"and",
"solution",
"x",
"are",
"... | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L2143-L2157 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java | EnvironmentSettingsInner.createOrUpdateAsync | public Observable<EnvironmentSettingInner> createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingInner environmentSetting) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettin... | java | public Observable<EnvironmentSettingInner> createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingInner environmentSetting) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettin... | [
"public",
"Observable",
"<",
"EnvironmentSettingInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"environmentSettingName",
",",
"EnvironmentSettingInner",
"environmentSetting",
... | Create or replace an existing Environment Setting. This operation can take a while to complete.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param environmentSettingName The name of the environment Setting.
@param envir... | [
"Create",
"or",
"replace",
"an",
"existing",
"Environment",
"Setting",
".",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java#L647-L654 |
googleads/googleads-java-lib | modules/ads_lib_axis/src/main/java/com/google/api/ads/common/lib/soap/axis/AxisHandler.java | AxisHandler.setEndpointAddress | @Override
public void setEndpointAddress(Stub soapClient, String endpointAddress) {
soapClient._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, endpointAddress);
} | java | @Override
public void setEndpointAddress(Stub soapClient, String endpointAddress) {
soapClient._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, endpointAddress);
} | [
"@",
"Override",
"public",
"void",
"setEndpointAddress",
"(",
"Stub",
"soapClient",
",",
"String",
"endpointAddress",
")",
"{",
"soapClient",
".",
"_setProperty",
"(",
"Stub",
".",
"ENDPOINT_ADDRESS_PROPERTY",
",",
"endpointAddress",
")",
";",
"}"
] | Sets the endpoint address of the given SOAP client.
@param soapClient the SOAP client to set the endpoint address for
@param endpointAddress the target endpoint address | [
"Sets",
"the",
"endpoint",
"address",
"of",
"the",
"given",
"SOAP",
"client",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib_axis/src/main/java/com/google/api/ads/common/lib/soap/axis/AxisHandler.java#L68-L71 |
twilio/twilio-java | src/main/java/com/twilio/rest/video/v1/RecordingReader.java | RecordingReader.firstPage | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<Recording> firstPage(final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
Domains.VIDEO.toString(),
"/v1/Recordings",
client.getRegion()
);
addQuer... | java | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<Recording> firstPage(final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
Domains.VIDEO.toString(),
"/v1/Recordings",
client.getRegion()
);
addQuer... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:linelength\"",
")",
"public",
"Page",
"<",
"Recording",
">",
"firstPage",
"(",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET... | Make the request to the Twilio API to perform the read.
@param client TwilioRestClient with which to make the request
@return Recording ResourceSet | [
"Make",
"the",
"request",
"to",
"the",
"Twilio",
"API",
"to",
"perform",
"the",
"read",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/video/v1/RecordingReader.java#L136-L148 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLService.java | CQLService.getPreparedQuery | public PreparedStatement getPreparedQuery(Query query, String storeName) {
String tableName = storeToCQLName(storeName);
return m_statementCache.getPreparedQuery(tableName, query);
} | java | public PreparedStatement getPreparedQuery(Query query, String storeName) {
String tableName = storeToCQLName(storeName);
return m_statementCache.getPreparedQuery(tableName, query);
} | [
"public",
"PreparedStatement",
"getPreparedQuery",
"(",
"Query",
"query",
",",
"String",
"storeName",
")",
"{",
"String",
"tableName",
"=",
"storeToCQLName",
"(",
"storeName",
")",
";",
"return",
"m_statementCache",
".",
"getPreparedQuery",
"(",
"tableName",
",",
... | Get the {@link PreparedStatement} for the given {@link CQLStatementCache.Query} to
the given table name. If needed, the query statement is compiled and cached.
@param query Query statement type.
@param storeName Store (ColumnFamily) name.
@return PreparedStatement for requested table/query. | [
"Get",
"the",
"{",
"@link",
"PreparedStatement",
"}",
"for",
"the",
"given",
"{",
"@link",
"CQLStatementCache",
".",
"Query",
"}",
"to",
"the",
"given",
"table",
"name",
".",
"If",
"needed",
"the",
"query",
"statement",
"is",
"compiled",
"and",
"cached",
"... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLService.java#L249-L252 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/utils/memory/MemoryUtil.java | MemoryUtil.setBytes | public static void setBytes(long address, byte[] buffer, int bufferOffset, int count)
{
assert buffer != null;
assert !(bufferOffset < 0 || count < 0 || bufferOffset + count > buffer.length);
setBytes(buffer, bufferOffset, address, count);
} | java | public static void setBytes(long address, byte[] buffer, int bufferOffset, int count)
{
assert buffer != null;
assert !(bufferOffset < 0 || count < 0 || bufferOffset + count > buffer.length);
setBytes(buffer, bufferOffset, address, count);
} | [
"public",
"static",
"void",
"setBytes",
"(",
"long",
"address",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"bufferOffset",
",",
"int",
"count",
")",
"{",
"assert",
"buffer",
"!=",
"null",
";",
"assert",
"!",
"(",
"bufferOffset",
"<",
"0",
"||",
"coun... | Transfers count bytes from buffer to Memory
@param address start offset in the memory
@param buffer the data buffer
@param bufferOffset start offset of the buffer
@param count number of bytes to transfer | [
"Transfers",
"count",
"bytes",
"from",
"buffer",
"to",
"Memory"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/memory/MemoryUtil.java#L257-L262 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TopicPattern.java | TopicPattern.topicSkipBackward | static boolean topicSkipBackward(char[] chars, int[] cursor) {
if (cursor[0] == cursor[1])
return false;
while (cursor[0] < cursor[1] &&
chars[cursor[1]-1] != MatchSpace.SUBTOPIC_SEPARATOR_CHAR)
cursor[1]--;
return true;
} | java | static boolean topicSkipBackward(char[] chars, int[] cursor) {
if (cursor[0] == cursor[1])
return false;
while (cursor[0] < cursor[1] &&
chars[cursor[1]-1] != MatchSpace.SUBTOPIC_SEPARATOR_CHAR)
cursor[1]--;
return true;
} | [
"static",
"boolean",
"topicSkipBackward",
"(",
"char",
"[",
"]",
"chars",
",",
"int",
"[",
"]",
"cursor",
")",
"{",
"if",
"(",
"cursor",
"[",
"0",
"]",
"==",
"cursor",
"[",
"1",
"]",
")",
"return",
"false",
";",
"while",
"(",
"cursor",
"[",
"0",
... | Skip backward to the next separator character
@param chars the characters to be examined
@param cursor the int[2] { start, end } "cursor" describing the area to be examined
@return true if something was skipped, false if nothing could be skipped | [
"Skip",
"backward",
"to",
"the",
"next",
"separator",
"character"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TopicPattern.java#L102-L109 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.listQueryResultsForResourceGroupLevelPolicyAssignment | public PolicyStatesQueryResultsInner listQueryResultsForResourceGroupLevelPolicyAssignment(PolicyStatesResource policyStatesResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, QueryOptions queryOptions) {
return listQueryResultsForResourceGroupLevelPolicyAssignmentWithService... | java | public PolicyStatesQueryResultsInner listQueryResultsForResourceGroupLevelPolicyAssignment(PolicyStatesResource policyStatesResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, QueryOptions queryOptions) {
return listQueryResultsForResourceGroupLevelPolicyAssignmentWithService... | [
"public",
"PolicyStatesQueryResultsInner",
"listQueryResultsForResourceGroupLevelPolicyAssignment",
"(",
"PolicyStatesResource",
"policyStatesResource",
",",
"String",
"subscriptionId",
",",
"String",
"resourceGroupName",
",",
"String",
"policyAssignmentName",
",",
"QueryOptions",
... | Queries policy states for the resource group level policy assignment.
@param policyStatesResource The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). Possible values include: 'default', 'latest'
... | [
"Queries",
"policy",
"states",
"for",
"the",
"resource",
"group",
"level",
"policy",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L2980-L2982 |
fhussonnois/storm-trident-elasticsearch | src/main/java/com/github/fhuss/storm/elasticsearch/mapper/impl/DefaultTupleMapper.java | DefaultTupleMapper.newObjectDefaultTupleMapper | public static final DefaultTupleMapper newObjectDefaultTupleMapper( ) {
final ObjectMapper mapper = new ObjectMapper();
return new DefaultTupleMapper(new TupleMapper<String>() {
@Override
public String map(Tuple input) {
try {
return mapper.wri... | java | public static final DefaultTupleMapper newObjectDefaultTupleMapper( ) {
final ObjectMapper mapper = new ObjectMapper();
return new DefaultTupleMapper(new TupleMapper<String>() {
@Override
public String map(Tuple input) {
try {
return mapper.wri... | [
"public",
"static",
"final",
"DefaultTupleMapper",
"newObjectDefaultTupleMapper",
"(",
")",
"{",
"final",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"return",
"new",
"DefaultTupleMapper",
"(",
"new",
"TupleMapper",
"<",
"String",
">",
"("... | Returns a new {@link DefaultTupleMapper} that accept Object as source field value. | [
"Returns",
"a",
"new",
"{"
] | train | https://github.com/fhussonnois/storm-trident-elasticsearch/blob/1788157efff223800a92f17f79deb02c905230f7/src/main/java/com/github/fhuss/storm/elasticsearch/mapper/impl/DefaultTupleMapper.java#L79-L91 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/cp/CPSubsystemConfig.java | CPSubsystemConfig.setLockConfigs | public CPSubsystemConfig setLockConfigs(Map<String, FencedLockConfig> lockConfigs) {
this.lockConfigs.clear();
this.lockConfigs.putAll(lockConfigs);
for (Entry<String, FencedLockConfig> entry : this.lockConfigs.entrySet()) {
entry.getValue().setName(entry.getKey());
}
... | java | public CPSubsystemConfig setLockConfigs(Map<String, FencedLockConfig> lockConfigs) {
this.lockConfigs.clear();
this.lockConfigs.putAll(lockConfigs);
for (Entry<String, FencedLockConfig> entry : this.lockConfigs.entrySet()) {
entry.getValue().setName(entry.getKey());
}
... | [
"public",
"CPSubsystemConfig",
"setLockConfigs",
"(",
"Map",
"<",
"String",
",",
"FencedLockConfig",
">",
"lockConfigs",
")",
"{",
"this",
".",
"lockConfigs",
".",
"clear",
"(",
")",
";",
"this",
".",
"lockConfigs",
".",
"putAll",
"(",
"lockConfigs",
")",
";... | Sets the map of {@link FencedLock} configurations, mapped by config
name. Names could optionally contain a {@link CPGroup} name, such as
"myLock@group1".
@param lockConfigs the {@link FencedLock} config map to set
@return this config instance | [
"Sets",
"the",
"map",
"of",
"{",
"@link",
"FencedLock",
"}",
"configurations",
"mapped",
"by",
"config",
"name",
".",
"Names",
"could",
"optionally",
"contain",
"a",
"{",
"@link",
"CPGroup",
"}",
"name",
"such",
"as",
"myLock@group1",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/cp/CPSubsystemConfig.java#L544-L551 |
JOML-CI/JOML | src/org/joml/Vector2f.java | Vector2f.distanceSquared | public static float distanceSquared(float x1, float y1, float x2, float y2) {
float dx = x1 - x2;
float dy = y1 - y2;
return dx * dx + dy * dy;
} | java | public static float distanceSquared(float x1, float y1, float x2, float y2) {
float dx = x1 - x2;
float dy = y1 - y2;
return dx * dx + dy * dy;
} | [
"public",
"static",
"float",
"distanceSquared",
"(",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"x2",
",",
"float",
"y2",
")",
"{",
"float",
"dx",
"=",
"x1",
"-",
"x2",
";",
"float",
"dy",
"=",
"y1",
"-",
"y2",
";",
"return",
"dx",
"*",
"dx... | Return the squared distance between <code>(x1, y1)</code> and <code>(x2, y2)</code>.
@param x1
the x component of the first vector
@param y1
the y component of the first vector
@param x2
the x component of the second vector
@param y2
the y component of the second vector
@return the euclidean distance squared | [
"Return",
"the",
"squared",
"distance",
"between",
"<code",
">",
"(",
"x1",
"y1",
")",
"<",
"/",
"code",
">",
"and",
"<code",
">",
"(",
"x2",
"y2",
")",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector2f.java#L607-L611 |
OpenLiberty/open-liberty | dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/ThreadContextAccessor.java | ThreadContextAccessor.repushContextClassLoader | public Object repushContextClassLoader(Object origLoader, ClassLoader loader) {
if (origLoader == UNCHANGED) {
return pushContextClassLoader(loader);
}
setContextClassLoader(Thread.currentThread(), loader);
return origLoader;
} | java | public Object repushContextClassLoader(Object origLoader, ClassLoader loader) {
if (origLoader == UNCHANGED) {
return pushContextClassLoader(loader);
}
setContextClassLoader(Thread.currentThread(), loader);
return origLoader;
} | [
"public",
"Object",
"repushContextClassLoader",
"(",
"Object",
"origLoader",
",",
"ClassLoader",
"loader",
")",
"{",
"if",
"(",
"origLoader",
"==",
"UNCHANGED",
")",
"{",
"return",
"pushContextClassLoader",
"(",
"loader",
")",
";",
"}",
"setContextClassLoader",
"(... | Updates the context class loader of the current thread between calls to {@link #pushContextClassLoader} and {@link #popContextClassLoader}. If
the original class loader is {@link #UNCHANGED}, then this is equivalent
to {@link #pushContextClassLoader}). Otherwise, this is equivalent to {@link #setContextClassLoader}, an... | [
"Updates",
"the",
"context",
"class",
"loader",
"of",
"the",
"current",
"thread",
"between",
"calls",
"to",
"{",
"@link",
"#pushContextClassLoader",
"}",
"and",
"{",
"@link",
"#popContextClassLoader",
"}",
".",
"If",
"the",
"original",
"class",
"loader",
"is",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/ThreadContextAccessor.java#L179-L186 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java | JDBCResultSet.getObject | public Object getObject(int columnIndex) throws SQLException {
checkColumn(columnIndex);
Type sourceType = resultMetaData.columnTypes[columnIndex - 1];
switch (sourceType.typeCode) {
case Types.SQL_DATE :
return getDate(columnIndex);
case Types.SQL_TIM... | java | public Object getObject(int columnIndex) throws SQLException {
checkColumn(columnIndex);
Type sourceType = resultMetaData.columnTypes[columnIndex - 1];
switch (sourceType.typeCode) {
case Types.SQL_DATE :
return getDate(columnIndex);
case Types.SQL_TIM... | [
"public",
"Object",
"getObject",
"(",
"int",
"columnIndex",
")",
"throws",
"SQLException",
"{",
"checkColumn",
"(",
"columnIndex",
")",
";",
"Type",
"sourceType",
"=",
"resultMetaData",
".",
"columnTypes",
"[",
"columnIndex",
"-",
"1",
"]",
";",
"switch",
"(",... | <!-- start generic documentation -->
<p>Gets the value of the designated column in the current row
of this <code>ResultSet</code> object as
an <code>Object</code> in the Java programming language.
<p>This method will return the value of the given column as a
Java object. The type of the Java object will be the defaul... | [
"<!",
"--",
"start",
"generic",
"documentation",
"--",
">",
"<p",
">",
"Gets",
"the",
"value",
"of",
"the",
"designated",
"column",
"in",
"the",
"current",
"row",
"of",
"this",
"<code",
">",
"ResultSet<",
"/",
"code",
">",
"object",
"as",
"an",
"<code",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java#L1504-L1540 |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/ripple/LollipopDrawablesCompat.java | LollipopDrawablesCompat.createFromXml | public static Drawable createFromXml(Resources r, XmlPullParser parser) throws XmlPullParserException, IOException {
return createFromXml(r, parser, null);
} | java | public static Drawable createFromXml(Resources r, XmlPullParser parser) throws XmlPullParserException, IOException {
return createFromXml(r, parser, null);
} | [
"public",
"static",
"Drawable",
"createFromXml",
"(",
"Resources",
"r",
",",
"XmlPullParser",
"parser",
")",
"throws",
"XmlPullParserException",
",",
"IOException",
"{",
"return",
"createFromXml",
"(",
"r",
",",
"parser",
",",
"null",
")",
";",
"}"
] | Create a drawable from an XML document. For more information on how to create resources in
XML, see
<a href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>. | [
"Create",
"a",
"drawable",
"from",
"an",
"XML",
"document",
".",
"For",
"more",
"information",
"on",
"how",
"to",
"create",
"resources",
"in",
"XML",
"see",
"<a",
"href",
"=",
"{"
] | train | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/LollipopDrawablesCompat.java#L99-L101 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java | HttpConversionUtil.toHttpRequest | public static HttpRequest toHttpRequest(int streamId, Http2Headers http2Headers, boolean validateHttpHeaders)
throws Http2Exception {
// HTTP/2 does not define a way to carry the version identifier that is included in the HTTP/1.1 request line.
final CharSequence method = checkNotNul... | java | public static HttpRequest toHttpRequest(int streamId, Http2Headers http2Headers, boolean validateHttpHeaders)
throws Http2Exception {
// HTTP/2 does not define a way to carry the version identifier that is included in the HTTP/1.1 request line.
final CharSequence method = checkNotNul... | [
"public",
"static",
"HttpRequest",
"toHttpRequest",
"(",
"int",
"streamId",
",",
"Http2Headers",
"http2Headers",
",",
"boolean",
"validateHttpHeaders",
")",
"throws",
"Http2Exception",
"{",
"// HTTP/2 does not define a way to carry the version identifier that is included in the HTT... | Create a new object to contain the request data.
@param streamId The stream associated with the request
@param http2Headers The initial set of HTTP/2 headers to create the request with
@param validateHttpHeaders <ul>
<li>{@code true} to validate HTTP headers in the http-codec</li>
<li>{@code false} not to validate HTT... | [
"Create",
"a",
"new",
"object",
"to",
"contain",
"the",
"request",
"data",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java#L280-L297 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setFloat | public static void setFloat(MemorySegment[] segments, int offset, float value) {
if (inFirstSegment(segments, offset, 4)) {
segments[0].putFloat(offset, value);
} else {
setFloatMultiSegments(segments, offset, value);
}
} | java | public static void setFloat(MemorySegment[] segments, int offset, float value) {
if (inFirstSegment(segments, offset, 4)) {
segments[0].putFloat(offset, value);
} else {
setFloatMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setFloat",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"float",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"4",
")",
")",
"{",
"segments",
"[",
"0",
"]",
... | set float from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"float",
"from",
"segments",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L878-L884 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/RouteTablesInner.java | RouteTablesInner.getByResourceGroupAsync | public Observable<RouteTableInner> getByResourceGroupAsync(String resourceGroupName, String routeTableName, String expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand).map(new Func1<ServiceResponse<RouteTableInner>, RouteTableInner>() {
@Override
... | java | public Observable<RouteTableInner> getByResourceGroupAsync(String resourceGroupName, String routeTableName, String expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand).map(new Func1<ServiceResponse<RouteTableInner>, RouteTableInner>() {
@Override
... | [
"public",
"Observable",
"<",
"RouteTableInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"routeTableName",
",",
"String",
"expand",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"... | Gets the specified route table.
@param resourceGroupName The name of the resource group.
@param routeTableName The name of the route table.
@param expand Expands referenced resources.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RouteTableInner object | [
"Gets",
"the",
"specified",
"route",
"table",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/RouteTablesInner.java#L383-L390 |
kmi/iserve | iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/Util.java | Util.generateSubclassPattern | public static String generateSubclassPattern(URI origin, URI destination) {
return new StringBuilder()
.append(sparqlWrapUri(destination)).append(" ")
.append(sparqlWrapUri(RDFS.subClassOf.getURI())).append("+ ")
.append(sparqlWrapUri(origin)).append(" .")
... | java | public static String generateSubclassPattern(URI origin, URI destination) {
return new StringBuilder()
.append(sparqlWrapUri(destination)).append(" ")
.append(sparqlWrapUri(RDFS.subClassOf.getURI())).append("+ ")
.append(sparqlWrapUri(origin)).append(" .")
... | [
"public",
"static",
"String",
"generateSubclassPattern",
"(",
"URI",
"origin",
",",
"URI",
"destination",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",
"sparqlWrapUri",
"(",
"destination",
")",
")",
".",
"append",
"(",
"\" \"",
")... | Generate a pattern for checking if destination is a subclass of origin
@param origin
@param destination
@return | [
"Generate",
"a",
"pattern",
"for",
"checking",
"if",
"destination",
"is",
"a",
"subclass",
"of",
"origin"
] | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/Util.java#L233-L239 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/model/RuntimeModelIo.java | RuntimeModelIo.loadApplicationFlexibly | public static ApplicationLoadResult loadApplicationFlexibly( File projectDirectory ) {
File descDirectory = new File( projectDirectory, Constants.PROJECT_DIR_DESC );
ApplicationLoadResult result;
if( descDirectory.exists()) {
result = loadApplication( projectDirectory );
} else {
ApplicationTemplateDesc... | java | public static ApplicationLoadResult loadApplicationFlexibly( File projectDirectory ) {
File descDirectory = new File( projectDirectory, Constants.PROJECT_DIR_DESC );
ApplicationLoadResult result;
if( descDirectory.exists()) {
result = loadApplication( projectDirectory );
} else {
ApplicationTemplateDesc... | [
"public",
"static",
"ApplicationLoadResult",
"loadApplicationFlexibly",
"(",
"File",
"projectDirectory",
")",
"{",
"File",
"descDirectory",
"=",
"new",
"File",
"(",
"projectDirectory",
",",
"Constants",
".",
"PROJECT_DIR_DESC",
")",
";",
"ApplicationLoadResult",
"result... | Loads an application from a directory.
<p>
This method allows to load an application which does not have a descriptor.
If it has one, it will be read. Otherwise, a default one will be generated.
This is convenient for reusable recipes.
</p>
@param projectDirectory the project directory
@return a load result (never nul... | [
"Loads",
"an",
"application",
"from",
"a",
"directory",
".",
"<p",
">",
"This",
"method",
"allows",
"to",
"load",
"an",
"application",
"which",
"does",
"not",
"have",
"a",
"descriptor",
".",
"If",
"it",
"has",
"one",
"it",
"will",
"be",
"read",
".",
"O... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/RuntimeModelIo.java#L153-L178 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java | ImageLoading.loadBitmap | public static Bitmap loadBitmap(String fileName, int scale) throws ImageLoadException {
return loadBitmap(new FileSource(fileName), scale);
} | java | public static Bitmap loadBitmap(String fileName, int scale) throws ImageLoadException {
return loadBitmap(new FileSource(fileName), scale);
} | [
"public",
"static",
"Bitmap",
"loadBitmap",
"(",
"String",
"fileName",
",",
"int",
"scale",
")",
"throws",
"ImageLoadException",
"{",
"return",
"loadBitmap",
"(",
"new",
"FileSource",
"(",
"fileName",
")",
",",
"scale",
")",
";",
"}"
] | Loading bitmap with scaling
@param fileName Image file name
@param scale divider of size, might be factor of two
@return loaded bitmap (always not null)
@throws ImageLoadException if it is unable to load file | [
"Loading",
"bitmap",
"with",
"scaling"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L72-L74 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java | JobOperations.patchJob | public void patchJob(String jobId, JobPatchParameter jobPatchParameter) throws BatchErrorException, IOException {
patchJob(jobId, jobPatchParameter, null);
} | java | public void patchJob(String jobId, JobPatchParameter jobPatchParameter) throws BatchErrorException, IOException {
patchJob(jobId, jobPatchParameter, null);
} | [
"public",
"void",
"patchJob",
"(",
"String",
"jobId",
",",
"JobPatchParameter",
"jobPatchParameter",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"patchJob",
"(",
"jobId",
",",
"jobPatchParameter",
",",
"null",
")",
";",
"}"
] | Updates the specified job.
This method only replaces the properties specified with non-null values.
@param jobId The ID of the job.
@param jobPatchParameter The set of changes to be made to a job.
@throws BatchErrorException Exception thrown when an error response is received from the Batch service.
@throws IOExceptio... | [
"Updates",
"the",
"specified",
"job",
".",
"This",
"method",
"only",
"replaces",
"the",
"properties",
"specified",
"with",
"non",
"-",
"null",
"values",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java#L574-L576 |
joniles/mpxj | src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java | ProjectTreeController.saveFile | public void saveFile(File file, String type)
{
try
{
Class<? extends ProjectWriter> fileClass = WRITER_MAP.get(type);
if (fileClass == null)
{
throw new IllegalArgumentException("Cannot write files of type: " + type);
}
ProjectWriter writer = file... | java | public void saveFile(File file, String type)
{
try
{
Class<? extends ProjectWriter> fileClass = WRITER_MAP.get(type);
if (fileClass == null)
{
throw new IllegalArgumentException("Cannot write files of type: " + type);
}
ProjectWriter writer = file... | [
"public",
"void",
"saveFile",
"(",
"File",
"file",
",",
"String",
"type",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
"extends",
"ProjectWriter",
">",
"fileClass",
"=",
"WRITER_MAP",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"fileClass",
"==",
"null",... | Save the current file as the given type.
@param file target file
@param type file type | [
"Save",
"the",
"current",
"file",
"as",
"the",
"given",
"type",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java#L514-L532 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/MetaClass.java | MetaClass.createInstance | @SuppressWarnings("unchecked")
public <E,F extends E> F createInstance(Class<E> type, Object... params) {
Object obj = createInstance(params);
if (type.isInstance(obj)) {
return (F) obj;
} else {
throw new ClassCreationException("Cannot cast " + classname
+ " into " + type.get... | java | @SuppressWarnings("unchecked")
public <E,F extends E> F createInstance(Class<E> type, Object... params) {
Object obj = createInstance(params);
if (type.isInstance(obj)) {
return (F) obj;
} else {
throw new ClassCreationException("Cannot cast " + classname
+ " into " + type.get... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"E",
",",
"F",
"extends",
"E",
">",
"F",
"createInstance",
"(",
"Class",
"<",
"E",
">",
"type",
",",
"Object",
"...",
"params",
")",
"{",
"Object",
"obj",
"=",
"createInstance",
"(",
"p... | Creates an instance of the class, forcing a cast to a certain type and
given an array of objects as constructor parameters NOTE: the resulting
instance will [unlike java] invoke the most narrow constructor rather
than the one which matches the signature passed to this function
@param <E>
The type of the object returne... | [
"Creates",
"an",
"instance",
"of",
"the",
"class",
"forcing",
"a",
"cast",
"to",
"a",
"certain",
"type",
"and",
"given",
"an",
"array",
"of",
"objects",
"as",
"constructor",
"parameters",
"NOTE",
":",
"the",
"resulting",
"instance",
"will",
"[",
"unlike",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/MetaClass.java#L388-L397 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Single.java | Single.concatEager | @BackpressureSupport(BackpressureKind.FULL)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> concatEager(Publisher<? extends SingleSource<? extends T>> sources) {
return Flowable.fromPublisher(sources).concatMapEager(SingleInternalHelper.<T>toFlowable());
... | java | @BackpressureSupport(BackpressureKind.FULL)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> concatEager(Publisher<? extends SingleSource<? extends T>> sources) {
return Flowable.fromPublisher(sources).concatMapEager(SingleInternalHelper.<T>toFlowable());
... | [
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"static",
"<",
"T",
">",
"Flowable",
"<",
"T",
">",
"concatEager",
"(",
"Publisher",
"... | Concatenates a Publisher sequence of SingleSources eagerly into a single stream of values.
<p>
<img width="640" height="307" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.concatEager.p.png" alt="">
<p>
Eager concatenation means that once a subscriber subscribes, this operator subscribes t... | [
"Concatenates",
"a",
"Publisher",
"sequence",
"of",
"SingleSources",
"eagerly",
"into",
"a",
"single",
"stream",
"of",
"values",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"307",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Single.java#L434-L439 |
samskivert/samskivert | src/main/java/com/samskivert/swing/util/TaskMaster.java | TaskMaster.invokeMethodTask | public static void invokeMethodTask (String name, Object source, TaskObserver observer)
{
// create a method task instance to invoke the named method and
// then run that through the normal task invocation mechanism
invokeTask(name, new MethodTask(name, source), observer);
} | java | public static void invokeMethodTask (String name, Object source, TaskObserver observer)
{
// create a method task instance to invoke the named method and
// then run that through the normal task invocation mechanism
invokeTask(name, new MethodTask(name, source), observer);
} | [
"public",
"static",
"void",
"invokeMethodTask",
"(",
"String",
"name",
",",
"Object",
"source",
",",
"TaskObserver",
"observer",
")",
"{",
"// create a method task instance to invoke the named method and",
"// then run that through the normal task invocation mechanism",
"invokeTask... | Invokes the method with the specified name on the supplied source
object as if it were a task. The observer is notified when the
method has completed and returned its result or if it fails. The
named method must have a signature the same as the
<code>invoke</code> method of the <code>Task</code> interface.
Aborting tas... | [
"Invokes",
"the",
"method",
"with",
"the",
"specified",
"name",
"on",
"the",
"supplied",
"source",
"object",
"as",
"if",
"it",
"were",
"a",
"task",
".",
"The",
"observer",
"is",
"notified",
"when",
"the",
"method",
"has",
"completed",
"and",
"returned",
"i... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/TaskMaster.java#L52-L57 |
JodaOrg/joda-time | src/main/java/org/joda/time/DateTimeZone.java | DateTimeZone.adjustOffset | public long adjustOffset(long instant, boolean earlierOrLater) {
// a bit messy, but will work in all non-pathological cases
// evaluate 3 hours before and after to work out if anything is happening
long instantBefore = instant - 3 * DateTimeConstants.MILLIS_PER_HOUR;
long insta... | java | public long adjustOffset(long instant, boolean earlierOrLater) {
// a bit messy, but will work in all non-pathological cases
// evaluate 3 hours before and after to work out if anything is happening
long instantBefore = instant - 3 * DateTimeConstants.MILLIS_PER_HOUR;
long insta... | [
"public",
"long",
"adjustOffset",
"(",
"long",
"instant",
",",
"boolean",
"earlierOrLater",
")",
"{",
"// a bit messy, but will work in all non-pathological cases",
"// evaluate 3 hours before and after to work out if anything is happening",
"long",
"instantBefore",
"=",
"instant",
... | Adjusts the offset to be the earlier or later one during an overlap.
@param instant the instant to adjust
@param earlierOrLater false for earlier, true for later
@return the adjusted instant millis | [
"Adjusts",
"the",
"offset",
"to",
"be",
"the",
"earlier",
"or",
"later",
"one",
"during",
"an",
"overlap",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L1195-L1225 |
amaembo/streamex | src/main/java/one/util/streamex/EntryStream.java | EntryStream.toCustomMap | public <M extends Map<K, V>> M toCustomMap(BinaryOperator<V> mergeFunction, Supplier<M> mapSupplier) {
Function<Entry<K, V>, K> keyMapper = Entry::getKey;
Function<Entry<K, V>, V> valueMapper = Entry::getValue;
return collect(Collectors.toMap(keyMapper, valueMapper, mergeFunction, mapSupplier... | java | public <M extends Map<K, V>> M toCustomMap(BinaryOperator<V> mergeFunction, Supplier<M> mapSupplier) {
Function<Entry<K, V>, K> keyMapper = Entry::getKey;
Function<Entry<K, V>, V> valueMapper = Entry::getValue;
return collect(Collectors.toMap(keyMapper, valueMapper, mergeFunction, mapSupplier... | [
"public",
"<",
"M",
"extends",
"Map",
"<",
"K",
",",
"V",
">",
">",
"M",
"toCustomMap",
"(",
"BinaryOperator",
"<",
"V",
">",
"mergeFunction",
",",
"Supplier",
"<",
"M",
">",
"mapSupplier",
")",
"{",
"Function",
"<",
"Entry",
"<",
"K",
",",
"V",
">... | Returns a {@link Map} containing the elements of this stream. The
{@code Map} is created by a provided supplier function.
<p>
If the mapped keys contains duplicates (according to
{@link Object#equals(Object)}), the value mapping function is applied to
each equal element, and the results are merged using the provided m... | [
"Returns",
"a",
"{",
"@link",
"Map",
"}",
"containing",
"the",
"elements",
"of",
"this",
"stream",
".",
"The",
"{",
"@code",
"Map",
"}",
"is",
"created",
"by",
"a",
"provided",
"supplier",
"function",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/EntryStream.java#L1270-L1274 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionUtils.java | ExtensionUtils.importProperty | public static <T> T importProperty(MutableExtension extension, String propertySuffix)
{
return extension.removeProperty(Extension.IKEYPREFIX + propertySuffix);
} | java | public static <T> T importProperty(MutableExtension extension, String propertySuffix)
{
return extension.removeProperty(Extension.IKEYPREFIX + propertySuffix);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"importProperty",
"(",
"MutableExtension",
"extension",
",",
"String",
"propertySuffix",
")",
"{",
"return",
"extension",
".",
"removeProperty",
"(",
"Extension",
".",
"IKEYPREFIX",
"+",
"propertySuffix",
")",
";",
"}"
] | Delete and return the value of the passed special property.
@param <T> type of the property value
@param extension the extension from which to extract custom property
@param propertySuffix the property suffix
@return the value
@ @since 8.3M1 | [
"Delete",
"and",
"return",
"the",
"value",
"of",
"the",
"passed",
"special",
"property",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionUtils.java#L162-L165 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.getFeatureShape | public FeatureShape getFeatureShape(String database, String table, long featureId) {
Map<Long, FeatureShape> featureIds = getFeatureIds(database, table);
FeatureShape featureShape = getFeatureShape(featureIds, featureId);
return featureShape;
} | java | public FeatureShape getFeatureShape(String database, String table, long featureId) {
Map<Long, FeatureShape> featureIds = getFeatureIds(database, table);
FeatureShape featureShape = getFeatureShape(featureIds, featureId);
return featureShape;
} | [
"public",
"FeatureShape",
"getFeatureShape",
"(",
"String",
"database",
",",
"String",
"table",
",",
"long",
"featureId",
")",
"{",
"Map",
"<",
"Long",
",",
"FeatureShape",
">",
"featureIds",
"=",
"getFeatureIds",
"(",
"database",
",",
"table",
")",
";",
"Fe... | Get the feature shape for the database, table, and feature id
@param database GeoPackage database
@param table table name
@param featureId feature id
@return feature shape
@since 3.2.0 | [
"Get",
"the",
"feature",
"shape",
"for",
"the",
"database",
"table",
"and",
"feature",
"id"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L136-L140 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworksInner.java | VirtualNetworksInner.updateTagsAsync | public Observable<VirtualNetworkInner> updateTagsAsync(String resourceGroupName, String virtualNetworkName, Map<String, String> tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).map(new Func1<ServiceResponse<VirtualNetworkInner>, VirtualNetworkInner>() {
... | java | public Observable<VirtualNetworkInner> updateTagsAsync(String resourceGroupName, String virtualNetworkName, Map<String, String> tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName, tags).map(new Func1<ServiceResponse<VirtualNetworkInner>, VirtualNetworkInner>() {
... | [
"public",
"Observable",
"<",
"VirtualNetworkInner",
">",
"updateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
... | Updates a virtual network tags.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@param tags Resource tags.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Updates",
"a",
"virtual",
"network",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworksInner.java#L720-L727 |
drewnoakes/metadata-extractor | Source/com/drew/metadata/Age.java | Age.fromPanasonicString | @Nullable
public static Age fromPanasonicString(@NotNull String s)
{
if (s.length() != 19 || s.startsWith("9999:99:99"))
return null;
try {
int years = Integer.parseInt(s.substring(0, 4));
int months = Integer.parseInt(s.substring(5, 7));
int days... | java | @Nullable
public static Age fromPanasonicString(@NotNull String s)
{
if (s.length() != 19 || s.startsWith("9999:99:99"))
return null;
try {
int years = Integer.parseInt(s.substring(0, 4));
int months = Integer.parseInt(s.substring(5, 7));
int days... | [
"@",
"Nullable",
"public",
"static",
"Age",
"fromPanasonicString",
"(",
"@",
"NotNull",
"String",
"s",
")",
"{",
"if",
"(",
"s",
".",
"length",
"(",
")",
"!=",
"19",
"||",
"s",
".",
"startsWith",
"(",
"\"9999:99:99\"",
")",
")",
"return",
"null",
";",
... | Parses an age object from the string format used by Panasonic cameras:
<code>0031:07:15 00:00:00</code>
@param s The String in format <code>0031:07:15 00:00:00</code>.
@return The parsed Age object, or null if the value could not be parsed | [
"Parses",
"an",
"age",
"object",
"from",
"the",
"string",
"format",
"used",
"by",
"Panasonic",
"cameras",
":",
"<code",
">",
"0031",
":",
"07",
":",
"15",
"00",
":",
"00",
":",
"00<",
"/",
"code",
">"
] | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/metadata/Age.java#L50-L70 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/MetadataFinder.java | MetadataFinder.getFullTrackList | List<Message> getFullTrackList(final CdjStatus.TrackSourceSlot slot, final Client client, final int sortOrder)
throws IOException, InterruptedException, TimeoutException {
// Send the metadata menu request
if (client.tryLockingForMenuOperations(MENU_TIMEOUT, TimeUnit.SECONDS)) {
... | java | List<Message> getFullTrackList(final CdjStatus.TrackSourceSlot slot, final Client client, final int sortOrder)
throws IOException, InterruptedException, TimeoutException {
// Send the metadata menu request
if (client.tryLockingForMenuOperations(MENU_TIMEOUT, TimeUnit.SECONDS)) {
... | [
"List",
"<",
"Message",
">",
"getFullTrackList",
"(",
"final",
"CdjStatus",
".",
"TrackSourceSlot",
"slot",
",",
"final",
"Client",
"client",
",",
"final",
"int",
"sortOrder",
")",
"throws",
"IOException",
",",
"InterruptedException",
",",
"TimeoutException",
"{",... | Request the list of all tracks in the specified slot, given a dbserver connection to a player that has already
been set up.
@param slot identifies the media slot we are querying
@param client the dbserver client that is communicating with the appropriate player
@return the retrieved track list entry items
@throws IO... | [
"Request",
"the",
"list",
"of",
"all",
"tracks",
"in",
"the",
"specified",
"slot",
"given",
"a",
"dbserver",
"connection",
"to",
"a",
"player",
"that",
"has",
"already",
"been",
"set",
"up",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/MetadataFinder.java#L212-L233 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebSiteManagementClientImpl.java | WebSiteManagementClientImpl.validateAsync | public Observable<ValidateResponseInner> validateAsync(String resourceGroupName, ValidateRequest validateRequest) {
return validateWithServiceResponseAsync(resourceGroupName, validateRequest).map(new Func1<ServiceResponse<ValidateResponseInner>, ValidateResponseInner>() {
@Override
publi... | java | public Observable<ValidateResponseInner> validateAsync(String resourceGroupName, ValidateRequest validateRequest) {
return validateWithServiceResponseAsync(resourceGroupName, validateRequest).map(new Func1<ServiceResponse<ValidateResponseInner>, ValidateResponseInner>() {
@Override
publi... | [
"public",
"Observable",
"<",
"ValidateResponseInner",
">",
"validateAsync",
"(",
"String",
"resourceGroupName",
",",
"ValidateRequest",
"validateRequest",
")",
"{",
"return",
"validateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"validateRequest",
")",
".",
"... | Validate if a resource can be created.
Validate if a resource can be created.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param validateRequest Request with the resources to validate.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observabl... | [
"Validate",
"if",
"a",
"resource",
"can",
"be",
"created",
".",
"Validate",
"if",
"a",
"resource",
"can",
"be",
"created",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebSiteManagementClientImpl.java#L2267-L2274 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.getDateLastVisitedBy | public long getDateLastVisitedBy(CmsRequestContext context, String poolName, CmsUser user, CmsResource resource)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
long result = 0;
try {
result = m_driverManager.getDateLastVisitedBy(dbc, poolName,... | java | public long getDateLastVisitedBy(CmsRequestContext context, String poolName, CmsUser user, CmsResource resource)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
long result = 0;
try {
result = m_driverManager.getDateLastVisitedBy(dbc, poolName,... | [
"public",
"long",
"getDateLastVisitedBy",
"(",
"CmsRequestContext",
"context",
",",
"String",
"poolName",
",",
"CmsUser",
"user",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",... | Returns the date when the resource was last visited by the user.<p>
@param context the request context
@param poolName the name of the database pool to use
@param user the user to check the date
@param resource the resource to check the date
@return the date when the resource was last visited by the user
@throws Cms... | [
"Returns",
"the",
"date",
"when",
"the",
"resource",
"was",
"last",
"visited",
"by",
"the",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L2136-L2155 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.