repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
tvbarthel/Cheerleader | library/src/main/java/fr/tvbarthel/cheerleader/library/offline/OfflinerQueryHandler.java | OfflinerQueryHandler.put | public void put(String url, String result) {
"""
Save a result for offline access.
@param url key.
@param result value.
"""
if (TextUtils.isEmpty(url)) {
return;
}
ContentValues contentValues = new ContentValues();
contentValues.put(OfflinerDBHelper.REQUEST_R... | java | public void put(String url, String result) {
if (TextUtils.isEmpty(url)) {
return;
}
ContentValues contentValues = new ContentValues();
contentValues.put(OfflinerDBHelper.REQUEST_RESULT, result);
contentValues.put(OfflinerDBHelper.REQUEST_URL, url);
contentVa... | [
"public",
"void",
"put",
"(",
"String",
"url",
",",
"String",
"result",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"url",
")",
")",
"{",
"return",
";",
"}",
"ContentValues",
"contentValues",
"=",
"new",
"ContentValues",
"(",
")",
";",
"cont... | Save a result for offline access.
@param url key.
@param result value. | [
"Save",
"a",
"result",
"for",
"offline",
"access",
"."
] | train | https://github.com/tvbarthel/Cheerleader/blob/f61527e4cc44fcd0ed2e1e98aca285f8c236f24e/library/src/main/java/fr/tvbarthel/cheerleader/library/offline/OfflinerQueryHandler.java#L146-L165 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/concurrent/TimeUnit.java | TimeUnit.x | static long x(long d, long m, long over) {
"""
Scale d by m, checking for overflow.
This has a short name to make above code more readable.
"""
if (d > over) return Long.MAX_VALUE;
if (d < -over) return Long.MIN_VALUE;
return d * m;
} | java | static long x(long d, long m, long over) {
if (d > over) return Long.MAX_VALUE;
if (d < -over) return Long.MIN_VALUE;
return d * m;
} | [
"static",
"long",
"x",
"(",
"long",
"d",
",",
"long",
"m",
",",
"long",
"over",
")",
"{",
"if",
"(",
"d",
">",
"over",
")",
"return",
"Long",
".",
"MAX_VALUE",
";",
"if",
"(",
"d",
"<",
"-",
"over",
")",
"return",
"Long",
".",
"MIN_VALUE",
";",... | Scale d by m, checking for overflow.
This has a short name to make above code more readable. | [
"Scale",
"d",
"by",
"m",
"checking",
"for",
"overflow",
".",
"This",
"has",
"a",
"short",
"name",
"to",
"make",
"above",
"code",
"more",
"readable",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/concurrent/TimeUnit.java#L160-L164 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_cpanel_new_GET | public ArrayList<String> license_cpanel_new_GET(String ip, OvhLicenseTypeEnum serviceType, OvhOrderableCpanelVersionEnum version) throws IOException {
"""
Get allowed durations for 'new' option
REST: GET /order/license/cpanel/new
@param serviceType [required] # DEPRECATED # The kind of service on which this li... | java | public ArrayList<String> license_cpanel_new_GET(String ip, OvhLicenseTypeEnum serviceType, OvhOrderableCpanelVersionEnum version) throws IOException {
String qPath = "/order/license/cpanel/new";
StringBuilder sb = path(qPath);
query(sb, "ip", ip);
query(sb, "serviceType", serviceType);
query(sb, "version", ve... | [
"public",
"ArrayList",
"<",
"String",
">",
"license_cpanel_new_GET",
"(",
"String",
"ip",
",",
"OvhLicenseTypeEnum",
"serviceType",
",",
"OvhOrderableCpanelVersionEnum",
"version",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/license/cpanel/new\"",... | Get allowed durations for 'new' option
REST: GET /order/license/cpanel/new
@param serviceType [required] # DEPRECATED # The kind of service on which this license will be used # Will not be used, keeped only for compatibility #
@param ip [required] Ip on which this license would be installed
@param version [required] T... | [
"Get",
"allowed",
"durations",
"for",
"new",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1483-L1491 |
rythmengine/rythmengine | src/main/java/org/rythmengine/exception/CompileException.java | CompileException.compilerException | public static CompilerException compilerException(String className, int line, String message) {
"""
create a compiler exception for the given className, line number and message
@param className
@param line
@param message
@return the CompilerException
"""
CompilerException e = new CompilerException(... | java | public static CompilerException compilerException(String className, int line, String message) {
CompilerException e = new CompilerException();
e.javaLineNumber = line;
e.message = ExpressionParser.reversePositionPlaceHolder(message);
e.className = className;
return e;
} | [
"public",
"static",
"CompilerException",
"compilerException",
"(",
"String",
"className",
",",
"int",
"line",
",",
"String",
"message",
")",
"{",
"CompilerException",
"e",
"=",
"new",
"CompilerException",
"(",
")",
";",
"e",
".",
"javaLineNumber",
"=",
"line",
... | create a compiler exception for the given className, line number and message
@param className
@param line
@param message
@return the CompilerException | [
"create",
"a",
"compiler",
"exception",
"for",
"the",
"given",
"className",
"line",
"number",
"and",
"message"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/exception/CompileException.java#L43-L49 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/MembershipTypeHandlerImpl.java | MembershipTypeHandlerImpl.preSave | private void preSave(MembershipType type, boolean isNew) throws Exception {
"""
Notifying listeners before membership type creation.
@param type
the membership which is used in create operation
@param isNew
true, if we have a deal with new membership type, otherwise it is false
which mean update operation i... | java | private void preSave(MembershipType type, boolean isNew) throws Exception
{
for (MembershipTypeEventListener listener : listeners)
{
listener.preSave(type, isNew);
}
} | [
"private",
"void",
"preSave",
"(",
"MembershipType",
"type",
",",
"boolean",
"isNew",
")",
"throws",
"Exception",
"{",
"for",
"(",
"MembershipTypeEventListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"preSave",
"(",
"type",
",",
"isNew",
")"... | Notifying listeners before membership type creation.
@param type
the membership which is used in create operation
@param isNew
true, if we have a deal with new membership type, otherwise it is false
which mean update operation is in progress
@throws Exception
if any listener failed to handle the event | [
"Notifying",
"listeners",
"before",
"membership",
"type",
"creation",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/MembershipTypeHandlerImpl.java#L465-L471 |
square/phrase | src/main/java/com/squareup/phrase/Phrase.java | Phrase.put | public Phrase put(String key, CharSequence value) {
"""
Replaces the given key with a non-null value. You may reuse Phrase instances and replace
keys with new values.
@throws IllegalArgumentException if the key is not in the pattern.
"""
if (!keys.contains(key)) {
throw new IllegalArgumentExcepti... | java | public Phrase put(String key, CharSequence value) {
if (!keys.contains(key)) {
throw new IllegalArgumentException("Invalid key: " + key);
}
if (value == null) {
throw new IllegalArgumentException("Null value for '" + key + "'");
}
keysToValues.put(key, value);
// Invalidate the cach... | [
"public",
"Phrase",
"put",
"(",
"String",
"key",
",",
"CharSequence",
"value",
")",
"{",
"if",
"(",
"!",
"keys",
".",
"contains",
"(",
"key",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid key: \"",
"+",
"key",
")",
";",
"}",
... | Replaces the given key with a non-null value. You may reuse Phrase instances and replace
keys with new values.
@throws IllegalArgumentException if the key is not in the pattern. | [
"Replaces",
"the",
"given",
"key",
"with",
"a",
"non",
"-",
"null",
"value",
".",
"You",
"may",
"reuse",
"Phrase",
"instances",
"and",
"replace",
"keys",
"with",
"new",
"values",
"."
] | train | https://github.com/square/phrase/blob/d91f18e80790832db11b811c462f8e5cd492d97e/src/main/java/com/squareup/phrase/Phrase.java#L151-L163 |
asciidoctor/asciidoctor-maven-plugin | src/main/java/org/asciidoctor/maven/AsciidoctorHelper.java | AsciidoctorHelper.addAttributes | public static void addAttributes(final Map<String, Object> attributes, AttributesBuilder attributesBuilder) {
"""
Adds attributes from a {@link Map} into a {@link AttributesBuilder} taking care of Maven's XML parsing special
cases like toggles, nulls, etc.
@param attributes map of Asciidoctor attributes... | java | public static void addAttributes(final Map<String, Object> attributes, AttributesBuilder attributesBuilder) {
// TODO Figure out how to reliably set other values (like boolean values, dates, times, etc)
for (Map.Entry<String, Object> attributeEntry : attributes.entrySet()) {
addAttribute(att... | [
"public",
"static",
"void",
"addAttributes",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
",",
"AttributesBuilder",
"attributesBuilder",
")",
"{",
"// TODO Figure out how to reliably set other values (like boolean values, dates, times, etc)",
"for",
"... | Adds attributes from a {@link Map} into a {@link AttributesBuilder} taking care of Maven's XML parsing special
cases like toggles, nulls, etc.
@param attributes map of Asciidoctor attributes
@param attributesBuilder AsciidoctorJ AttributesBuilder | [
"Adds",
"attributes",
"from",
"a",
"{",
"@link",
"Map",
"}",
"into",
"a",
"{",
"@link",
"AttributesBuilder",
"}",
"taking",
"care",
"of",
"Maven",
"s",
"XML",
"parsing",
"special",
"cases",
"like",
"toggles",
"nulls",
"etc",
"."
] | train | https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/880938df1c638aaabedb3c944cd3e0ea1844109e/src/main/java/org/asciidoctor/maven/AsciidoctorHelper.java#L32-L37 |
FasterXML/jackson-jr | jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/JSON.java | JSON.listFrom | public List<Object> listFrom(Object source) throws IOException, JSONObjectException {
"""
/*
********************************************************************
/* API: reading JSON as Simple Objects
********************************************************************
"""
if (source instanceof Json... | java | public List<Object> listFrom(Object source) throws IOException, JSONObjectException
{
if (source instanceof JsonParser) {
// note: no call to _config(), should come pre-configured
JsonParser p = _initForReading((JsonParser) source);
List<Object> result = _readerForOperati... | [
"public",
"List",
"<",
"Object",
">",
"listFrom",
"(",
"Object",
"source",
")",
"throws",
"IOException",
",",
"JSONObjectException",
"{",
"if",
"(",
"source",
"instanceof",
"JsonParser",
")",
"{",
"// note: no call to _config(), should come pre-configured",
"JsonParser"... | /*
********************************************************************
/* API: reading JSON as Simple Objects
******************************************************************** | [
"/",
"*",
"********************************************************************",
"/",
"*",
"API",
":",
"reading",
"JSON",
"as",
"Simple",
"Objects",
"********************************************************************"
] | train | https://github.com/FasterXML/jackson-jr/blob/62ca7a82bd90a9be77028e0b62364307d7532837/jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/JSON.java#L765-L786 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.listSiteAnalysesWithServiceResponseAsync | public Observable<ServiceResponse<Page<AnalysisDefinitionInner>>> listSiteAnalysesWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) {
"""
Get Site Analyses.
Get Site Analyses.
@param resourceGroupName Name of the resource group to which the resourc... | java | public Observable<ServiceResponse<Page<AnalysisDefinitionInner>>> listSiteAnalysesWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) {
return listSiteAnalysesSinglePageAsync(resourceGroupName, siteName, diagnosticCategory)
.concatMap(new ... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"AnalysisDefinitionInner",
">",
">",
">",
"listSiteAnalysesWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"siteName",
",",
"final",
"String",
"diagnosticCa... | Get Site Analyses.
Get Site Analyses.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Diagnostic Category
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<AnalysisD... | [
"Get",
"Site",
"Analyses",
".",
"Get",
"Site",
"Analyses",
"."
] | 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/DiagnosticsInner.java#L460-L472 |
osmdroid/osmdroid | OSMMapTilePackager/src/main/java/org/osmdroid/mtp/OSMMapTilePackager.java | OSMMapTilePackager.run | private static void run(final String pServerURL, final String pDestinationFile, final String pTempFolder, final int pThreadCount, final String pFileAppendix, final int pMinZoom, final int pMaxZoom, final double pNorth, final double pSouth, final double pEast, final double pWest) {
"""
this starts executing the dow... | java | private static void run(final String pServerURL, final String pDestinationFile, final String pTempFolder, final int pThreadCount, final String pFileAppendix, final int pMinZoom, final int pMaxZoom, final double pNorth, final double pSouth, final double pEast, final double pWest) {
new File(pTempFolder).mkdir... | [
"private",
"static",
"void",
"run",
"(",
"final",
"String",
"pServerURL",
",",
"final",
"String",
"pDestinationFile",
",",
"final",
"String",
"pTempFolder",
",",
"final",
"int",
"pThreadCount",
",",
"final",
"String",
"pFileAppendix",
",",
"final",
"int",
"pMinZ... | this starts executing the download and packaging
@param pServerURL
@param pDestinationFile
@param pTempFolder
@param pThreadCount
@param pFileAppendix
@param pMinZoom
@param pMaxZoom
@param pNorth
@param pSouth
@param pEast
@param pWest | [
"this",
"starts",
"executing",
"the",
"download",
"and",
"packaging"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OSMMapTilePackager/src/main/java/org/osmdroid/mtp/OSMMapTilePackager.java#L166-L177 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/TreeUtil.java | TreeUtil.getRoot | public static WComponent getRoot(final UIContext uic, final WComponent comp) {
"""
Retrieves the root component of a WComponent hierarchy.
@param uic the context to retrieve the root component for.
@param comp a component in the tree.
@return the root of the tree.
"""
UIContextHolder.pushContext(uic);
... | java | public static WComponent getRoot(final UIContext uic, final WComponent comp) {
UIContextHolder.pushContext(uic);
try {
return WebUtilities.getTop(comp);
} finally {
UIContextHolder.popContext();
}
} | [
"public",
"static",
"WComponent",
"getRoot",
"(",
"final",
"UIContext",
"uic",
",",
"final",
"WComponent",
"comp",
")",
"{",
"UIContextHolder",
".",
"pushContext",
"(",
"uic",
")",
";",
"try",
"{",
"return",
"WebUtilities",
".",
"getTop",
"(",
"comp",
")",
... | Retrieves the root component of a WComponent hierarchy.
@param uic the context to retrieve the root component for.
@param comp a component in the tree.
@return the root of the tree. | [
"Retrieves",
"the",
"root",
"component",
"of",
"a",
"WComponent",
"hierarchy",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/TreeUtil.java#L72-L80 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/excel/PoiWorkSheet.java | PoiWorkSheet.createTitleCell | public Cell createTitleCell(String str, double width) {
"""
Create title cell cell.
@param str the str
@param width the width
@return the cell
"""
int cellCnt = this.getCellCnt();
Cell cell = this.getLastRow().createCell(cellCnt);
cell.setCellValue(str);
cell.setCellTyp... | java | public Cell createTitleCell(String str, double width) {
int cellCnt = this.getCellCnt();
Cell cell = this.getLastRow().createCell(cellCnt);
cell.setCellValue(str);
cell.setCellType(CellType.STRING);
cell.setCellStyle(this.style.getStringCs());
sheet.setColumnWidth(cell... | [
"public",
"Cell",
"createTitleCell",
"(",
"String",
"str",
",",
"double",
"width",
")",
"{",
"int",
"cellCnt",
"=",
"this",
".",
"getCellCnt",
"(",
")",
";",
"Cell",
"cell",
"=",
"this",
".",
"getLastRow",
"(",
")",
".",
"createCell",
"(",
"cellCnt",
"... | Create title cell cell.
@param str the str
@param width the width
@return the cell | [
"Create",
"title",
"cell",
"cell",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/excel/PoiWorkSheet.java#L134-L146 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/security/CredentialReference.java | CredentialReference.getAttributeBuilder | public static ObjectTypeAttributeDefinition.Builder getAttributeBuilder(String name, String xmlName,
boolean allowNull, boolean referenceCredentialStore) {
"""
Get an attribute builder for a credential-reference attribute with the specifie... | java | public static ObjectTypeAttributeDefinition.Builder getAttributeBuilder(String name, String xmlName,
boolean allowNull, boolean referenceCredentialStore) {
AttributeDefinition csAttr = referenceCredentialStore ? credentialStoreAttribute... | [
"public",
"static",
"ObjectTypeAttributeDefinition",
".",
"Builder",
"getAttributeBuilder",
"(",
"String",
"name",
",",
"String",
"xmlName",
",",
"boolean",
"allowNull",
",",
"boolean",
"referenceCredentialStore",
")",
"{",
"AttributeDefinition",
"csAttr",
"=",
"referen... | Get an attribute builder for a credential-reference attribute with the specified characteristics, optionally configured to
{@link org.jboss.as.controller.AbstractAttributeDefinitionBuilder#setCapabilityReference(String) register a requirement}
for a {@link #CREDENTIAL_STORE_CAPABILITY credential store capability}.
If a... | [
"Get",
"an",
"attribute",
"builder",
"for",
"a",
"credential",
"-",
"reference",
"attribute",
"with",
"the",
"specified",
"characteristics",
"optionally",
"configured",
"to",
"{",
"@link",
"org",
".",
"jboss",
".",
"as",
".",
"controller",
".",
"AbstractAttribut... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/security/CredentialReference.java#L219-L223 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RunnersApi.java | RunnersApi.enableRunner | public Runner enableRunner(Object projectIdOrPath, Integer runnerId) throws GitLabApiException {
"""
Enable an available specific runner in the project.
<pre><code>GitLab Endpoint: POST /projects/:id/runners</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Proje... | java | public Runner enableRunner(Object projectIdOrPath, Integer runnerId) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm().withParam("runner_id", runnerId, true);
Response response = post(Response.Status.CREATED, formData.asMap(),
"projects", getProjectIdOrPath(project... | [
"public",
"Runner",
"enableRunner",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"runnerId",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\"runner_id\"",
",",
"runnerId",
... | Enable an available specific runner in the project.
<pre><code>GitLab Endpoint: POST /projects/:id/runners</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param runnerId The ID of a runner
@return Runner instance of the Runner enabled
@throws GitLabAp... | [
"Enable",
"an",
"available",
"specific",
"runner",
"in",
"the",
"project",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RunnersApi.java#L459-L464 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Block.java | Block.createNextBlock | @VisibleForTesting
public Block createNextBlock(Address to, long version, long time, int blockHeight) {
"""
Returns a solved block that builds on top of this one. This exists for unit tests.
"""
return createNextBlock(to, version, null, time, pubkeyForTesting, FIFTY_COINS, blockHeight);
} | java | @VisibleForTesting
public Block createNextBlock(Address to, long version, long time, int blockHeight) {
return createNextBlock(to, version, null, time, pubkeyForTesting, FIFTY_COINS, blockHeight);
} | [
"@",
"VisibleForTesting",
"public",
"Block",
"createNextBlock",
"(",
"Address",
"to",
",",
"long",
"version",
",",
"long",
"time",
",",
"int",
"blockHeight",
")",
"{",
"return",
"createNextBlock",
"(",
"to",
",",
"version",
",",
"null",
",",
"time",
",",
"... | Returns a solved block that builds on top of this one. This exists for unit tests. | [
"Returns",
"a",
"solved",
"block",
"that",
"builds",
"on",
"top",
"of",
"this",
"one",
".",
"This",
"exists",
"for",
"unit",
"tests",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Block.java#L945-L948 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/messageresolver/StandardMessageResolver.java | StandardMessageResolver.addDefaultMessage | public final void addDefaultMessage(final String key, final String value) {
"""
<p>
Adds a new message to the set of default messages.
</p>
@param key the message key
@param value the message value (text)
"""
Validate.notNull(key, "Key for default message cannot be null");
Validate.notNul... | java | public final void addDefaultMessage(final String key, final String value) {
Validate.notNull(key, "Key for default message cannot be null");
Validate.notNull(value, "Value for default message cannot be null");
this.defaultMessages.put(key, value);
} | [
"public",
"final",
"void",
"addDefaultMessage",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"Validate",
".",
"notNull",
"(",
"key",
",",
"\"Key for default message cannot be null\"",
")",
";",
"Validate",
".",
"notNull",
"(",
"value... | <p>
Adds a new message to the set of default messages.
</p>
@param key the message key
@param value the message value (text) | [
"<p",
">",
"Adds",
"a",
"new",
"message",
"to",
"the",
"set",
"of",
"default",
"messages",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/messageresolver/StandardMessageResolver.java#L203-L207 |
rometools/rome | rome/src/main/java/com/rometools/rome/io/SyndFeedOutput.java | SyndFeedOutput.output | public void output(final SyndFeed feed, final File file) throws IOException, FeedException {
"""
Creates a File containing with the XML representation for the given SyndFeedImpl.
<p>
If the feed encoding is not NULL, it will be used in the XML prolog encoding attribute. The
platform default charset encoding is ... | java | public void output(final SyndFeed feed, final File file) throws IOException, FeedException {
feedOutput.output(feed.createWireFeed(), file);
} | [
"public",
"void",
"output",
"(",
"final",
"SyndFeed",
"feed",
",",
"final",
"File",
"file",
")",
"throws",
"IOException",
",",
"FeedException",
"{",
"feedOutput",
".",
"output",
"(",
"feed",
".",
"createWireFeed",
"(",
")",
",",
"file",
")",
";",
"}"
] | Creates a File containing with the XML representation for the given SyndFeedImpl.
<p>
If the feed encoding is not NULL, it will be used in the XML prolog encoding attribute. The
platform default charset encoding is used to write the feed to the file. It is the
responsibility of the developer to ensure the feed encoding... | [
"Creates",
"a",
"File",
"containing",
"with",
"the",
"XML",
"representation",
"for",
"the",
"given",
"SyndFeedImpl",
".",
"<p",
">",
"If",
"the",
"feed",
"encoding",
"is",
"not",
"NULL",
"it",
"will",
"be",
"used",
"in",
"the",
"XML",
"prolog",
"encoding",... | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/SyndFeedOutput.java#L90-L92 |
tango-controls/JTango | dao/src/main/java/org/tango/utils/ClientIDUtil.java | ClientIDUtil.clientIdentEqual | public static boolean clientIdentEqual(final ClntIdent ident1, final ClntIdent ident2) {
"""
Compare if two {@link ClntIdent} are coming from the same client
@param ident1
The first ident
@param ident2
The second ident
@return
"""
boolean areEqual = true;
if (ident1 == null || ident2 == ... | java | public static boolean clientIdentEqual(final ClntIdent ident1, final ClntIdent ident2) {
boolean areEqual = true;
if (ident1 == null || ident2 == null || ident1.discriminator() == null || ident2.discriminator() == null) {
areEqual = false;
} else if (ident1.discriminator().value() !=... | [
"public",
"static",
"boolean",
"clientIdentEqual",
"(",
"final",
"ClntIdent",
"ident1",
",",
"final",
"ClntIdent",
"ident2",
")",
"{",
"boolean",
"areEqual",
"=",
"true",
";",
"if",
"(",
"ident1",
"==",
"null",
"||",
"ident2",
"==",
"null",
"||",
"ident1",
... | Compare if two {@link ClntIdent} are coming from the same client
@param ident1
The first ident
@param ident2
The second ident
@return | [
"Compare",
"if",
"two",
"{",
"@link",
"ClntIdent",
"}",
"are",
"coming",
"from",
"the",
"same",
"client"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/org/tango/utils/ClientIDUtil.java#L57-L73 |
alkacon/opencms-core | src/org/opencms/search/CmsSearchManager.java | CmsSearchManager.getEventReport | private I_CmsReport getEventReport(CmsEvent event) {
"""
Returns the report in the given event data, if <code>null</code>
a new log report is used.<p>
@param event the event to get the report for
@return the report
"""
I_CmsReport report = null;
if (event.getData() != null) {
... | java | private I_CmsReport getEventReport(CmsEvent event) {
I_CmsReport report = null;
if (event.getData() != null) {
report = (I_CmsReport)event.getData().get(I_CmsEventListener.KEY_REPORT);
}
if (report == null) {
report = new CmsLogReport(Locale.ENGLISH, getClass());... | [
"private",
"I_CmsReport",
"getEventReport",
"(",
"CmsEvent",
"event",
")",
"{",
"I_CmsReport",
"report",
"=",
"null",
";",
"if",
"(",
"event",
".",
"getData",
"(",
")",
"!=",
"null",
")",
"{",
"report",
"=",
"(",
"I_CmsReport",
")",
"event",
".",
"getDat... | Returns the report in the given event data, if <code>null</code>
a new log report is used.<p>
@param event the event to get the report for
@return the report | [
"Returns",
"the",
"report",
"in",
"the",
"given",
"event",
"data",
"if",
"<code",
">",
"null<",
"/",
"code",
">",
"a",
"new",
"log",
"report",
"is",
"used",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchManager.java#L3188-L3198 |
apereo/cas | support/cas-server-support-scim/src/main/java/org/apereo/cas/scim/v1/ScimV1PrincipalAttributeMapper.java | ScimV1PrincipalAttributeMapper.getPrincipalAttributeValue | public String getPrincipalAttributeValue(final Principal p, final String attributeName) {
"""
Gets principal attribute value.
@param p the p
@param attributeName the attribute name
@return the principal attribute value
"""
val attributes = p.getAttributes();
if (attributes.cont... | java | public String getPrincipalAttributeValue(final Principal p, final String attributeName) {
val attributes = p.getAttributes();
if (attributes.containsKey(attributeName)) {
return CollectionUtils.toCollection(attributes.get(attributeName)).iterator().next().toString();
}
return... | [
"public",
"String",
"getPrincipalAttributeValue",
"(",
"final",
"Principal",
"p",
",",
"final",
"String",
"attributeName",
")",
"{",
"val",
"attributes",
"=",
"p",
".",
"getAttributes",
"(",
")",
";",
"if",
"(",
"attributes",
".",
"containsKey",
"(",
"attribut... | Gets principal attribute value.
@param p the p
@param attributeName the attribute name
@return the principal attribute value | [
"Gets",
"principal",
"attribute",
"value",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-scim/src/main/java/org/apereo/cas/scim/v1/ScimV1PrincipalAttributeMapper.java#L28-L34 |
alkacon/opencms-core | src/org/opencms/main/A_CmsAuthorizationHandler.java | A_CmsAuthorizationHandler.registerSession | protected CmsObject registerSession(HttpServletRequest request, CmsObject cms) throws CmsException {
"""
Registers the current session with OpenCms.<p>
@param request the current request
@param cms the cms object to register
@return the updated cms context
@throws CmsException if something goes wrong
... | java | protected CmsObject registerSession(HttpServletRequest request, CmsObject cms) throws CmsException {
if (!cms.getRequestContext().getCurrentUser().isGuestUser()) {
// make sure we have a new session after login for security reasons
HttpSession session = request.getSession(false);
... | [
"protected",
"CmsObject",
"registerSession",
"(",
"HttpServletRequest",
"request",
",",
"CmsObject",
"cms",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"!",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getCurrentUser",
"(",
")",
".",
"isGuestUser",
"(",
... | Registers the current session with OpenCms.<p>
@param request the current request
@param cms the cms object to register
@return the updated cms context
@throws CmsException if something goes wrong | [
"Registers",
"the",
"current",
"session",
"with",
"OpenCms",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/A_CmsAuthorizationHandler.java#L90-L116 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsLock.java | CmsLock.buildLockRequest | public String buildLockRequest(int hiddenTimeout, boolean includeRelated) {
"""
Returns the html code to build the lock request.<p>
@param hiddenTimeout the maximal number of millis the dialog will be hidden
@param includeRelated indicates if the report should include related resources
@return html code
... | java | public String buildLockRequest(int hiddenTimeout, boolean includeRelated) {
StringBuffer html = new StringBuffer(512);
html.append("<script type='text/javascript'><!--\n");
html.append("makeRequest('");
html.append(getJsp().link("/system/workplace/commons/report-locks.jsp"));
ht... | [
"public",
"String",
"buildLockRequest",
"(",
"int",
"hiddenTimeout",
",",
"boolean",
"includeRelated",
")",
"{",
"StringBuffer",
"html",
"=",
"new",
"StringBuffer",
"(",
"512",
")",
";",
"html",
".",
"append",
"(",
"\"<script type='text/javascript'><!--\\n\"",
")",
... | Returns the html code to build the lock request.<p>
@param hiddenTimeout the maximal number of millis the dialog will be hidden
@param includeRelated indicates if the report should include related resources
@return html code | [
"Returns",
"the",
"html",
"code",
"to",
"build",
"the",
"lock",
"request",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsLock.java#L480-L506 |
Netflix/frigga | src/main/java/com/netflix/frigga/NameValidation.java | NameValidation.notEmpty | public static String notEmpty(String value, String variableName) {
"""
Validates if provided value is non-null and non-empty.
@param value the string to validate
@param variableName name of the variable to include in error messages
@return the value parameter if valid, throws an exception otherwise
"""
... | java | public static String notEmpty(String value, String variableName) {
if (value == null) {
throw new NullPointerException("ERROR: Trying to use String with null " + variableName);
}
if (value.isEmpty()) {
throw new IllegalArgumentException("ERROR: Illegal empty string for " ... | [
"public",
"static",
"String",
"notEmpty",
"(",
"String",
"value",
",",
"String",
"variableName",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"ERROR: Trying to use String with null \"",
"+",
"variableName",
"... | Validates if provided value is non-null and non-empty.
@param value the string to validate
@param variableName name of the variable to include in error messages
@return the value parameter if valid, throws an exception otherwise | [
"Validates",
"if",
"provided",
"value",
"is",
"non",
"-",
"null",
"and",
"non",
"-",
"empty",
"."
] | train | https://github.com/Netflix/frigga/blob/38afefd1726116f3431b95fcb96a6af640b99d10/src/main/java/com/netflix/frigga/NameValidation.java#L41-L49 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java | OperationsApi.getUsedSkillsAsyncWithHttpInfo | public ApiResponse<ApiAsyncSuccessResponse> getUsedSkillsAsyncWithHttpInfo(String aioId) throws ApiException {
"""
Get used skills.
Get all [CfgSkill](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgSkill) that are linked to existing [CfgPerson](https://docs.genesys.com/Documentation/PSDK/lat... | java | public ApiResponse<ApiAsyncSuccessResponse> getUsedSkillsAsyncWithHttpInfo(String aioId) throws ApiException {
com.squareup.okhttp.Call call = getUsedSkillsAsyncValidateBeforeCall(aioId, null, null);
Type localVarReturnType = new TypeToken<ApiAsyncSuccessResponse>(){}.getType();
return apiClient... | [
"public",
"ApiResponse",
"<",
"ApiAsyncSuccessResponse",
">",
"getUsedSkillsAsyncWithHttpInfo",
"(",
"String",
"aioId",
")",
"throws",
"ApiException",
"{",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"call",
"=",
"getUsedSkillsAsyncValidateBeforeCall",
"(",
"a... | Get used skills.
Get all [CfgSkill](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgSkill) that are linked to existing [CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson) objects.
@param aioId A unique ID generated on the client (browser) when sending an API req... | [
"Get",
"used",
"skills",
".",
"Get",
"all",
"[",
"CfgSkill",
"]",
"(",
"https",
":",
"//",
"docs",
".",
"genesys",
".",
"com",
"/",
"Documentation",
"/",
"PSDK",
"/",
"latest",
"/",
"ConfigLayerRef",
"/",
"CfgSkill",
")",
"that",
"are",
"linked",
"to",... | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/OperationsApi.java#L499-L503 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.createVariable | public Variable createVariable(Object projectIdOrPath, String key, String value, Boolean isProtected) throws GitLabApiException {
"""
Create a new project variable.
<pre><code>GitLab Endpoint: POST /projects/:id/variables</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integ... | java | public Variable createVariable(Object projectIdOrPath, String key, String value, Boolean isProtected) throws GitLabApiException {
return (createVariable(projectIdOrPath, key, value, isProtected, null));
} | [
"public",
"Variable",
"createVariable",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"key",
",",
"String",
"value",
",",
"Boolean",
"isProtected",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"createVariable",
"(",
"projectIdOrPath",
",",
"key",
",... | Create a new project variable.
<pre><code>GitLab Endpoint: POST /projects/:id/variables</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param key the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9... | [
"Create",
"a",
"new",
"project",
"variable",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L2500-L2502 |
apache/incubator-gobblin | gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/converter/BaseEnvelopeSchemaConverter.java | BaseEnvelopeSchemaConverter.getPayloadBytes | @Deprecated
protected byte[] getPayloadBytes(GenericRecord inputRecord) {
"""
Get payload field and convert to byte array
@param inputRecord the input record which has the payload
@return the byte array of the payload in the input record
@deprecated use {@link #getFieldAsBytes(GenericRecord, String)}
""... | java | @Deprecated
protected byte[] getPayloadBytes(GenericRecord inputRecord) {
try {
return getFieldAsBytes(inputRecord, payloadField);
} catch (Exception e) {
return null;
}
} | [
"@",
"Deprecated",
"protected",
"byte",
"[",
"]",
"getPayloadBytes",
"(",
"GenericRecord",
"inputRecord",
")",
"{",
"try",
"{",
"return",
"getFieldAsBytes",
"(",
"inputRecord",
",",
"payloadField",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"re... | Get payload field and convert to byte array
@param inputRecord the input record which has the payload
@return the byte array of the payload in the input record
@deprecated use {@link #getFieldAsBytes(GenericRecord, String)} | [
"Get",
"payload",
"field",
"and",
"convert",
"to",
"byte",
"array"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/converter/BaseEnvelopeSchemaConverter.java#L117-L124 |
Omertron/api-tvrage | src/main/java/com/omertron/tvrageapi/TVRageApi.java | TVRageApi.getEpisodeInfo | public Episode getEpisodeInfo(String showID, String seasonId, String episodeId) throws TVRageException {
"""
Get the information for a specific episode
@param showID
@param seasonId
@param episodeId
@return
@throws com.omertron.tvrageapi.TVRageException
"""
if (!isValidString(showID) || !isValid... | java | public Episode getEpisodeInfo(String showID, String seasonId, String episodeId) throws TVRageException {
if (!isValidString(showID) || !isValidString(seasonId) || !isValidString(episodeId)) {
return new Episode();
}
StringBuilder tvrageURL = buildURL(API_EPISODE_INFO, showID);
... | [
"public",
"Episode",
"getEpisodeInfo",
"(",
"String",
"showID",
",",
"String",
"seasonId",
",",
"String",
"episodeId",
")",
"throws",
"TVRageException",
"{",
"if",
"(",
"!",
"isValidString",
"(",
"showID",
")",
"||",
"!",
"isValidString",
"(",
"seasonId",
")",... | Get the information for a specific episode
@param showID
@param seasonId
@param episodeId
@return
@throws com.omertron.tvrageapi.TVRageException | [
"Get",
"the",
"information",
"for",
"a",
"specific",
"episode"
] | train | https://github.com/Omertron/api-tvrage/blob/4e805a99de812fabea69d97098f2376be14d51bc/src/main/java/com/omertron/tvrageapi/TVRageApi.java#L87-L98 |
geomajas/geomajas-project-client-gwt2 | impl/src/main/java/org/geomajas/gwt2/client/animation/NavigationAnimationFactory.java | NavigationAnimationFactory.createPanning | public static NavigationAnimation createPanning(MapPresenter mapPresenter, Coordinate target) {
"""
Create a new panning {@link NavigationAnimation}. It will have the map translate to the requested coordinate,
keeping the same resolution.
@param mapPresenter The map onto which you want the panning animation to... | java | public static NavigationAnimation createPanning(MapPresenter mapPresenter, Coordinate target) {
View beginView = mapPresenter.getViewPort().getView();
View endView = new View(target, beginView.getResolution());
return new NavigationAnimationImpl(mapPresenter.getViewPort(), mapPresenter.getEventBus(),
new Line... | [
"public",
"static",
"NavigationAnimation",
"createPanning",
"(",
"MapPresenter",
"mapPresenter",
",",
"Coordinate",
"target",
")",
"{",
"View",
"beginView",
"=",
"mapPresenter",
".",
"getViewPort",
"(",
")",
".",
"getView",
"(",
")",
";",
"View",
"endView",
"=",... | Create a new panning {@link NavigationAnimation}. It will have the map translate to the requested coordinate,
keeping the same resolution.
@param mapPresenter The map onto which you want the panning animation to run.
@param target The target coordinate to arrive at when the animation finishes.
@return The animat... | [
"Create",
"a",
"new",
"panning",
"{",
"@link",
"NavigationAnimation",
"}",
".",
"It",
"will",
"have",
"the",
"map",
"translate",
"to",
"the",
"requested",
"coordinate",
"keeping",
"the",
"same",
"resolution",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/animation/NavigationAnimationFactory.java#L139-L144 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/ShareLinkManager.java | ShareLinkManager.invokeSharingClient | private void invokeSharingClient(final ResolveInfo selectedResolveInfo) {
"""
Invokes a sharing client with a link created by the given json objects.
@param selectedResolveInfo The {@link ResolveInfo} corresponding to the selected sharing client.
"""
isShareInProgress_ = true;
final String c... | java | private void invokeSharingClient(final ResolveInfo selectedResolveInfo) {
isShareInProgress_ = true;
final String channelName = selectedResolveInfo.loadLabel(context_.getPackageManager()).toString();
BranchShortLinkBuilder shortLinkBuilder = builder_.getShortLinkBuilder();
short... | [
"private",
"void",
"invokeSharingClient",
"(",
"final",
"ResolveInfo",
"selectedResolveInfo",
")",
"{",
"isShareInProgress_",
"=",
"true",
";",
"final",
"String",
"channelName",
"=",
"selectedResolveInfo",
".",
"loadLabel",
"(",
"context_",
".",
"getPackageManager",
"... | Invokes a sharing client with a link created by the given json objects.
@param selectedResolveInfo The {@link ResolveInfo} corresponding to the selected sharing client. | [
"Invokes",
"a",
"sharing",
"client",
"with",
"a",
"link",
"created",
"by",
"the",
"given",
"json",
"objects",
"."
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/ShareLinkManager.java#L274-L306 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java | FlowControllerFactory.getPageFlow | public static PageFlowController getPageFlow( Class pageFlowClass,
HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext ) {
"""
Cr... | java | public static PageFlowController getPageFlow( Class pageFlowClass,
HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext )
{
... | [
"public",
"static",
"PageFlowController",
"getPageFlow",
"(",
"Class",
"pageFlowClass",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"ServletContext",
"servletContext",
")",
"{",
"try",
"{",
"FlowControllerFactory",
"factory",
"=",
... | Create a page flow of the given type. The page flow stack (for nesting) will be cleared or pushed, and the new
instance will be stored as the current page flow.
@deprecated Use {@link #createPageFlow(RequestContext, Class)} instead.
@param request the current HttpServletRequest.
@param response the current HttpServle... | [
"Create",
"a",
"page",
"flow",
"of",
"the",
"given",
"type",
".",
"The",
"page",
"flow",
"stack",
"(",
"for",
"nesting",
")",
"will",
"be",
"cleared",
"or",
"pushed",
"and",
"the",
"new",
"instance",
"will",
"be",
"stored",
"as",
"the",
"current",
"pag... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java#L743-L763 |
auth0/java-jwt | lib/src/main/java/com/auth0/jwt/algorithms/CryptoHelper.java | CryptoHelper.verifySignatureFor | boolean verifySignatureFor(String algorithm, PublicKey publicKey, byte[] headerBytes, byte[] payloadBytes, byte[] signatureBytes) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException {
"""
Verify signature for JWT header and payload using a public key.
@param algorithm algorithm name.
@para... | java | boolean verifySignatureFor(String algorithm, PublicKey publicKey, byte[] headerBytes, byte[] payloadBytes, byte[] signatureBytes) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException {
final Signature s = Signature.getInstance(algorithm);
s.initVerify(publicKey);
s.update(hea... | [
"boolean",
"verifySignatureFor",
"(",
"String",
"algorithm",
",",
"PublicKey",
"publicKey",
",",
"byte",
"[",
"]",
"headerBytes",
",",
"byte",
"[",
"]",
"payloadBytes",
",",
"byte",
"[",
"]",
"signatureBytes",
")",
"throws",
"NoSuchAlgorithmException",
",",
"Inv... | Verify signature for JWT header and payload using a public key.
@param algorithm algorithm name.
@param publicKey the public key to use for verification.
@param headerBytes JWT header.
@param payloadBytes JWT payload.
@param signatureBytes JWT signature.
@return true if signature is valid.
@throws NoSuchAlgorithmExcep... | [
"Verify",
"signature",
"for",
"JWT",
"header",
"and",
"payload",
"using",
"a",
"public",
"key",
"."
] | train | https://github.com/auth0/java-jwt/blob/890538970a9699b7251a4bfe4f26e8d7605ad530/lib/src/main/java/com/auth0/jwt/algorithms/CryptoHelper.java#L97-L104 |
pmwmedia/tinylog | log4j1.2-api/src/main/java/org/apache/log4j/LogManager.java | LogManager.getOrCreateLogger | private static Logger getOrCreateLogger(final String name) {
"""
Retrieves a logger by name.
@param name
Name of the logger
@return Logger instance
"""
if (name == null || name.length() == 0) {
return root;
} else {
Logger logger = loggers.get(name);
if (logger == null) {
Logger parent = ... | java | private static Logger getOrCreateLogger(final String name) {
if (name == null || name.length() == 0) {
return root;
} else {
Logger logger = loggers.get(name);
if (logger == null) {
Logger parent = getOrCreateLogger(reduce(name));
logger = new Logger(parent, name);
loggers.put(name, logger);
... | [
"private",
"static",
"Logger",
"getOrCreateLogger",
"(",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"root",
";",
"}",
"else",
"{",
"Logger",
"logger",
"=... | Retrieves a logger by name.
@param name
Name of the logger
@return Logger instance | [
"Retrieves",
"a",
"logger",
"by",
"name",
"."
] | train | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/log4j1.2-api/src/main/java/org/apache/log4j/LogManager.java#L153-L165 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.replaceResource | @SuppressWarnings("javadoc")
public void replaceResource(
CmsDbContext dbc,
CmsResource resource,
int type,
byte[] content,
List<CmsProperty> properties)
throws CmsException {
"""
Replaces the content, type and properties of a resource.<p>
@param dbc the current d... | java | @SuppressWarnings("javadoc")
public void replaceResource(
CmsDbContext dbc,
CmsResource resource,
int type,
byte[] content,
List<CmsProperty> properties)
throws CmsException {
// replace the existing with the new file content
getVfsDriver(dbc).replaceReso... | [
"@",
"SuppressWarnings",
"(",
"\"javadoc\"",
")",
"public",
"void",
"replaceResource",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
",",
"int",
"type",
",",
"byte",
"[",
"]",
"content",
",",
"List",
"<",
"CmsProperty",
">",
"properties",
")",
... | Replaces the content, type and properties of a resource.<p>
@param dbc the current database context
@param resource the name of the resource to apply this operation to
@param type the new type of the resource
@param content the new content of the resource
@param properties the new properties of the resource
@throws C... | [
"Replaces",
"the",
"content",
"type",
"and",
"properties",
"of",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L8393-L8449 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.eachFileMatch | public static void eachFileMatch(final File self, final FileType fileType, final Object nameFilter, @ClosureParams(value = SimpleType.class, options = "java.io.File") final Closure closure)
throws FileNotFoundException, IllegalArgumentException {
"""
Invokes the closure for each file whose name (file.n... | java | public static void eachFileMatch(final File self, final FileType fileType, final Object nameFilter, @ClosureParams(value = SimpleType.class, options = "java.io.File") final Closure closure)
throws FileNotFoundException, IllegalArgumentException {
checkDir(self);
final File[] files = self.lis... | [
"public",
"static",
"void",
"eachFileMatch",
"(",
"final",
"File",
"self",
",",
"final",
"FileType",
"fileType",
",",
"final",
"Object",
"nameFilter",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.Fil... | Invokes the closure for each file whose name (file.name) matches the given nameFilter in the given directory
- calling the {@link DefaultGroovyMethods#isCase(java.lang.Object, java.lang.Object)} method to determine if a match occurs. This method can be used
with different kinds of filters like regular expressions, cla... | [
"Invokes",
"the",
"closure",
"for",
"each",
"file",
"whose",
"name",
"(",
"file",
".",
"name",
")",
"matches",
"the",
"given",
"nameFilter",
"in",
"the",
"given",
"directory",
"-",
"calling",
"the",
"{",
"@link",
"DefaultGroovyMethods#isCase",
"(",
"java",
"... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1532-L1547 |
aws/aws-sdk-java | aws-java-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/model/GetIdentityDkimAttributesResult.java | GetIdentityDkimAttributesResult.withDkimAttributes | public GetIdentityDkimAttributesResult withDkimAttributes(java.util.Map<String, IdentityDkimAttributes> dkimAttributes) {
"""
<p>
The DKIM attributes for an email address or a domain.
</p>
@param dkimAttributes
The DKIM attributes for an email address or a domain.
@return Returns a reference to this object ... | java | public GetIdentityDkimAttributesResult withDkimAttributes(java.util.Map<String, IdentityDkimAttributes> dkimAttributes) {
setDkimAttributes(dkimAttributes);
return this;
} | [
"public",
"GetIdentityDkimAttributesResult",
"withDkimAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"IdentityDkimAttributes",
">",
"dkimAttributes",
")",
"{",
"setDkimAttributes",
"(",
"dkimAttributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The DKIM attributes for an email address or a domain.
</p>
@param dkimAttributes
The DKIM attributes for an email address or a domain.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"DKIM",
"attributes",
"for",
"an",
"email",
"address",
"or",
"a",
"domain",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/model/GetIdentityDkimAttributesResult.java#L76-L79 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java | TasksInner.listAsync | public Observable<Page<TaskInner>> listAsync(final String resourceGroupName, final String registryName) {
"""
Lists all the tasks for a specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container re... | java | public Observable<Page<TaskInner>> listAsync(final String resourceGroupName, final String registryName) {
return listWithServiceResponseAsync(resourceGroupName, registryName)
.map(new Func1<ServiceResponse<Page<TaskInner>>, Page<TaskInner>>() {
@Override
public Page<T... | [
"public",
"Observable",
"<",
"Page",
"<",
"TaskInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"registryName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
")",... | Lists all the tasks for a specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedL... | [
"Lists",
"all",
"the",
"tasks",
"for",
"a",
"specified",
"container",
"registry",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java#L158-L166 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java | HylaFaxJob.setTargetAddress | public void setTargetAddress(String targetAddress) {
"""
This function sets the fax job target address.
@param targetAddress
The fax job target address
"""
try
{
this.JOB.setDialstring(targetAddress);
}
catch(Exception exception)
{
throw new... | java | public void setTargetAddress(String targetAddress)
{
try
{
this.JOB.setDialstring(targetAddress);
}
catch(Exception exception)
{
throw new FaxException("Error while setting job target address.",exception);
}
} | [
"public",
"void",
"setTargetAddress",
"(",
"String",
"targetAddress",
")",
"{",
"try",
"{",
"this",
".",
"JOB",
".",
"setDialstring",
"(",
"targetAddress",
")",
";",
"}",
"catch",
"(",
"Exception",
"exception",
")",
"{",
"throw",
"new",
"FaxException",
"(",
... | This function sets the fax job target address.
@param targetAddress
The fax job target address | [
"This",
"function",
"sets",
"the",
"fax",
"job",
"target",
"address",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java#L187-L197 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java | AipImageSearch.productDeleteBySign | public JSONObject productDeleteBySign(String contSign, HashMap<String, String> options) {
"""
商品检索—删除接口
**删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign**
@param contSign - 图片签名
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject
"""
AipRequest req... | java | public JSONObject productDeleteBySign(String contSign, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("cont_sign", contSign);
if (options != null) {
request.addBody(options);
}
request.... | [
"public",
"JSONObject",
"productDeleteBySign",
"(",
"String",
"contSign",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"req... | 商品检索—删除接口
**删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign**
@param contSign - 图片签名
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject | [
"商品检索—删除接口",
"**",
"删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L1004-L1015 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/protocol/AsyncCommand.java | AsyncCommand.await | @Override
public boolean await(long timeout, TimeUnit unit) {
"""
Wait up to the specified time for the command output to become available.
@param timeout Maximum time to wait for a result.
@param unit Unit of time for the timeout.
@return true if the output became available.
"""
try {
... | java | @Override
public boolean await(long timeout, TimeUnit unit) {
try {
get(timeout, unit);
return true;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RedisCommandInterruptedException(e);
} catch (ExecutionExcepti... | [
"@",
"Override",
"public",
"boolean",
"await",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"try",
"{",
"get",
"(",
"timeout",
",",
"unit",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"Thread... | Wait up to the specified time for the command output to become available.
@param timeout Maximum time to wait for a result.
@param unit Unit of time for the timeout.
@return true if the output became available. | [
"Wait",
"up",
"to",
"the",
"specified",
"time",
"for",
"the",
"command",
"output",
"to",
"become",
"available",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/protocol/AsyncCommand.java#L80-L93 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java | CacheUnitImpl.removeAlias | public void removeAlias(String cacheName, Object alias) {
"""
This implements the method in the CacheUnit interface.
This is called to remove alias ids from cache id.
@param cacheName The cache name
@param alias The alias ids
"""
if (alias != null) {
DCache cache = ServerCache.getCache... | java | public void removeAlias(String cacheName, Object alias) {
if (alias != null) {
DCache cache = ServerCache.getCache(cacheName);
if (cache != null) {
try {
cache.removeAlias(alias, false, false);
} catch (IllegalArgumentException e) {
... | [
"public",
"void",
"removeAlias",
"(",
"String",
"cacheName",
",",
"Object",
"alias",
")",
"{",
"if",
"(",
"alias",
"!=",
"null",
")",
"{",
"DCache",
"cache",
"=",
"ServerCache",
".",
"getCache",
"(",
"cacheName",
")",
";",
"if",
"(",
"cache",
"!=",
"nu... | This implements the method in the CacheUnit interface.
This is called to remove alias ids from cache id.
@param cacheName The cache name
@param alias The alias ids | [
"This",
"implements",
"the",
"method",
"in",
"the",
"CacheUnit",
"interface",
".",
"This",
"is",
"called",
"to",
"remove",
"alias",
"ids",
"from",
"cache",
"id",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L356-L369 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/report/config/ConfigOptionParser.java | ConfigOptionParser.commandLineLookup | private boolean commandLineLookup( String arg, ConfigOption co, List<ConfigOption> configList ) {
"""
Compares the argument with the {@link CommandLineOption} flags and inserts an object into the parsedOptions map
Terminates with a sane help message if a parse is unsuccessful
@param arg the current word from t... | java | private boolean commandLineLookup( String arg, ConfigOption co, List<ConfigOption> configList ) {
if( arg.startsWith( co.getCommandLineOption().getLongFlag() ) || ( co.getCommandLineOption().hasShortFlag() && arg
.startsWith( co.getCommandLineOption().getShortFlag() ) ) ) {
if( co.g... | [
"private",
"boolean",
"commandLineLookup",
"(",
"String",
"arg",
",",
"ConfigOption",
"co",
",",
"List",
"<",
"ConfigOption",
">",
"configList",
")",
"{",
"if",
"(",
"arg",
".",
"startsWith",
"(",
"co",
".",
"getCommandLineOption",
"(",
")",
".",
"getLongFla... | Compares the argument with the {@link CommandLineOption} flags and inserts an object into the parsedOptions map
Terminates with a sane help message if a parse is unsuccessful
@param arg the current word from the command line argument list
@param co the config option to look for in the argument
@param configList the gl... | [
"Compares",
"the",
"argument",
"with",
"the",
"{",
"@link",
"CommandLineOption",
"}",
"flags",
"and",
"inserts",
"an",
"object",
"into",
"the",
"parsedOptions",
"map",
"Terminates",
"with",
"a",
"sane",
"help",
"message",
"if",
"a",
"parse",
"is",
"unsuccessfu... | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/report/config/ConfigOptionParser.java#L111-L141 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureUtilities.java | FeatureUtilities.findAttributeName | public static String findAttributeName( SimpleFeatureType featureType, String field ) {
"""
Find the name of an attribute, case insensitive.
@param featureType the feature type to check.
@param field the case insensitive field name.
@return the real name of the field, or <code>null</code>, if none found.
... | java | public static String findAttributeName( SimpleFeatureType featureType, String field ) {
List<AttributeDescriptor> attributeDescriptors = featureType.getAttributeDescriptors();
for( AttributeDescriptor attributeDescriptor : attributeDescriptors ) {
String name = attributeDescriptor.getLocalNa... | [
"public",
"static",
"String",
"findAttributeName",
"(",
"SimpleFeatureType",
"featureType",
",",
"String",
"field",
")",
"{",
"List",
"<",
"AttributeDescriptor",
">",
"attributeDescriptors",
"=",
"featureType",
".",
"getAttributeDescriptors",
"(",
")",
";",
"for",
"... | Find the name of an attribute, case insensitive.
@param featureType the feature type to check.
@param field the case insensitive field name.
@return the real name of the field, or <code>null</code>, if none found. | [
"Find",
"the",
"name",
"of",
"an",
"attribute",
"case",
"insensitive",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureUtilities.java#L617-L626 |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/util/Jsr250Utils.java | Jsr250Utils.inScope | public static boolean inScope(final Injector injector, final Binding<?> binding, final Class<? extends Annotation> scope) {
"""
Returns true if the binding is in the specified scope, false otherwise.
@param binding the binding to inspect
@param scope the scope to look for
@return true if the binding is in the s... | java | public static boolean inScope(final Injector injector, final Binding<?> binding, final Class<? extends Annotation> scope) {
return binding.acceptScopingVisitor(new BindingScopingVisitor<Boolean>() {
@Override
public Boolean visitEagerSingleton() {
return scope == Singleton.class || scope == jav... | [
"public",
"static",
"boolean",
"inScope",
"(",
"final",
"Injector",
"injector",
",",
"final",
"Binding",
"<",
"?",
">",
"binding",
",",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"scope",
")",
"{",
"return",
"binding",
".",
"acceptScopingVisit... | Returns true if the binding is in the specified scope, false otherwise.
@param binding the binding to inspect
@param scope the scope to look for
@return true if the binding is in the specified scope, false otherwise. | [
"Returns",
"true",
"if",
"the",
"binding",
"is",
"in",
"the",
"specified",
"scope",
"false",
"otherwise",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/util/Jsr250Utils.java#L368-L391 |
linkedin/linkedin-zookeeper | org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/client/ZKClient.java | ZKClient.waitForState | public void waitForState(State state, Timespan timeout)
throws TimeoutException, InterruptedException {
"""
Wait (no longer than timeout if provided) for the client to be started
"""
long endTime = timeout == null ? 0 : timeout.futureTimeMillis(_clock);
synchronized(_lock)
{
while(_state... | java | public void waitForState(State state, Timespan timeout)
throws TimeoutException, InterruptedException
{
long endTime = timeout == null ? 0 : timeout.futureTimeMillis(_clock);
synchronized(_lock)
{
while(_state != state)
{
ConcurrentUtils.awaitUntil(_clock, _lock, endTime);
}... | [
"public",
"void",
"waitForState",
"(",
"State",
"state",
",",
"Timespan",
"timeout",
")",
"throws",
"TimeoutException",
",",
"InterruptedException",
"{",
"long",
"endTime",
"=",
"timeout",
"==",
"null",
"?",
"0",
":",
"timeout",
".",
"futureTimeMillis",
"(",
"... | Wait (no longer than timeout if provided) for the client to be started | [
"Wait",
"(",
"no",
"longer",
"than",
"timeout",
"if",
"provided",
")",
"for",
"the",
"client",
"to",
"be",
"started"
] | train | https://github.com/linkedin/linkedin-zookeeper/blob/600b1d01318594ed425ede566bbbdc94b026a53e/org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/client/ZKClient.java#L525-L537 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/resource/Delay.java | Delay.randomBetween | protected static long randomBetween(long min, long max) {
"""
Generates a random long value within {@code min} and {@code max} boundaries.
@param min
@param max
@return a random value
@see ThreadLocalRandom#nextLong(long, long)
"""
if (min == max) {
return min;
}
retur... | java | protected static long randomBetween(long min, long max) {
if (min == max) {
return min;
}
return ThreadLocalRandom.current().nextLong(min, max);
} | [
"protected",
"static",
"long",
"randomBetween",
"(",
"long",
"min",
",",
"long",
"max",
")",
"{",
"if",
"(",
"min",
"==",
"max",
")",
"{",
"return",
"min",
";",
"}",
"return",
"ThreadLocalRandom",
".",
"current",
"(",
")",
".",
"nextLong",
"(",
"min",
... | Generates a random long value within {@code min} and {@code max} boundaries.
@param min
@param max
@return a random value
@see ThreadLocalRandom#nextLong(long, long) | [
"Generates",
"a",
"random",
"long",
"value",
"within",
"{",
"@code",
"min",
"}",
"and",
"{",
"@code",
"max",
"}",
"boundaries",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/resource/Delay.java#L323-L328 |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/serialization/Serializer.java | Serializer.writeToStream | public void writeToStream(OutputStream stream, Object object) throws SerializationException {
"""
Write the object to the stream.
@param stream the stream to write the object to.
@param object the object to write to the stream.
@throws SerializationException the object could not be serialized.
"""
... | java | public void writeToStream(OutputStream stream, Object object) throws SerializationException {
try {
mapper.writeValue(stream, object);
} catch (IOException ex) {
throw new SerializationException("Exception during serialization", ex);
}
} | [
"public",
"void",
"writeToStream",
"(",
"OutputStream",
"stream",
",",
"Object",
"object",
")",
"throws",
"SerializationException",
"{",
"try",
"{",
"mapper",
".",
"writeValue",
"(",
"stream",
",",
"object",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
... | Write the object to the stream.
@param stream the stream to write the object to.
@param object the object to write to the stream.
@throws SerializationException the object could not be serialized. | [
"Write",
"the",
"object",
"to",
"the",
"stream",
"."
] | train | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/serialization/Serializer.java#L32-L38 |
nextreports/nextreports-server | src/ro/nextreports/server/web/integration/IntegrationAuthenticationFilter.java | IntegrationAuthenticationFilter.requiresAuthentication | protected boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response) {
"""
/*
public void setAuthenticationSuccessHandler(AuthenticationSuccessHandler successHandler) {
Assert.notNull(successHandler, "successHandler cannot be null");
this.successHandler = successHandler;
}
publ... | java | protected boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response) {
String uri = request.getRequestURI();
int pathParamIndex = uri.indexOf(';');
if (pathParamIndex > 0) {
// strip everything after the first semi-colon
uri = uri.substring(... | [
"protected",
"boolean",
"requiresAuthentication",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"String",
"uri",
"=",
"request",
".",
"getRequestURI",
"(",
")",
";",
"int",
"pathParamIndex",
"=",
"uri",
".",
"indexOf",
"("... | /*
public void setAuthenticationSuccessHandler(AuthenticationSuccessHandler successHandler) {
Assert.notNull(successHandler, "successHandler cannot be null");
this.successHandler = successHandler;
}
public void setAuthenticationFailureHandler(AuthenticationFailureHandler failureHandler) {
Assert.notNull(failureHandler... | [
"/",
"*",
"public",
"void",
"setAuthenticationSuccessHandler",
"(",
"AuthenticationSuccessHandler",
"successHandler",
")",
"{",
"Assert",
".",
"notNull",
"(",
"successHandler",
"successHandler",
"cannot",
"be",
"null",
")",
";",
"this",
".",
"successHandler",
"=",
"... | train | https://github.com/nextreports/nextreports-server/blob/cfce12f5c6d52cb6a739388d50142c6e2e07c55e/src/ro/nextreports/server/web/integration/IntegrationAuthenticationFilter.java#L185-L199 |
magik6k/JWWF | src/main/java/net/magik6k/jwwf/core/JwwfServer.java | JwwfServer.bindServlet | public JwwfServer bindServlet(Servlet servlet, String url) {
"""
<p>Binds ServletHolder to URL, this allows creation of REST APIs, etc</p>
<p>PLUGINS: Plugin servlets should have url's like /__jwwf/myplugin/stuff</p>
@param servlet Servlet holder
@param url URL to bind servlet to
@return This JwwfServer
... | java | public JwwfServer bindServlet(Servlet servlet, String url) {
context.addServlet(new ServletHolder(servlet), url);
return this;
} | [
"public",
"JwwfServer",
"bindServlet",
"(",
"Servlet",
"servlet",
",",
"String",
"url",
")",
"{",
"context",
".",
"addServlet",
"(",
"new",
"ServletHolder",
"(",
"servlet",
")",
",",
"url",
")",
";",
"return",
"this",
";",
"}"
] | <p>Binds ServletHolder to URL, this allows creation of REST APIs, etc</p>
<p>PLUGINS: Plugin servlets should have url's like /__jwwf/myplugin/stuff</p>
@param servlet Servlet holder
@param url URL to bind servlet to
@return This JwwfServer | [
"<p",
">",
"Binds",
"ServletHolder",
"to",
"URL",
"this",
"allows",
"creation",
"of",
"REST",
"APIs",
"etc<",
"/",
"p",
">",
"<p",
">",
"PLUGINS",
":",
"Plugin",
"servlets",
"should",
"have",
"url",
"s",
"like",
"/",
"__jwwf",
"/",
"myplugin",
"/",
"st... | train | https://github.com/magik6k/JWWF/blob/8ba334501396c3301495da8708733f6014f20665/src/main/java/net/magik6k/jwwf/core/JwwfServer.java#L118-L121 |
lucee/Lucee | core/src/main/java/lucee/runtime/schedule/StorageUtil.java | StorageUtil.toDate | public Date toDate(Config config, Element el, String attributeName) {
"""
reads a XML Element Attribute ans cast it to a Date Object
@param el XML Element to read Attribute from it
@param attributeName Name of the Attribute to read
@return Attribute Value
"""
DateTime dt = toDateTime(config, el, attribut... | java | public Date toDate(Config config, Element el, String attributeName) {
DateTime dt = toDateTime(config, el, attributeName);
if (dt == null) return null;
return new DateImpl(dt);
} | [
"public",
"Date",
"toDate",
"(",
"Config",
"config",
",",
"Element",
"el",
",",
"String",
"attributeName",
")",
"{",
"DateTime",
"dt",
"=",
"toDateTime",
"(",
"config",
",",
"el",
",",
"attributeName",
")",
";",
"if",
"(",
"dt",
"==",
"null",
")",
"ret... | reads a XML Element Attribute ans cast it to a Date Object
@param el XML Element to read Attribute from it
@param attributeName Name of the Attribute to read
@return Attribute Value | [
"reads",
"a",
"XML",
"Element",
"Attribute",
"ans",
"cast",
"it",
"to",
"a",
"Date",
"Object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/schedule/StorageUtil.java#L273-L277 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.lastIndexOfIgnoreCase | public static int lastIndexOfIgnoreCase(String pString, int pChar) {
"""
Returns the index within this string of the last occurrence of the
specified character.
@param pString The string to test
@param pChar The character to look for
@return if the string argument occurs as a substring within this object,
... | java | public static int lastIndexOfIgnoreCase(String pString, int pChar) {
return lastIndexOfIgnoreCase(pString, pChar, pString != null ? pString.length() : -1);
} | [
"public",
"static",
"int",
"lastIndexOfIgnoreCase",
"(",
"String",
"pString",
",",
"int",
"pChar",
")",
"{",
"return",
"lastIndexOfIgnoreCase",
"(",
"pString",
",",
"pChar",
",",
"pString",
"!=",
"null",
"?",
"pString",
".",
"length",
"(",
")",
":",
"-",
"... | Returns the index within this string of the last occurrence of the
specified character.
@param pString The string to test
@param pChar The character to look for
@return if the string argument occurs as a substring within this object,
then the index of the first character of the first such substring is
returned; if i... | [
"Returns",
"the",
"index",
"within",
"this",
"string",
"of",
"the",
"last",
"occurrence",
"of",
"the",
"specified",
"character",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L509-L511 |
m-m-m/util | pojopath/src/main/java/net/sf/mmm/util/pojo/path/base/AbstractPojoPathNavigator.java | AbstractPojoPathNavigator.getFromFunction | @SuppressWarnings( {
"""
This method {@link PojoPathFunction#get(Object, String, PojoPathContext) gets} the single
{@link CachingPojoPath#getSegment() segment} of the given {@code currentPath} from the
{@link net.sf.mmm.util.pojo.api.Pojo} given by {@code parentPojo}. If the result is {@code null} and
{@link Po... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
protected Object getFromFunction(CachingPojoPath currentPath, PojoPathContext context, PojoPathState state, PojoPathFunction function) {
Object parentPojo = currentPath.parent.pojo;
// TODO: convert parentPojo from parentPojoType to function.getInputClass()
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"protected",
"Object",
"getFromFunction",
"(",
"CachingPojoPath",
"currentPath",
",",
"PojoPathContext",
"context",
",",
"PojoPathState",
"state",
",",
"PojoPathFunction",
"function",
"... | This method {@link PojoPathFunction#get(Object, String, PojoPathContext) gets} the single
{@link CachingPojoPath#getSegment() segment} of the given {@code currentPath} from the
{@link net.sf.mmm.util.pojo.api.Pojo} given by {@code parentPojo}. If the result is {@code null} and
{@link PojoPathState#getMode() mode} is {@... | [
"This",
"method",
"{",
"@link",
"PojoPathFunction#get",
"(",
"Object",
"String",
"PojoPathContext",
")",
"gets",
"}",
"the",
"single",
"{",
"@link",
"CachingPojoPath#getSegment",
"()",
"segment",
"}",
"of",
"the",
"given",
"{",
"@code",
"currentPath",
"}",
"from... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/pojopath/src/main/java/net/sf/mmm/util/pojo/path/base/AbstractPojoPathNavigator.java#L463-L480 |
threerings/playn | html/src/playn/html/HtmlGraphics.java | HtmlGraphics.setSize | public void setSize(int width, int height) {
"""
Sizes or resizes the root element that contains the PlayN view.
@param width the new width, in pixels, of the view.
@param height the new height, in pixels, of the view.
"""
rootElement.getStyle().setWidth(width, Unit.PX);
rootElement.getStyle().setHei... | java | public void setSize(int width, int height) {
rootElement.getStyle().setWidth(width, Unit.PX);
rootElement.getStyle().setHeight(height, Unit.PX);
} | [
"public",
"void",
"setSize",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"rootElement",
".",
"getStyle",
"(",
")",
".",
"setWidth",
"(",
"width",
",",
"Unit",
".",
"PX",
")",
";",
"rootElement",
".",
"getStyle",
"(",
")",
".",
"setHeight",
"... | Sizes or resizes the root element that contains the PlayN view.
@param width the new width, in pixels, of the view.
@param height the new height, in pixels, of the view. | [
"Sizes",
"or",
"resizes",
"the",
"root",
"element",
"that",
"contains",
"the",
"PlayN",
"view",
"."
] | train | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/html/src/playn/html/HtmlGraphics.java#L83-L86 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4ClientConnection.java | JDBC4ClientConnection.executeAsync | public Future<ClientResponse> executeAsync(String procedure, Object... parameters)
throws NoConnectionsException, IOException {
"""
Executes a procedure asynchronously, returning a Future that can be used by the caller to
wait upon completion before processing the server response.
@param procedure
... | java | public Future<ClientResponse> executeAsync(String procedure, Object... parameters)
throws NoConnectionsException, IOException
{
ClientImpl currentClient = this.getClient();
final JDBC4ExecutionFuture future = new JDBC4ExecutionFuture(this.defaultAsyncTimeout);
try {
c... | [
"public",
"Future",
"<",
"ClientResponse",
">",
"executeAsync",
"(",
"String",
"procedure",
",",
"Object",
"...",
"parameters",
")",
"throws",
"NoConnectionsException",
",",
"IOException",
"{",
"ClientImpl",
"currentClient",
"=",
"this",
".",
"getClient",
"(",
")"... | Executes a procedure asynchronously, returning a Future that can be used by the caller to
wait upon completion before processing the server response.
@param procedure
the name of the procedure to call.
@param parameters
the list of parameters to pass to the procedure.
@return the Future created to wrap around the asyn... | [
"Executes",
"a",
"procedure",
"asynchronously",
"returning",
"a",
"Future",
"that",
"can",
"be",
"used",
"by",
"the",
"caller",
"to",
"wait",
"upon",
"completion",
"before",
"processing",
"the",
"server",
"response",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4ClientConnection.java#L439-L463 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneIconifyButtonPainter.java | TitlePaneIconifyButtonPainter.paintBackgroundEnabled | private void paintBackgroundEnabled(Graphics2D g, JComponent c, int width, int height) {
"""
Paint the background enabled state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component.
"""
... | java | private void paintBackgroundEnabled(Graphics2D g, JComponent c, int width, int height) {
paintBackground(g, c, width, height, enabled);
} | [
"private",
"void",
"paintBackgroundEnabled",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"paintBackground",
"(",
"g",
",",
"c",
",",
"width",
",",
"height",
",",
"enabled",
")",
";",
"}"
] | Paint the background enabled state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component. | [
"Paint",
"the",
"background",
"enabled",
"state",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneIconifyButtonPainter.java#L135-L137 |
lets-blade/blade | src/main/java/com/blade/mvc/RouteContext.java | RouteContext.queryInt | public Integer queryInt(String paramName, Integer defaultValue) {
"""
Returns a request parameter for a Int type
@param paramName Parameter name
@param defaultValue default int value
@return Return Int parameter values
"""
return this.request.queryInt(paramName, defaultValue);
} | java | public Integer queryInt(String paramName, Integer defaultValue) {
return this.request.queryInt(paramName, defaultValue);
} | [
"public",
"Integer",
"queryInt",
"(",
"String",
"paramName",
",",
"Integer",
"defaultValue",
")",
"{",
"return",
"this",
".",
"request",
".",
"queryInt",
"(",
"paramName",
",",
"defaultValue",
")",
";",
"}"
] | Returns a request parameter for a Int type
@param paramName Parameter name
@param defaultValue default int value
@return Return Int parameter values | [
"Returns",
"a",
"request",
"parameter",
"for",
"a",
"Int",
"type"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/mvc/RouteContext.java#L194-L196 |
apptik/jus | android/jus-android/src/main/java/io/apptik/comm/jus/ui/ImageLoader.java | ImageLoader.onGetImageSuccess | protected void onGetImageSuccess(String cacheKey, Bitmap response) {
"""
Handler for when an image was successfully loaded.
@param cacheKey The cache key that is associated with the image request.
@param response The bitmap that was returned from the network.
"""
// cache the image that was fetched.
... | java | protected void onGetImageSuccess(String cacheKey, Bitmap response) {
// cache the image that was fetched.
imageCache.putBitmap(cacheKey, response);
// remove the request from the list of in-flight requests.
BatchedImageRequest request = inFlightRequests.remove(cacheKey);
if (re... | [
"protected",
"void",
"onGetImageSuccess",
"(",
"String",
"cacheKey",
",",
"Bitmap",
"response",
")",
"{",
"// cache the image that was fetched.",
"imageCache",
".",
"putBitmap",
"(",
"cacheKey",
",",
"response",
")",
";",
"// remove the request from the list of in-flight re... | Handler for when an image was successfully loaded.
@param cacheKey The cache key that is associated with the image request.
@param response The bitmap that was returned from the network. | [
"Handler",
"for",
"when",
"an",
"image",
"was",
"successfully",
"loaded",
"."
] | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/android/jus-android/src/main/java/io/apptik/comm/jus/ui/ImageLoader.java#L343-L357 |
BioPAX/Paxtools | sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/L3ToSBGNPDConverter.java | L3ToSBGNPDConverter.createGlyphBasics | private Glyph createGlyphBasics(Entity e, boolean idIsFinal) {
"""
/*
This method creates a glyph for the given PhysicalEntity, sets its title and state variables
if applicable.
@param e PhysicalEntity or Gene to represent
@param idIsFinal if ID is final, then it is recorded for future reference
@return the... | java | private Glyph createGlyphBasics(Entity e, boolean idIsFinal)
{
Glyph g = factory.createGlyph();
g.setId(convertID(e.getUri()));
String s = typeMatchMap.get(e.getModelInterface());
if(( //use 'or' sbgn class for special generic physical entities
e instanceof Complex && !((Complex)e).getMemberPhysicalEntity(... | [
"private",
"Glyph",
"createGlyphBasics",
"(",
"Entity",
"e",
",",
"boolean",
"idIsFinal",
")",
"{",
"Glyph",
"g",
"=",
"factory",
".",
"createGlyph",
"(",
")",
";",
"g",
".",
"setId",
"(",
"convertID",
"(",
"e",
".",
"getUri",
"(",
")",
")",
")",
";"... | /*
This method creates a glyph for the given PhysicalEntity, sets its title and state variables
if applicable.
@param e PhysicalEntity or Gene to represent
@param idIsFinal if ID is final, then it is recorded for future reference
@return the glyph | [
"/",
"*",
"This",
"method",
"creates",
"a",
"glyph",
"for",
"the",
"given",
"PhysicalEntity",
"sets",
"its",
"title",
"and",
"state",
"variables",
"if",
"applicable",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/L3ToSBGNPDConverter.java#L461-L502 |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java | Transform.getInstance | public static Transform getInstance(Element e, String initial) {
"""
Return the Transform dictionary object of an element, but reseting
historical values and setting them to the initial value passed.
"""
Transform t = GQuery.data(e, TRANSFORM);
if (t == null || initial != null) {
if (initial == ... | java | public static Transform getInstance(Element e, String initial) {
Transform t = GQuery.data(e, TRANSFORM);
if (t == null || initial != null) {
if (initial == null) {
initial = GQuery.getSelectorEngine().getDocumentStyleImpl().curCSS(e, transform, false);
}
t = new Transform(initial);
... | [
"public",
"static",
"Transform",
"getInstance",
"(",
"Element",
"e",
",",
"String",
"initial",
")",
"{",
"Transform",
"t",
"=",
"GQuery",
".",
"data",
"(",
"e",
",",
"TRANSFORM",
")",
";",
"if",
"(",
"t",
"==",
"null",
"||",
"initial",
"!=",
"null",
... | Return the Transform dictionary object of an element, but reseting
historical values and setting them to the initial value passed. | [
"Return",
"the",
"Transform",
"dictionary",
"object",
"of",
"an",
"element",
"but",
"reseting",
"historical",
"values",
"and",
"setting",
"them",
"to",
"the",
"initial",
"value",
"passed",
"."
] | train | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java#L123-L133 |
cryptomator/cryptolib | src/main/java/org/cryptomator/cryptolib/Cryptors.java | Cryptors.cleartextSize | public static long cleartextSize(long ciphertextSize, Cryptor cryptor) {
"""
Calculates the size of the cleartext resulting from the given ciphertext decrypted with the given cryptor.
@param ciphertextSize Length of encrypted payload. Not including the {@link FileHeader#getFilesize() length of the header}.
@pa... | java | public static long cleartextSize(long ciphertextSize, Cryptor cryptor) {
checkArgument(ciphertextSize >= 0, "expected ciphertextSize to be positive, but was %s", ciphertextSize);
long cleartextChunkSize = cryptor.fileContentCryptor().cleartextChunkSize();
long ciphertextChunkSize = cryptor.fileContentCryptor().ci... | [
"public",
"static",
"long",
"cleartextSize",
"(",
"long",
"ciphertextSize",
",",
"Cryptor",
"cryptor",
")",
"{",
"checkArgument",
"(",
"ciphertextSize",
">=",
"0",
",",
"\"expected ciphertextSize to be positive, but was %s\"",
",",
"ciphertextSize",
")",
";",
"long",
... | Calculates the size of the cleartext resulting from the given ciphertext decrypted with the given cryptor.
@param ciphertextSize Length of encrypted payload. Not including the {@link FileHeader#getFilesize() length of the header}.
@param cryptor The cryptor which defines the cleartext/ciphertext ratio
@return Cleartex... | [
"Calculates",
"the",
"size",
"of",
"the",
"cleartext",
"resulting",
"from",
"the",
"given",
"ciphertext",
"decrypted",
"with",
"the",
"given",
"cryptor",
"."
] | train | https://github.com/cryptomator/cryptolib/blob/33bc881f6ee7d4924043ea6309efd2c063ec3638/src/main/java/org/cryptomator/cryptolib/Cryptors.java#L41-L54 |
twilio/twilio-java | src/main/java/com/twilio/rest/flexapi/v1/FlexFlowReader.java | FlexFlowReader.firstPage | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<FlexFlow> firstPage(final TwilioRestClient client) {
"""
Make the request to the Twilio API to perform the read.
@param client TwilioRestClient with which to make the request
@return FlexFlow ResourceSet
"""
Request request = ... | java | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<FlexFlow> firstPage(final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
Domains.FLEXAPI.toString(),
"/v1/FlexFlows",
client.getRegion()
);
addQuer... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:linelength\"",
")",
"public",
"Page",
"<",
"FlexFlow",
">",
"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 FlexFlow 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/flexapi/v1/FlexFlowReader.java#L53-L65 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapApi.java | MapApi.getStringUnsafe | public static String getStringUnsafe(final Map map, final Object... path) {
"""
Get string value by path.
@param map subject
@param path nodes to walk in map
@return value
"""
return getUnsafe(map, String.class, path);
} | java | public static String getStringUnsafe(final Map map, final Object... path) {
return getUnsafe(map, String.class, path);
} | [
"public",
"static",
"String",
"getStringUnsafe",
"(",
"final",
"Map",
"map",
",",
"final",
"Object",
"...",
"path",
")",
"{",
"return",
"getUnsafe",
"(",
"map",
",",
"String",
".",
"class",
",",
"path",
")",
";",
"}"
] | Get string value by path.
@param map subject
@param path nodes to walk in map
@return value | [
"Get",
"string",
"value",
"by",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapApi.java#L187-L189 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ClassUtils.java | ClassUtils.findMethod | @SuppressWarnings("all")
public static Method findMethod(Class<?> type, String methodName, Object... arguments) {
"""
Attempts to find a method with the specified name on the given class type having a signature with parameter types
that are compatible with the given arguments. This method searches recursively ... | java | @SuppressWarnings("all")
public static Method findMethod(Class<?> type, String methodName, Object... arguments) {
for (Method method : type.getDeclaredMethods()) {
if (method.getName().equals(methodName)) {
Class<?>[] parameterTypes = method.getParameterTypes();
if (ArrayUtils.nullSafeLe... | [
"@",
"SuppressWarnings",
"(",
"\"all\"",
")",
"public",
"static",
"Method",
"findMethod",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"methodName",
",",
"Object",
"...",
"arguments",
")",
"{",
"for",
"(",
"Method",
"method",
":",
"type",
".",
"ge... | Attempts to find a method with the specified name on the given class type having a signature with parameter types
that are compatible with the given arguments. This method searches recursively up the inherited class hierarchy
for the given class type until the desired method is found or the class type hierarchy is exh... | [
"Attempts",
"to",
"find",
"a",
"method",
"with",
"the",
"specified",
"name",
"on",
"the",
"given",
"class",
"type",
"having",
"a",
"signature",
"with",
"parameter",
"types",
"that",
"are",
"compatible",
"with",
"the",
"given",
"arguments",
".",
"This",
"meth... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ClassUtils.java#L330-L355 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.serviceName_pca_pcaServiceName_billing_GET | public ArrayList<Long> serviceName_pca_pcaServiceName_billing_GET(String serviceName, String pcaServiceName, Boolean billed, Date date_from, Date date_to) throws IOException {
"""
cloud Archives billing items
REST: GET /cloud/{serviceName}/pca/{pcaServiceName}/billing
@param date_to [required] Filter the value... | java | public ArrayList<Long> serviceName_pca_pcaServiceName_billing_GET(String serviceName, String pcaServiceName, Boolean billed, Date date_from, Date date_to) throws IOException {
String qPath = "/cloud/{serviceName}/pca/{pcaServiceName}/billing";
StringBuilder sb = path(qPath, serviceName, pcaServiceName);
query(sb,... | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_pca_pcaServiceName_billing_GET",
"(",
"String",
"serviceName",
",",
"String",
"pcaServiceName",
",",
"Boolean",
"billed",
",",
"Date",
"date_from",
",",
"Date",
"date_to",
")",
"throws",
"IOException",
"{",
"Stri... | cloud Archives billing items
REST: GET /cloud/{serviceName}/pca/{pcaServiceName}/billing
@param date_to [required] Filter the value of date property (<=)
@param billed [required] Filter the value of billed property (=)
@param date_from [required] Filter the value of date property (>=)
@param serviceName [required] The... | [
"cloud",
"Archives",
"billing",
"items"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2599-L2607 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/InventoryNavigator.java | InventoryNavigator.searchManagedEntities | public ManagedEntity[] searchManagedEntities(String type) throws InvalidProperty, RuntimeFault, RemoteException {
"""
Get the first ManagedObjectReference from current node for the specified type
"""
String[][] typeinfo = new String[][]{new String[]{type, "name",},};
return searchManagedEntit... | java | public ManagedEntity[] searchManagedEntities(String type) throws InvalidProperty, RuntimeFault, RemoteException {
String[][] typeinfo = new String[][]{new String[]{type, "name",},};
return searchManagedEntities(typeinfo, true);
} | [
"public",
"ManagedEntity",
"[",
"]",
"searchManagedEntities",
"(",
"String",
"type",
")",
"throws",
"InvalidProperty",
",",
"RuntimeFault",
",",
"RemoteException",
"{",
"String",
"[",
"]",
"[",
"]",
"typeinfo",
"=",
"new",
"String",
"[",
"]",
"[",
"]",
"{",
... | Get the first ManagedObjectReference from current node for the specified type | [
"Get",
"the",
"first",
"ManagedObjectReference",
"from",
"current",
"node",
"for",
"the",
"specified",
"type"
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/InventoryNavigator.java#L36-L39 |
magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/RequestTrackingContextValve.java | RequestTrackingContextValve.changeRequestedSessionId | private boolean changeRequestedSessionId( final Request request, final Response response ) {
"""
If there's a session for a requested session id that is taken over (tomcat failover) or
that will be relocated (memcached failover), the new session id will be set (via {@link Request#changeSessionId(String)}).
@pa... | java | private boolean changeRequestedSessionId( final Request request, final Response response ) {
/*
* Check for session relocation only if a session id was requested
*/
if ( request.getRequestedSessionId() != null ) {
String newSessionId = _sessionBackupService.changeSessionIdOnT... | [
"private",
"boolean",
"changeRequestedSessionId",
"(",
"final",
"Request",
"request",
",",
"final",
"Response",
"response",
")",
"{",
"/*\n * Check for session relocation only if a session id was requested\n */",
"if",
"(",
"request",
".",
"getRequestedSessionId",... | If there's a session for a requested session id that is taken over (tomcat failover) or
that will be relocated (memcached failover), the new session id will be set (via {@link Request#changeSessionId(String)}).
@param request the request
@param response the response
@return <code>true</code> if the id of a valid sess... | [
"If",
"there",
"s",
"a",
"session",
"for",
"a",
"requested",
"session",
"id",
"that",
"is",
"taken",
"over",
"(",
"tomcat",
"failover",
")",
"or",
"that",
"will",
"be",
"relocated",
"(",
"memcached",
"failover",
")",
"the",
"new",
"session",
"id",
"will"... | train | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/RequestTrackingContextValve.java#L120-L138 |
mgm-tp/jfunk | jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java | WebDriverTool.dragAndDrop | public void dragAndDrop(final By sourceBy, final By targetBy) {
"""
Performs a drag'n'drop operation of the element located by {@code sourceBy} to the
location of the element located by {@code targetBy}.
@param sourceBy
the {@link By} used to locate the source element
@param targetBy
the {@link By} used to ... | java | public void dragAndDrop(final By sourceBy, final By targetBy) {
checkTopmostElement(sourceBy);
checkTopmostElement(targetBy);
WebElement source = findElement(sourceBy);
WebElement target = findElement(targetBy);
new Actions(webDriver).dragAndDrop(source, target).perform();
} | [
"public",
"void",
"dragAndDrop",
"(",
"final",
"By",
"sourceBy",
",",
"final",
"By",
"targetBy",
")",
"{",
"checkTopmostElement",
"(",
"sourceBy",
")",
";",
"checkTopmostElement",
"(",
"targetBy",
")",
";",
"WebElement",
"source",
"=",
"findElement",
"(",
"sou... | Performs a drag'n'drop operation of the element located by {@code sourceBy} to the
location of the element located by {@code targetBy}.
@param sourceBy
the {@link By} used to locate the source element
@param targetBy
the {@link By} used to locate the element representing the target location | [
"Performs",
"a",
"drag",
"n",
"drop",
"operation",
"of",
"the",
"element",
"located",
"by",
"{",
"@code",
"sourceBy",
"}",
"to",
"the",
"location",
"of",
"the",
"element",
"located",
"by",
"{",
"@code",
"targetBy",
"}",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java#L254-L260 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.getWriter | public static ImageWriter getWriter(Image img, String formatName) {
"""
根据给定的Image对象和格式获取对应的{@link ImageWriter},如果未找到合适的Writer,返回null
@param img {@link Image}
@param formatName 图片格式,例如"jpg"、"png"
@return {@link ImageWriter}
@since 4.3.2
"""
final ImageTypeSpecifier type = ImageTypeSpecifier.createFrom... | java | public static ImageWriter getWriter(Image img, String formatName) {
final ImageTypeSpecifier type = ImageTypeSpecifier.createFromRenderedImage(toRenderedImage(img));
final Iterator<ImageWriter> iter = ImageIO.getImageWriters(type, formatName);
return iter.hasNext() ? iter.next() : null;
} | [
"public",
"static",
"ImageWriter",
"getWriter",
"(",
"Image",
"img",
",",
"String",
"formatName",
")",
"{",
"final",
"ImageTypeSpecifier",
"type",
"=",
"ImageTypeSpecifier",
".",
"createFromRenderedImage",
"(",
"toRenderedImage",
"(",
"img",
")",
")",
";",
"final"... | 根据给定的Image对象和格式获取对应的{@link ImageWriter},如果未找到合适的Writer,返回null
@param img {@link Image}
@param formatName 图片格式,例如"jpg"、"png"
@return {@link ImageWriter}
@since 4.3.2 | [
"根据给定的Image对象和格式获取对应的",
"{",
"@link",
"ImageWriter",
"}",
",如果未找到合适的Writer,返回null"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1654-L1658 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java | DatabasesInner.beginResumeAsync | public Observable<DatabaseInner> beginResumeAsync(String resourceGroupName, String serverName, String databaseName) {
"""
Resumes a database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param s... | java | public Observable<DatabaseInner> beginResumeAsync(String resourceGroupName, String serverName, String databaseName) {
return beginResumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DatabaseInner>, DatabaseInner>() {
@Override
public ... | [
"public",
"Observable",
"<",
"DatabaseInner",
">",
"beginResumeAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"beginResumeWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
... | Resumes a database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database to be resumed.
@throws IllegalArgumentException thr... | [
"Resumes",
"a",
"database",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java#L1502-L1509 |
foundation-runtime/logging | logging-log4j/src/main/java/com/cisco/oss/foundation/logging/LoggingHelper.java | LoggingHelper.error | public static void error(final Logger logger, final String format, final Object... params) {
"""
log message using the String.format API
@param logger
the logger that will be used to log the message
@param format
the format string (the template string)
@param params
the parameters to be formatted into it t... | java | public static void error(final Logger logger, final String format, final Object... params) {
error(logger, format, null, params);
} | [
"public",
"static",
"void",
"error",
"(",
"final",
"Logger",
"logger",
",",
"final",
"String",
"format",
",",
"final",
"Object",
"...",
"params",
")",
"{",
"error",
"(",
"logger",
",",
"format",
",",
"null",
",",
"params",
")",
";",
"}"
] | log message using the String.format API
@param logger
the logger that will be used to log the message
@param format
the format string (the template string)
@param params
the parameters to be formatted into it the string format | [
"log",
"message",
"using",
"the",
"String",
".",
"format",
"API"
] | train | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-log4j/src/main/java/com/cisco/oss/foundation/logging/LoggingHelper.java#L293-L295 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.dndOn | public void dndOn() throws WorkspaceApiException {
"""
Set the current agent's state to Do Not Disturb on the voice channel.
"""
try {
ApiSuccessResponse response = this.voiceApi.setDNDOn(null);
throwIfNotOk("dndOn", response);
} catch (ApiException e) {
... | java | public void dndOn() throws WorkspaceApiException {
try {
ApiSuccessResponse response = this.voiceApi.setDNDOn(null);
throwIfNotOk("dndOn", response);
} catch (ApiException e) {
throw new WorkspaceApiException("dndOn failed.", e);
}
} | [
"public",
"void",
"dndOn",
"(",
")",
"throws",
"WorkspaceApiException",
"{",
"try",
"{",
"ApiSuccessResponse",
"response",
"=",
"this",
".",
"voiceApi",
".",
"setDNDOn",
"(",
"null",
")",
";",
"throwIfNotOk",
"(",
"\"dndOn\"",
",",
"response",
")",
";",
"}",... | Set the current agent's state to Do Not Disturb on the voice channel. | [
"Set",
"the",
"current",
"agent",
"s",
"state",
"to",
"Do",
"Not",
"Disturb",
"on",
"the",
"voice",
"channel",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L389-L396 |
VoltDB/voltdb | src/frontend/org/voltdb/expressions/SelectSubqueryExpression.java | SelectSubqueryExpression.resolveCorrelations | public void resolveCorrelations() {
"""
Resolve the subquery's correlated TVEs (and, in one special case, aggregates)
that became ParameterValueExpressions in the subquery statement (or its children).
If they reference a column from the parent statement (getOrigStmtId() == parentStmt.m_stmtId)
that PVE will hav... | java | public void resolveCorrelations() {
AbstractParsedStmt subqueryStmt = m_subquery.getSubqueryStmt();
AbstractParsedStmt parentStmt = subqueryStmt.m_parentStmt;
// we must have a parent - it's a subquery statement
assert(parentStmt != null);
// Preserve indexes of all parameters t... | [
"public",
"void",
"resolveCorrelations",
"(",
")",
"{",
"AbstractParsedStmt",
"subqueryStmt",
"=",
"m_subquery",
".",
"getSubqueryStmt",
"(",
")",
";",
"AbstractParsedStmt",
"parentStmt",
"=",
"subqueryStmt",
".",
"m_parentStmt",
";",
"// we must have a parent - it's a su... | Resolve the subquery's correlated TVEs (and, in one special case, aggregates)
that became ParameterValueExpressions in the subquery statement (or its children).
If they reference a column from the parent statement (getOrigStmtId() == parentStmt.m_stmtId)
that PVE will have to be initialized by this subquery expression ... | [
"Resolve",
"the",
"subquery",
"s",
"correlated",
"TVEs",
"(",
"and",
"in",
"one",
"special",
"case",
"aggregates",
")",
"that",
"became",
"ParameterValueExpressions",
"in",
"the",
"subquery",
"statement",
"(",
"or",
"its",
"children",
")",
".",
"If",
"they",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/SelectSubqueryExpression.java#L238-L272 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/system/NativeLibraryLoader.java | NativeLibraryLoader.loadLibrary | public static void loadLibrary(String _libName, SearchOrder[] _loadOrder, String... _searchPathes) {
"""
Tries to load the given library using the given load/search order.
@param _libName library name
@param _loadOrder load order
@param _searchPathes search pathes
"""
if (!isEnabled()) {
... | java | public static void loadLibrary(String _libName, SearchOrder[] _loadOrder, String... _searchPathes) {
if (!isEnabled()) {
return;
}
for (SearchOrder order : _loadOrder) {
if (INSTANCE.findProperNativeLib(order, _libName, _searchPathes) == null) {
return;
... | [
"public",
"static",
"void",
"loadLibrary",
"(",
"String",
"_libName",
",",
"SearchOrder",
"[",
"]",
"_loadOrder",
",",
"String",
"...",
"_searchPathes",
")",
"{",
"if",
"(",
"!",
"isEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"for",
"(",
"SearchOrd... | Tries to load the given library using the given load/search order.
@param _libName library name
@param _loadOrder load order
@param _searchPathes search pathes | [
"Tries",
"to",
"load",
"the",
"given",
"library",
"using",
"the",
"given",
"load",
"/",
"search",
"order",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/system/NativeLibraryLoader.java#L79-L90 |
SvenEwald/xmlbeam | src/main/java/org/xmlbeam/evaluation/DefaultXPathEvaluator.java | DefaultXPathEvaluator.asListOf | @Override
public <T> List<T> asListOf(final Class<T> componentType) {
"""
Evaluate the XPath as a list of the given type.
@param componentType
Possible values: primitive types (e.g. Short.Type), Projection interfaces, any
class with a String constructor or a String factory method, and org.w3c.Node
@retur... | java | @Override
public <T> List<T> asListOf(final Class<T> componentType) {
Class<?> callerClass = ReflectionHelper.getDirectCallerClass();
return evaluateMultiValues(componentType, callerClass);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"asListOf",
"(",
"final",
"Class",
"<",
"T",
">",
"componentType",
")",
"{",
"Class",
"<",
"?",
">",
"callerClass",
"=",
"ReflectionHelper",
".",
"getDirectCallerClass",
"(",
")",
";",
"r... | Evaluate the XPath as a list of the given type.
@param componentType
Possible values: primitive types (e.g. Short.Type), Projection interfaces, any
class with a String constructor or a String factory method, and org.w3c.Node
@return List of return type that reflects the evaluation result. | [
"Evaluate",
"the",
"XPath",
"as",
"a",
"list",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/SvenEwald/xmlbeam/blob/acaac1b8fa28d246f17187f5e3c6696458a0b447/src/main/java/org/xmlbeam/evaluation/DefaultXPathEvaluator.java#L212-L216 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java | TransformerImpl.pushPairCurrentMatched | public void pushPairCurrentMatched(ElemTemplateElement template, int child) {
"""
Push both the current xsl:template or xsl:for-each onto the
stack, along with the child node that was matched.
(Note: should this only be used for xsl:templates?? -sb)
@param template xsl:template or xsl:for-each.
@param child ... | java | public void pushPairCurrentMatched(ElemTemplateElement template, int child)
{
m_currentMatchTemplates.push(template);
m_currentMatchedNodes.push(child);
} | [
"public",
"void",
"pushPairCurrentMatched",
"(",
"ElemTemplateElement",
"template",
",",
"int",
"child",
")",
"{",
"m_currentMatchTemplates",
".",
"push",
"(",
"template",
")",
";",
"m_currentMatchedNodes",
".",
"push",
"(",
"child",
")",
";",
"}"
] | Push both the current xsl:template or xsl:for-each onto the
stack, along with the child node that was matched.
(Note: should this only be used for xsl:templates?? -sb)
@param template xsl:template or xsl:for-each.
@param child The child that was matched. | [
"Push",
"both",
"the",
"current",
"xsl",
":",
"template",
"or",
"xsl",
":",
"for",
"-",
"each",
"onto",
"the",
"stack",
"along",
"with",
"the",
"child",
"node",
"that",
"was",
"matched",
".",
"(",
"Note",
":",
"should",
"this",
"only",
"be",
"used",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L2501-L2505 |
cloudinary/cloudinary_java | cloudinary-core/src/main/java/com/cloudinary/Api.java | Api.updateStreamingProfile | public ApiResponse updateStreamingProfile(String name, String displayName, List<Map> representations, Map options) throws Exception {
"""
Create a new streaming profile
@param name the of the profile
@param displayName the display name of the profile
@param representations a collection of Maps ... | java | public ApiResponse updateStreamingProfile(String name, String displayName, List<Map> representations, Map options) throws Exception {
if (options == null)
options = ObjectUtils.emptyMap();
List<Map> serializedRepresentations;
final Map params = new HashMap();
List<String> uri... | [
"public",
"ApiResponse",
"updateStreamingProfile",
"(",
"String",
"name",
",",
"String",
"displayName",
",",
"List",
"<",
"Map",
">",
"representations",
",",
"Map",
"options",
")",
"throws",
"Exception",
"{",
"if",
"(",
"options",
"==",
"null",
")",
"options",... | Create a new streaming profile
@param name the of the profile
@param displayName the display name of the profile
@param representations a collection of Maps with a transformation key
@param options additional options
@return the new streaming profile
@throws Exception an exception | [
"Create",
"a",
"new",
"streaming",
"profile"
] | train | https://github.com/cloudinary/cloudinary_java/blob/58ee1823180da2dea6a2eb7e5cf00d5a760f8aef/cloudinary-core/src/main/java/com/cloudinary/Api.java#L450-L469 |
aws/aws-sdk-java | aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/SamplingRuleUpdate.java | SamplingRuleUpdate.withAttributes | public SamplingRuleUpdate withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
Matches attributes derived from the request.
</p>
@param attributes
Matches attributes derived from the request.
@return Returns a reference to this object so that method calls can be chained together.
"""
... | java | public SamplingRuleUpdate withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"SamplingRuleUpdate",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Matches attributes derived from the request.
</p>
@param attributes
Matches attributes derived from the request.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Matches",
"attributes",
"derived",
"from",
"the",
"request",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/SamplingRuleUpdate.java#L586-L589 |
stephenc/redmine-java-api | src/main/java/org/redmine/ta/internal/RedmineJSONParser.java | RedmineJSONParser.getShortDateOrNull | private static Date getShortDateOrNull(JSONObject obj, String field)
throws JSONException {
"""
Fetches an optional date from an object.
@param obj
object to get a field from.
@param field
field to get a value from.
@throws RedmineFormatException
if value is not valid
"""
final String dateSt... | java | private static Date getShortDateOrNull(JSONObject obj, String field)
throws JSONException {
final String dateStr = JsonInput.getStringOrNull(obj, field);
if (dateStr == null) {
return null;
}
final SimpleDateFormat dateFormat;
if (dateStr.length() >= 5 && dateStr.... | [
"private",
"static",
"Date",
"getShortDateOrNull",
"(",
"JSONObject",
"obj",
",",
"String",
"field",
")",
"throws",
"JSONException",
"{",
"final",
"String",
"dateStr",
"=",
"JsonInput",
".",
"getStringOrNull",
"(",
"obj",
",",
"field",
")",
";",
"if",
"(",
"... | Fetches an optional date from an object.
@param obj
object to get a field from.
@param field
field to get a value from.
@throws RedmineFormatException
if value is not valid | [
"Fetches",
"an",
"optional",
"date",
"from",
"an",
"object",
"."
] | train | https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/RedmineJSONParser.java#L586-L603 |
micronaut-projects/micronaut-core | cli/src/main/groovy/io/micronaut/cli/console/logging/MicronautConsole.java | MicronautConsole.indicateProgress | @Override
public void indicateProgress(int number, int total) {
"""
Indicate progress for a number and total.
@param number The current number
@param total The total number
"""
progressIndicatorActive = true;
String currMsg = lastMessage;
try {
updateStatus(currMsg ... | java | @Override
public void indicateProgress(int number, int total) {
progressIndicatorActive = true;
String currMsg = lastMessage;
try {
updateStatus(currMsg + ' ' + number + " of " + total);
} finally {
lastMessage = currMsg;
}
} | [
"@",
"Override",
"public",
"void",
"indicateProgress",
"(",
"int",
"number",
",",
"int",
"total",
")",
"{",
"progressIndicatorActive",
"=",
"true",
";",
"String",
"currMsg",
"=",
"lastMessage",
";",
"try",
"{",
"updateStatus",
"(",
"currMsg",
"+",
"'",
"'",
... | Indicate progress for a number and total.
@param number The current number
@param total The total number | [
"Indicate",
"progress",
"for",
"a",
"number",
"and",
"total",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/console/logging/MicronautConsole.java#L641-L650 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/impl/common/BaseFileCopier.java | BaseFileCopier.generateRemoteFilepathForNode | public static String generateRemoteFilepathForNode(final INodeEntry node, final String scriptfileName) {
"""
Return a temporary filepath for a file to be copied to the node, given the input filename (without directory
path)
@param node the destination node
@param scriptfileName the name of the file ... | java | public static String generateRemoteFilepathForNode(final INodeEntry node, final String scriptfileName) {
return generateRemoteFilepathForNode(node, scriptfileName, null);
} | [
"public",
"static",
"String",
"generateRemoteFilepathForNode",
"(",
"final",
"INodeEntry",
"node",
",",
"final",
"String",
"scriptfileName",
")",
"{",
"return",
"generateRemoteFilepathForNode",
"(",
"node",
",",
"scriptfileName",
",",
"null",
")",
";",
"}"
] | Return a temporary filepath for a file to be copied to the node, given the input filename (without directory
path)
@param node the destination node
@param scriptfileName the name of the file to copy
@return a filepath specifying destination of the file to copy that should be unique for the node and current
... | [
"Return",
"a",
"temporary",
"filepath",
"for",
"a",
"file",
"to",
"be",
"copied",
"to",
"the",
"node",
"given",
"the",
"input",
"filename",
"(",
"without",
"directory",
"path",
")"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/impl/common/BaseFileCopier.java#L127-L129 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/tools/net/EchoClient.java | EchoClient.sendMessage | public String sendMessage(String message) {
"""
Sends the given {@link String message} to the {@link EchoClient}.
@param message {@link String} containing the message to send.
@return the {@link String response} returned by the {@link EchoServer}.
@see #newSocket(String, int)
@see #sendMessage(Socket, String... | java | public String sendMessage(String message) {
Socket socket = null;
try {
socket = newSocket(getHost(), getPort());
return receiveResponse(sendMessage(socket, message));
}
finally {
close(socket);
}
} | [
"public",
"String",
"sendMessage",
"(",
"String",
"message",
")",
"{",
"Socket",
"socket",
"=",
"null",
";",
"try",
"{",
"socket",
"=",
"newSocket",
"(",
"getHost",
"(",
")",
",",
"getPort",
"(",
")",
")",
";",
"return",
"receiveResponse",
"(",
"sendMess... | Sends the given {@link String message} to the {@link EchoClient}.
@param message {@link String} containing the message to send.
@return the {@link String response} returned by the {@link EchoServer}.
@see #newSocket(String, int)
@see #sendMessage(Socket, String)
@see #receiveResponse(Socket) | [
"Sends",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"to",
"the",
"{",
"@link",
"EchoClient",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/tools/net/EchoClient.java#L162-L172 |
OpenLiberty/open-liberty | dev/com.ibm.ws.concurrent.mp.1.0/src/com/ibm/ws/concurrent/mp/ManagedCompletableFuture.java | ManagedCompletableFuture.runAsync | @Trivial
public static CompletableFuture<Void> runAsync(Runnable action) {
"""
Because CompletableFuture.runAsync is static, this is not a true override.
It will be difficult for the user to invoke this method because they would need to get the class
of the CompletableFuture implementation and locate the sta... | java | @Trivial
public static CompletableFuture<Void> runAsync(Runnable action) {
throw new UnsupportedOperationException(Tr.formatMessage(tc, "CWWKC1156.not.supported", "ManagedExecutor.runAsync"));
} | [
"@",
"Trivial",
"public",
"static",
"CompletableFuture",
"<",
"Void",
">",
"runAsync",
"(",
"Runnable",
"action",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"Tr",
".",
"formatMessage",
"(",
"tc",
",",
"\"CWWKC1156.not.supported\"",
",",
"\"Man... | Because CompletableFuture.runAsync is static, this is not a true override.
It will be difficult for the user to invoke this method because they would need to get the class
of the CompletableFuture implementation and locate the static runAsync method on that.
@throws UnsupportedOperationException directing the user to ... | [
"Because",
"CompletableFuture",
".",
"runAsync",
"is",
"static",
"this",
"is",
"not",
"a",
"true",
"override",
".",
"It",
"will",
"be",
"difficult",
"for",
"the",
"user",
"to",
"invoke",
"this",
"method",
"because",
"they",
"would",
"need",
"to",
"get",
"t... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent.mp.1.0/src/com/ibm/ws/concurrent/mp/ManagedCompletableFuture.java#L438-L441 |
code4everything/util | src/main/java/com/zhazhapan/util/FileExecutor.java | FileExecutor.mergeFiles | private static void mergeFiles(File file, File destinationFile, String filter) throws IOException {
"""
合并文件
@param file 待读取文件
@param destinationFile 目标文件
@param filter 过滤规则
@throws IOException 异常
"""
String content = readFile(file);
if (Checker.isNotEmpty(filter)) {
content... | java | private static void mergeFiles(File file, File destinationFile, String filter) throws IOException {
String content = readFile(file);
if (Checker.isNotEmpty(filter)) {
content = content.replaceAll(filter, ValueConsts.EMPTY_STRING);
}
saveFile(destinationFile, content, ValueCon... | [
"private",
"static",
"void",
"mergeFiles",
"(",
"File",
"file",
",",
"File",
"destinationFile",
",",
"String",
"filter",
")",
"throws",
"IOException",
"{",
"String",
"content",
"=",
"readFile",
"(",
"file",
")",
";",
"if",
"(",
"Checker",
".",
"isNotEmpty",
... | 合并文件
@param file 待读取文件
@param destinationFile 目标文件
@param filter 过滤规则
@throws IOException 异常 | [
"合并文件"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/FileExecutor.java#L766-L772 |
googleads/googleads-java-lib | modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/utils/v201809/shopping/ProductPartitionTreeImpl.java | ProductPartitionTreeImpl.createNonEmptyAdGroupTree | private static ProductPartitionTreeImpl createNonEmptyAdGroupTree(Long adGroupId,
ListMultimap<Long, AdGroupCriterion> parentIdMap) {
"""
Returns a new tree based on a non-empty collection of ad group criteria. All parameters
required.
@param adGroupId the ID of the ad group
@param parentIdMap the multi... | java | private static ProductPartitionTreeImpl createNonEmptyAdGroupTree(Long adGroupId,
ListMultimap<Long, AdGroupCriterion> parentIdMap) {
Preconditions.checkNotNull(adGroupId, "Null ad group ID");
Preconditions.checkArgument(!parentIdMap.isEmpty(),
"parentIdMap passed for ad group ID %s is empty", adG... | [
"private",
"static",
"ProductPartitionTreeImpl",
"createNonEmptyAdGroupTree",
"(",
"Long",
"adGroupId",
",",
"ListMultimap",
"<",
"Long",
",",
"AdGroupCriterion",
">",
"parentIdMap",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"adGroupId",
",",
"\"Null ad group... | Returns a new tree based on a non-empty collection of ad group criteria. All parameters
required.
@param adGroupId the ID of the ad group
@param parentIdMap the multimap from parent product partition ID to child criteria
@return a new ProductPartitionTree | [
"Returns",
"a",
"new",
"tree",
"based",
"on",
"a",
"non",
"-",
"empty",
"collection",
"of",
"ad",
"group",
"criteria",
".",
"All",
"parameters",
"required",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/utils/v201809/shopping/ProductPartitionTreeImpl.java#L286-L318 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java | AbstractClassFileWriter.pushNewInstance | protected void pushNewInstance(GeneratorAdapter generatorAdapter, Type typeToInstantiate) {
"""
Push the instantiation of the given type.
@param generatorAdapter The generator adaptor
@param typeToInstantiate The type to instantiate.
"""
generatorAdapter.newInstance(typeToInstantiate);
genera... | java | protected void pushNewInstance(GeneratorAdapter generatorAdapter, Type typeToInstantiate) {
generatorAdapter.newInstance(typeToInstantiate);
generatorAdapter.dup();
generatorAdapter.invokeConstructor(typeToInstantiate, METHOD_DEFAULT_CONSTRUCTOR);
} | [
"protected",
"void",
"pushNewInstance",
"(",
"GeneratorAdapter",
"generatorAdapter",
",",
"Type",
"typeToInstantiate",
")",
"{",
"generatorAdapter",
".",
"newInstance",
"(",
"typeToInstantiate",
")",
";",
"generatorAdapter",
".",
"dup",
"(",
")",
";",
"generatorAdapte... | Push the instantiation of the given type.
@param generatorAdapter The generator adaptor
@param typeToInstantiate The type to instantiate. | [
"Push",
"the",
"instantiation",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java#L1108-L1112 |
Quickhull3d/quickhull3d | src/main/java/com/github/quickhull3d/Face.java | Face.createTriangle | public static Face createTriangle(Vertex v0, Vertex v1, Vertex v2, double minArea) {
"""
Constructs a triangule Face from vertices v0, v1, and v2.
@param v0
first vertex
@param v1
second vertex
@param v2
third vertex
"""
Face face = new Face();
HalfEdge he0 = new HalfEdge(v0, face);
... | java | public static Face createTriangle(Vertex v0, Vertex v1, Vertex v2, double minArea) {
Face face = new Face();
HalfEdge he0 = new HalfEdge(v0, face);
HalfEdge he1 = new HalfEdge(v1, face);
HalfEdge he2 = new HalfEdge(v2, face);
he0.prev = he2;
he0.next = he1;
he1.p... | [
"public",
"static",
"Face",
"createTriangle",
"(",
"Vertex",
"v0",
",",
"Vertex",
"v1",
",",
"Vertex",
"v2",
",",
"double",
"minArea",
")",
"{",
"Face",
"face",
"=",
"new",
"Face",
"(",
")",
";",
"HalfEdge",
"he0",
"=",
"new",
"HalfEdge",
"(",
"v0",
... | Constructs a triangule Face from vertices v0, v1, and v2.
@param v0
first vertex
@param v1
second vertex
@param v2
third vertex | [
"Constructs",
"a",
"triangule",
"Face",
"from",
"vertices",
"v0",
"v1",
"and",
"v2",
"."
] | train | https://github.com/Quickhull3d/quickhull3d/blob/3f80953b86c46385e84730e5d2a1745cbfa12703/src/main/java/com/github/quickhull3d/Face.java#L108-L126 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/quantiles/Util.java | Util.checkPreLongsFlagsCap | static boolean checkPreLongsFlagsCap(final int preambleLongs, final int flags, final long memCapBytes) {
"""
Checks the consistency of the flag bits and the state of preambleLong and the memory
capacity and returns the empty state.
@param preambleLongs the size of preamble in longs
@param flags the flags field
... | java | static boolean checkPreLongsFlagsCap(final int preambleLongs, final int flags, final long memCapBytes) {
final boolean empty = (flags & EMPTY_FLAG_MASK) > 0; //Preamble flags empty state
final int minPre = Family.QUANTILES.getMinPreLongs(); //1
final int maxPre = Family.QUANTILES.getMaxPreLongs(); //2
f... | [
"static",
"boolean",
"checkPreLongsFlagsCap",
"(",
"final",
"int",
"preambleLongs",
",",
"final",
"int",
"flags",
",",
"final",
"long",
"memCapBytes",
")",
"{",
"final",
"boolean",
"empty",
"=",
"(",
"flags",
"&",
"EMPTY_FLAG_MASK",
")",
">",
"0",
";",
"//Pr... | Checks the consistency of the flag bits and the state of preambleLong and the memory
capacity and returns the empty state.
@param preambleLongs the size of preamble in longs
@param flags the flags field
@param memCapBytes the memory capacity
@return the value of the empty state | [
"Checks",
"the",
"consistency",
"of",
"the",
"flag",
"bits",
"and",
"the",
"state",
"of",
"preambleLong",
"and",
"the",
"memory",
"capacity",
"and",
"returns",
"the",
"empty",
"state",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/Util.java#L241-L256 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java | JDBC4CallableStatement.setTimestamp | @Override
public void setTimestamp(String parameterName, Timestamp x) throws SQLException {
"""
Sets the designated parameter to the given java.sql.Timestamp value.
"""
checkClosed();
throw SQLError.noSupport();
} | java | @Override
public void setTimestamp(String parameterName, Timestamp x) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"void",
"setTimestamp",
"(",
"String",
"parameterName",
",",
"Timestamp",
"x",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Sets the designated parameter to the given java.sql.Timestamp value. | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"java",
".",
"sql",
".",
"Timestamp",
"value",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java#L903-L908 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java | NetworkServiceDescriptorAgent.createSecurity | @Help(help = "Create the Security of a NetworkServiceDescriptor with specific id")
public Security createSecurity(final String idNSD, final Security security) throws SDKException {
"""
Add a new Security object to a NetworkServiceDescriptor.
@param idNSD the ID of the NetworkServiceDescriptor
@param security... | java | @Help(help = "Create the Security of a NetworkServiceDescriptor with specific id")
public Security createSecurity(final String idNSD, final Security security) throws SDKException {
String url = idNSD + "/security" + "/";
return (Security) requestPost(url, security);
} | [
"@",
"Help",
"(",
"help",
"=",
"\"Create the Security of a NetworkServiceDescriptor with specific id\"",
")",
"public",
"Security",
"createSecurity",
"(",
"final",
"String",
"idNSD",
",",
"final",
"Security",
"security",
")",
"throws",
"SDKException",
"{",
"String",
"ur... | Add a new Security object to a NetworkServiceDescriptor.
@param idNSD the ID of the NetworkServiceDescriptor
@param security the Security object to add
@return the new Security object
@throws SDKException if the request fails | [
"Add",
"a",
"new",
"Security",
"object",
"to",
"a",
"NetworkServiceDescriptor",
"."
] | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java#L426-L430 |
kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-controller-plugin/src/main/java/org/kie/server/gateway/KieServerGateway.java | KieServerGateway.getContainer | @SuppressWarnings("unchecked")
public KieContainerResource getContainer(String serverUrl, String container) {
"""
Verify the container status on remote process server.
@param serverUrl remote process server URL
@param container container id
@return KieContainerResource with status or null if the c... | java | @SuppressWarnings("unchecked")
public KieContainerResource getContainer(String serverUrl, String container) {
// in case of container is not instantiated the response doesn't parse ServiceResponse
String response = client.target(serverUrl)
.path("containers")
.path(container... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"KieContainerResource",
"getContainer",
"(",
"String",
"serverUrl",
",",
"String",
"container",
")",
"{",
"// in case of container is not instantiated the response doesn't parse ServiceResponse",
"String",
"response",
... | Verify the container status on remote process server.
@param serverUrl remote process server URL
@param container container id
@return KieContainerResource with status or null if the container in not instantiated | [
"Verify",
"the",
"container",
"status",
"on",
"remote",
"process",
"server",
"."
] | train | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-controller-plugin/src/main/java/org/kie/server/gateway/KieServerGateway.java#L57-L70 |
UrielCh/ovh-java-sdk | ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java | ApiOvhVps.serviceName_veeam_restorePoints_GET | public ArrayList<Long> serviceName_veeam_restorePoints_GET(String serviceName, Date creationTime) throws IOException {
"""
Veeam restore points for the VPS
REST: GET /vps/{serviceName}/veeam/restorePoints
@param creationTime [required] Filter the value of creationTime property (like)
@param serviceName [requi... | java | public ArrayList<Long> serviceName_veeam_restorePoints_GET(String serviceName, Date creationTime) throws IOException {
String qPath = "/vps/{serviceName}/veeam/restorePoints";
StringBuilder sb = path(qPath, serviceName);
query(sb, "creationTime", creationTime);
String resp = exec(qPath, "GET", sb.toString(), nu... | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_veeam_restorePoints_GET",
"(",
"String",
"serviceName",
",",
"Date",
"creationTime",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/vps/{serviceName}/veeam/restorePoints\"",
";",
"StringBuilder",
"sb",
... | Veeam restore points for the VPS
REST: GET /vps/{serviceName}/veeam/restorePoints
@param creationTime [required] Filter the value of creationTime property (like)
@param serviceName [required] The internal name of your VPS offer | [
"Veeam",
"restore",
"points",
"for",
"the",
"VPS"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java#L717-L723 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java | JavacProcessingEnvironment.handleException | private void handleException(String key, Exception e) {
"""
Handle a security exception thrown during initializing the
Processor iterator.
"""
if (e != null) {
log.error(key, e.getLocalizedMessage());
throw new Abort(e);
} else {
log.error(key);
... | java | private void handleException(String key, Exception e) {
if (e != null) {
log.error(key, e.getLocalizedMessage());
throw new Abort(e);
} else {
log.error(key);
throw new Abort();
}
} | [
"private",
"void",
"handleException",
"(",
"String",
"key",
",",
"Exception",
"e",
")",
"{",
"if",
"(",
"e",
"!=",
"null",
")",
"{",
"log",
".",
"error",
"(",
"key",
",",
"e",
".",
"getLocalizedMessage",
"(",
")",
")",
";",
"throw",
"new",
"Abort",
... | Handle a security exception thrown during initializing the
Processor iterator. | [
"Handle",
"a",
"security",
"exception",
"thrown",
"during",
"initializing",
"the",
"Processor",
"iterator",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java#L384-L392 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/TableRow.java | TableRow.setCellMerge | public void setCellMerge(final int colIndex, final int rowMerge, final int columnMerge) throws IOException {
"""
Set the merging of multiple cells to one cell.
@param colIndex The column, 0 is the first column
@param rowMerge the number of rows to merge
@param columnMerge the number of cells to merge
@... | java | public void setCellMerge(final int colIndex, final int rowMerge, final int columnMerge) throws IOException {
if (rowMerge <= 0 || columnMerge <= 0) return;
if (rowMerge <= 1 && columnMerge <= 1) return;
this.parent.setCellMerge(this.rowIndex, colIndex, rowMerge, columnMerge);
} | [
"public",
"void",
"setCellMerge",
"(",
"final",
"int",
"colIndex",
",",
"final",
"int",
"rowMerge",
",",
"final",
"int",
"columnMerge",
")",
"throws",
"IOException",
"{",
"if",
"(",
"rowMerge",
"<=",
"0",
"||",
"columnMerge",
"<=",
"0",
")",
"return",
";",... | Set the merging of multiple cells to one cell.
@param colIndex The column, 0 is the first column
@param rowMerge the number of rows to merge
@param columnMerge the number of cells to merge
@throws IOException if the cells can't be merged | [
"Set",
"the",
"merging",
"of",
"multiple",
"cells",
"to",
"one",
"cell",
"."
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/TableRow.java#L160-L165 |
duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/rest/ContentRest.java | ContentRest.updateContentProperties | @POST
public Response updateContentProperties(@PathParam("spaceID") String spaceID,
@PathParam("contentID") String contentID,
@QueryParam("storeID") String storeID) {
"""
see ContentResource.updateContentProperties()
@re... | java | @POST
public Response updateContentProperties(@PathParam("spaceID") String spaceID,
@PathParam("contentID") String contentID,
@QueryParam("storeID") String storeID) {
StringBuilder msg = new StringBuilder("updating conte... | [
"@",
"POST",
"public",
"Response",
"updateContentProperties",
"(",
"@",
"PathParam",
"(",
"\"spaceID\"",
")",
"String",
"spaceID",
",",
"@",
"PathParam",
"(",
"\"contentID\"",
")",
"String",
"contentID",
",",
"@",
"QueryParam",
"(",
"\"storeID\"",
")",
"String",... | see ContentResource.updateContentProperties()
@return 200 response indicating content properties updated successfully | [
"see",
"ContentResource",
".",
"updateContentProperties",
"()"
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/rest/ContentRest.java#L314-L342 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.getMergeRequestByIid | public GitlabMergeRequest getMergeRequestByIid(Serializable projectId, Integer mergeRequestIid) throws IOException {
"""
Return Merge Request.
@param projectId The id of the project
@param mergeRequestIid The internal id of the merge request
@return the Gitlab Merge Request
@throws IOException on gitla... | java | public GitlabMergeRequest getMergeRequestByIid(Serializable projectId, Integer mergeRequestIid) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabMergeRequest.URL + "/" + mergeRequestIid;
return retrieve().to(tailUrl, GitlabMergeRequest.class);
} | [
"public",
"GitlabMergeRequest",
"getMergeRequestByIid",
"(",
"Serializable",
"projectId",
",",
"Integer",
"mergeRequestIid",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"GitlabProject",
".",
"URL",
"+",
"\"/\"",
"+",
"sanitizeProjectId",
"(",
"project... | Return Merge Request.
@param projectId The id of the project
@param mergeRequestIid The internal id of the merge request
@return the Gitlab Merge Request
@throws IOException on gitlab api call error | [
"Return",
"Merge",
"Request",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L1557-L1560 |
javabits/yar | yar-api/src/main/java/org/javabits/yar/TimeoutException.java | TimeoutException.newTimeoutException | public static TimeoutException newTimeoutException(String message, java.util.concurrent.TimeoutException cause) {
"""
Constructs a <tt>TimeoutException</tt> with the specified detail
message.
@param message the detail message
@param cause the original {@code TimeoutException}
"""
return new Time... | java | public static TimeoutException newTimeoutException(String message, java.util.concurrent.TimeoutException cause) {
return new TimeoutException(message, cause);
} | [
"public",
"static",
"TimeoutException",
"newTimeoutException",
"(",
"String",
"message",
",",
"java",
".",
"util",
".",
"concurrent",
".",
"TimeoutException",
"cause",
")",
"{",
"return",
"new",
"TimeoutException",
"(",
"message",
",",
"cause",
")",
";",
"}"
] | Constructs a <tt>TimeoutException</tt> with the specified detail
message.
@param message the detail message
@param cause the original {@code TimeoutException} | [
"Constructs",
"a",
"<tt",
">",
"TimeoutException<",
"/",
"tt",
">",
"with",
"the",
"specified",
"detail",
"message",
"."
] | train | https://github.com/javabits/yar/blob/e146a86611ca4831e8334c9a98fd7086cee9c03e/yar-api/src/main/java/org/javabits/yar/TimeoutException.java#L114-L116 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.identity_user_POST | public void identity_user_POST(String description, String email, String group, String login, String password) throws IOException {
"""
Create a new user
REST: POST /me/identity/user
@param login [required] User's login
@param description [required] User's description
@param email [required] User's email
@pa... | java | public void identity_user_POST(String description, String email, String group, String login, String password) throws IOException {
String qPath = "/me/identity/user";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "description", description);
addBody(o, "e... | [
"public",
"void",
"identity_user_POST",
"(",
"String",
"description",
",",
"String",
"email",
",",
"String",
"group",
",",
"String",
"login",
",",
"String",
"password",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/identity/user\"",
";",
"Str... | Create a new user
REST: POST /me/identity/user
@param login [required] User's login
@param description [required] User's description
@param email [required] User's email
@param password [required] User's password
@param group [required] User's group | [
"Create",
"a",
"new",
"user"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L186-L196 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/BaseRTMPHandler.java | BaseRTMPHandler.onStreamBytesRead | protected void onStreamBytesRead(RTMPConnection conn, Channel channel, Header source, BytesRead streamBytesRead) {
"""
Stream bytes read event handler.
@param conn
Connection
@param channel
Channel
@param source
Header
@param streamBytesRead
Bytes read event context
"""
conn.receivedBytesRea... | java | protected void onStreamBytesRead(RTMPConnection conn, Channel channel, Header source, BytesRead streamBytesRead) {
conn.receivedBytesRead(streamBytesRead.getBytesRead());
} | [
"protected",
"void",
"onStreamBytesRead",
"(",
"RTMPConnection",
"conn",
",",
"Channel",
"channel",
",",
"Header",
"source",
",",
"BytesRead",
"streamBytesRead",
")",
"{",
"conn",
".",
"receivedBytesRead",
"(",
"streamBytesRead",
".",
"getBytesRead",
"(",
")",
")"... | Stream bytes read event handler.
@param conn
Connection
@param channel
Channel
@param source
Header
@param streamBytesRead
Bytes read event context | [
"Stream",
"bytes",
"read",
"event",
"handler",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/BaseRTMPHandler.java#L341-L343 |
w3c/epubcheck | src/main/java/com/adobe/epubcheck/vocab/Property.java | Property.newFrom | public static Property newFrom(String name, String base, String prefix, Enum<?> enumee) {
"""
Creates a new instance from a short name, a prefix, and a stem URI, and an
optional {@link Enum} item used to represent this property in known
vocabularies.
@param name
the short name of the property (aka "reference... | java | public static Property newFrom(String name, String base, String prefix, Enum<?> enumee)
{
return new Property(name, base, prefix, enumee);
} | [
"public",
"static",
"Property",
"newFrom",
"(",
"String",
"name",
",",
"String",
"base",
",",
"String",
"prefix",
",",
"Enum",
"<",
"?",
">",
"enumee",
")",
"{",
"return",
"new",
"Property",
"(",
"name",
",",
"base",
",",
"prefix",
",",
"enumee",
")",
... | Creates a new instance from a short name, a prefix, and a stem URI, and an
optional {@link Enum} item used to represent this property in known
vocabularies.
@param name
the short name of the property (aka "reference").
@param base
the stem URI used to compute the full URI value.
@param prefix
the prefix used in the CU... | [
"Creates",
"a",
"new",
"instance",
"from",
"a",
"short",
"name",
"a",
"prefix",
"and",
"a",
"stem",
"URI",
"and",
"an",
"optional",
"{",
"@link",
"Enum",
"}",
"item",
"used",
"to",
"represent",
"this",
"property",
"in",
"known",
"vocabularies",
"."
] | train | https://github.com/w3c/epubcheck/blob/4d5a24d9f2878a2a5497eb11c036cc18fe2c0a78/src/main/java/com/adobe/epubcheck/vocab/Property.java#L60-L63 |
redkale/redkale | src/org/redkale/source/EntityInfo.java | EntityInfo.getFieldValue | public Serializable getFieldValue(Attribute<T, Serializable> attr, T entity) {
"""
数据库的值转换成数字段值
@param attr Attribute
@param entity 记录对象
@return Object
"""
Serializable val = attr.get(entity);
CryptHandler cryptHandler = attr.attach();
if (cryptHandler != null) val = (Serial... | java | public Serializable getFieldValue(Attribute<T, Serializable> attr, T entity) {
Serializable val = attr.get(entity);
CryptHandler cryptHandler = attr.attach();
if (cryptHandler != null) val = (Serializable) cryptHandler.decrypt(val);
return val;
} | [
"public",
"Serializable",
"getFieldValue",
"(",
"Attribute",
"<",
"T",
",",
"Serializable",
">",
"attr",
",",
"T",
"entity",
")",
"{",
"Serializable",
"val",
"=",
"attr",
".",
"get",
"(",
"entity",
")",
";",
"CryptHandler",
"cryptHandler",
"=",
"attr",
"."... | 数据库的值转换成数字段值
@param attr Attribute
@param entity 记录对象
@return Object | [
"数据库的值转换成数字段值"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/source/EntityInfo.java#L920-L925 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/DefaultValueChangeDetector.java | DefaultValueChangeDetector.hasValueChanged | public boolean hasValueChanged(Object oldValue, Object newValue) {
"""
Determines if there has been a change in value between the provided arguments. As
many objects do not implement #equals in a manner that is strict enough for the
requirements of this class, difference is determined using <code>!=</code>,
how... | java | public boolean hasValueChanged(Object oldValue, Object newValue) {
if( oldValue != null && classesWithSafeEquals.contains( oldValue.getClass() ) )
return !oldValue.equals( newValue );
return oldValue != newValue;
} | [
"public",
"boolean",
"hasValueChanged",
"(",
"Object",
"oldValue",
",",
"Object",
"newValue",
")",
"{",
"if",
"(",
"oldValue",
"!=",
"null",
"&&",
"classesWithSafeEquals",
".",
"contains",
"(",
"oldValue",
".",
"getClass",
"(",
")",
")",
")",
"return",
"!",
... | Determines if there has been a change in value between the provided arguments. As
many objects do not implement #equals in a manner that is strict enough for the
requirements of this class, difference is determined using <code>!=</code>,
however, to improve accuracy #equals will be used when this is definitely safe e.g... | [
"Determines",
"if",
"there",
"has",
"been",
"a",
"change",
"in",
"value",
"between",
"the",
"provided",
"arguments",
".",
"As",
"many",
"objects",
"do",
"not",
"implement",
"#equals",
"in",
"a",
"manner",
"that",
"is",
"strict",
"enough",
"for",
"the",
"re... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/DefaultValueChangeDetector.java#L57-L62 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.