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 |
|---|---|---|---|---|---|---|---|---|---|---|
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/returns/PackageUrl.java | PackageUrl.createPackageUrl | public static MozuUrl createPackageUrl(String responseFields, String returnId) {
"""
Get Resource Url for CreatePackage
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Atte... | java | public static MozuUrl createPackageUrl(String responseFields, String returnId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/returns/{returnId}/packages?responseFields={responseFields}");
formatter.formatUrl("responseFields", responseFields);
formatter.formatUrl("returnId", returnId);
return ... | [
"public",
"static",
"MozuUrl",
"createPackageUrl",
"(",
"String",
"responseFields",
",",
"String",
"returnId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/returns/{returnId}/packages?responseFields={responseFields}\"",
")",
";",
... | Get Resource Url for CreatePackage
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@param returnId Unique iden... | [
"Get",
"Resource",
"Url",
"for",
"CreatePackage"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/returns/PackageUrl.java#L54-L60 |
zamrokk/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Chain.java | Chain.setMemberServicesUrl | public void setMemberServicesUrl(String url, String pem) throws CertificateException {
"""
Set the member services URL
@param url Member services URL of the form: "grpc://host:port" or "grpcs://host:port"
@param pem permission
@throws CertificateException exception
"""
this.setMemberServices(new Mem... | java | public void setMemberServicesUrl(String url, String pem) throws CertificateException {
this.setMemberServices(new MemberServicesImpl(url,pem));
} | [
"public",
"void",
"setMemberServicesUrl",
"(",
"String",
"url",
",",
"String",
"pem",
")",
"throws",
"CertificateException",
"{",
"this",
".",
"setMemberServices",
"(",
"new",
"MemberServicesImpl",
"(",
"url",
",",
"pem",
")",
")",
";",
"}"
] | Set the member services URL
@param url Member services URL of the form: "grpc://host:port" or "grpcs://host:port"
@param pem permission
@throws CertificateException exception | [
"Set",
"the",
"member",
"services",
"URL"
] | train | https://github.com/zamrokk/fabric-sdk-java/blob/d4993ca602f72d412cd682e1b92e805e48b27afa/src/main/java/org/hyperledger/fabric/sdk/Chain.java#L135-L137 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java | ServicesInner.stopAsync | public Observable<Void> stopAsync(String groupName, String serviceName) {
"""
Stop service.
The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the servic... | java | public Observable<Void> stopAsync(String groupName, String serviceName) {
return stopWithServiceResponseAsync(groupName, serviceName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
... | [
"public",
"Observable",
"<",
"Void",
">",
"stopAsync",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
")",
"{",
"return",
"stopWithServiceResponseAsync",
"(",
"groupName",
",",
"serviceName",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponse... | Stop service.
The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped.
@param groupName Name of the resource group
@param serviceName Name o... | [
"Stop",
"service",
".",
"The",
"services",
"resource",
"is",
"the",
"top",
"-",
"level",
"resource",
"that",
"represents",
"the",
"Data",
"Migration",
"Service",
".",
"This",
"action",
"stops",
"the",
"service",
"and",
"the",
"service",
"cannot",
"be",
"used... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java#L1218-L1225 |
davidmoten/rxjava-extras | src/main/java/com/github/davidmoten/rx/Transformers.java | Transformers.toListUntil | public static final <T> Transformer<T, List<T>> toListUntil(Func1<? super T, Boolean> predicate,
int capacityHint) {
"""
Buffers the elements into continuous, non-overlapping Lists where the
boundary is determined by a predicate receiving each item, after being
buffered, and returns true to indicate ... | java | public static final <T> Transformer<T, List<T>> toListUntil(Func1<? super T, Boolean> predicate,
int capacityHint) {
return bufferUntil(predicate, capacityHint);
} | [
"public",
"static",
"final",
"<",
"T",
">",
"Transformer",
"<",
"T",
",",
"List",
"<",
"T",
">",
">",
"toListUntil",
"(",
"Func1",
"<",
"?",
"super",
"T",
",",
"Boolean",
">",
"predicate",
",",
"int",
"capacityHint",
")",
"{",
"return",
"bufferUntil",
... | Buffers the elements into continuous, non-overlapping Lists where the
boundary is determined by a predicate receiving each item, after being
buffered, and returns true to indicate a new buffer should start.
<p>
The operator won't return an empty first or last buffer.
<dl>
<dt><b>Backpressure Support:</b></dt>
<dd>Thi... | [
"Buffers",
"the",
"elements",
"into",
"continuous",
"non",
"-",
"overlapping",
"Lists",
"where",
"the",
"boundary",
"is",
"determined",
"by",
"a",
"predicate",
"receiving",
"each",
"item",
"after",
"being",
"buffered",
"and",
"returns",
"true",
"to",
"indicate",... | train | https://github.com/davidmoten/rxjava-extras/blob/a91d2ba7d454843250e0b0fce36084f9fb02a551/src/main/java/com/github/davidmoten/rx/Transformers.java#L1148-L1151 |
drewnoakes/metadata-extractor | Source/com/drew/metadata/Directory.java | Directory.setDate | public void setDate(int tagType, @NotNull java.util.Date value) {
"""
Sets a <code>java.util.Date</code> value for the specified tag.
@param tagType the tag's value as an int
@param value the value for the specified tag as a java.util.Date
"""
setObject(tagType, value);
} | java | public void setDate(int tagType, @NotNull java.util.Date value)
{
setObject(tagType, value);
} | [
"public",
"void",
"setDate",
"(",
"int",
"tagType",
",",
"@",
"NotNull",
"java",
".",
"util",
".",
"Date",
"value",
")",
"{",
"setObject",
"(",
"tagType",
",",
"value",
")",
";",
"}"
] | Sets a <code>java.util.Date</code> value for the specified tag.
@param tagType the tag's value as an int
@param value the value for the specified tag as a java.util.Date | [
"Sets",
"a",
"<code",
">",
"java",
".",
"util",
".",
"Date<",
"/",
"code",
">",
"value",
"for",
"the",
"specified",
"tag",
"."
] | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/metadata/Directory.java#L341-L344 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java | PrimaveraReader.addHours | private void addHours(ProjectCalendarDateRanges ranges, Record hoursRecord) {
"""
Parses a record containing hours and add them to a container.
@param ranges hours container
@param hoursRecord hours record
"""
if (hoursRecord.getValue() != null)
{
String[] wh = hoursRecord.getValue().s... | java | private void addHours(ProjectCalendarDateRanges ranges, Record hoursRecord)
{
if (hoursRecord.getValue() != null)
{
String[] wh = hoursRecord.getValue().split("\\|");
try
{
String startText;
String endText;
if (wh[0].equals("s"))
... | [
"private",
"void",
"addHours",
"(",
"ProjectCalendarDateRanges",
"ranges",
",",
"Record",
"hoursRecord",
")",
"{",
"if",
"(",
"hoursRecord",
".",
"getValue",
"(",
")",
"!=",
"null",
")",
"{",
"String",
"[",
"]",
"wh",
"=",
"hoursRecord",
".",
"getValue",
"... | Parses a record containing hours and add them to a container.
@param ranges hours container
@param hoursRecord hours record | [
"Parses",
"a",
"record",
"containing",
"hours",
"and",
"add",
"them",
"to",
"a",
"container",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java#L410-L446 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/common/OnDiskSemanticSpace.java | OnDiskSemanticSpace.loadOffsetsFromFormat | private void loadOffsetsFromFormat(File file, SSpaceFormat format)
throws IOException {
"""
Loads the words and offets for each word's vector in the semantic space
file using the format as a guide to how the semantic space data is stored
in the file.
@param file a file containing semantic space d... | java | private void loadOffsetsFromFormat(File file, SSpaceFormat format)
throws IOException {
this.format = format;
spaceName = file.getName();
// NOTE: Use a LinkedHashMap here because this will ensure that the
// words are returned in the same row-order as the matrix. This
... | [
"private",
"void",
"loadOffsetsFromFormat",
"(",
"File",
"file",
",",
"SSpaceFormat",
"format",
")",
"throws",
"IOException",
"{",
"this",
".",
"format",
"=",
"format",
";",
"spaceName",
"=",
"file",
".",
"getName",
"(",
")",
";",
"// NOTE: Use a LinkedHashMap h... | Loads the words and offets for each word's vector in the semantic space
file using the format as a guide to how the semantic space data is stored
in the file.
@param file a file containing semantic space data
@param format the format of the data in the file
@throws IOException if any I/O exception occurs when reading... | [
"Loads",
"the",
"words",
"and",
"offets",
"for",
"each",
"word",
"s",
"vector",
"in",
"the",
"semantic",
"space",
"file",
"using",
"the",
"format",
"as",
"a",
"guide",
"to",
"how",
"the",
"semantic",
"space",
"data",
"is",
"stored",
"in",
"the",
"file",
... | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/common/OnDiskSemanticSpace.java#L191-L233 |
quattor/pan | panc/src/main/java/org/quattor/pan/parser/Token.java | Token.newToken | public static Token newToken(int ofKind, String image) {
"""
Returns a new Token object, by default. However, if you want, you can
create and return subclass objects based on the value of ofKind. Simply
add the cases to the switch for all those special cases. For example, if
you have a subclass of Token called ... | java | public static Token newToken(int ofKind, String image) {
switch (ofKind) {
case PanParserConstants.ANNOTATION:
return new AnnotationToken(ofKind, image);
default:
return new Token(ofKind, image);
}
} | [
"public",
"static",
"Token",
"newToken",
"(",
"int",
"ofKind",
",",
"String",
"image",
")",
"{",
"switch",
"(",
"ofKind",
")",
"{",
"case",
"PanParserConstants",
".",
"ANNOTATION",
":",
"return",
"new",
"AnnotationToken",
"(",
"ofKind",
",",
"image",
")",
... | Returns a new Token object, by default. However, if you want, you can
create and return subclass objects based on the value of ofKind. Simply
add the cases to the switch for all those special cases. For example, if
you have a subclass of Token called IDToken that you want to create if
ofKind is ID, simply add something... | [
"Returns",
"a",
"new",
"Token",
"object",
"by",
"default",
".",
"However",
"if",
"you",
"want",
"you",
"can",
"create",
"and",
"return",
"subclass",
"objects",
"based",
"on",
"the",
"value",
"of",
"ofKind",
".",
"Simply",
"add",
"the",
"cases",
"to",
"th... | train | https://github.com/quattor/pan/blob/009934a603dd0c08d3fa4bb7d9389c380a916f54/panc/src/main/java/org/quattor/pan/parser/Token.java#L111-L120 |
dkpro/dkpro-statistics | dkpro-statistics-significance/src/main/java/org/dkpro/statistics/significance/Significance.java | Significance.getSignificance | public static double getSignificance(double correlation1, double correlation2, int n1, int n2) throws MathException {
"""
Computes the significance of the difference between two correlations.
@see org.tud.sir.util.statistics.Significance.testCorrelations
"""
// transform to Fisher Z-values
... | java | public static double getSignificance(double correlation1, double correlation2, int n1, int n2) throws MathException {
// transform to Fisher Z-values
double zv1 = FisherZTransformation.transform(correlation1);
double zv2 = FisherZTransformation.transform(correlation2);
// diffe... | [
"public",
"static",
"double",
"getSignificance",
"(",
"double",
"correlation1",
",",
"double",
"correlation2",
",",
"int",
"n1",
",",
"int",
"n2",
")",
"throws",
"MathException",
"{",
"// transform to Fisher Z-values",
"double",
"zv1",
"=",
"FisherZTransformation",
... | Computes the significance of the difference between two correlations.
@see org.tud.sir.util.statistics.Significance.testCorrelations | [
"Computes",
"the",
"significance",
"of",
"the",
"difference",
"between",
"two",
"correlations",
"."
] | train | https://github.com/dkpro/dkpro-statistics/blob/0b0e93dc49223984964411cbc6df420ba796a8cb/dkpro-statistics-significance/src/main/java/org/dkpro/statistics/significance/Significance.java#L131-L143 |
alkacon/opencms-core | src/org/opencms/gwt/CmsVfsService.java | CmsVfsService.getPageInfo | public static CmsListInfoBean getPageInfo(CmsObject cms, CmsResource res) throws CmsException {
"""
Gets page information of a resource.<p>
@param cms the CMS context
@param res the resource
@return gets the page information for the given resource
@throws CmsException if the resource info can not be read... | java | public static CmsListInfoBean getPageInfo(CmsObject cms, CmsResource res) throws CmsException {
CmsListInfoBean result = new CmsListInfoBean();
addPageInfo(cms, res, result);
return result;
} | [
"public",
"static",
"CmsListInfoBean",
"getPageInfo",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"res",
")",
"throws",
"CmsException",
"{",
"CmsListInfoBean",
"result",
"=",
"new",
"CmsListInfoBean",
"(",
")",
";",
"addPageInfo",
"(",
"cms",
",",
"res",
",",
... | Gets page information of a resource.<p>
@param cms the CMS context
@param res the resource
@return gets the page information for the given resource
@throws CmsException if the resource info can not be read | [
"Gets",
"page",
"information",
"of",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsVfsService.java#L267-L272 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/Var2Data.java | Var2Data.getUnicodeString | public String getUnicodeString(Integer id, Integer type) {
"""
This method retrieves a String of the specified type,
belonging to the item with the specified unique ID.
@param id unique ID of entity to which this data belongs
@param type data type identifier
@return string containing required data
"""
... | java | public String getUnicodeString(Integer id, Integer type)
{
return (getUnicodeString(m_meta.getOffset(id, type)));
} | [
"public",
"String",
"getUnicodeString",
"(",
"Integer",
"id",
",",
"Integer",
"type",
")",
"{",
"return",
"(",
"getUnicodeString",
"(",
"m_meta",
".",
"getOffset",
"(",
"id",
",",
"type",
")",
")",
")",
";",
"}"
] | This method retrieves a String of the specified type,
belonging to the item with the specified unique ID.
@param id unique ID of entity to which this data belongs
@param type data type identifier
@return string containing required data | [
"This",
"method",
"retrieves",
"a",
"String",
"of",
"the",
"specified",
"type",
"belonging",
"to",
"the",
"item",
"with",
"the",
"specified",
"unique",
"ID",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/Var2Data.java#L176-L179 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java | ShapeGenerator.createBullet | public Shape createBullet(int x, int y, int diameter) {
"""
Return a path for a simple bullet.
@param x the X coordinate of the upper-left corner of the bullet
@param y the Y coordinate of the upper-left corner of the bullet
@param diameter the diameter of the bullet
@return a path represe... | java | public Shape createBullet(int x, int y, int diameter) {
return createEllipseInternal(x, y, diameter, diameter);
} | [
"public",
"Shape",
"createBullet",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"diameter",
")",
"{",
"return",
"createEllipseInternal",
"(",
"x",
",",
"y",
",",
"diameter",
",",
"diameter",
")",
";",
"}"
] | Return a path for a simple bullet.
@param x the X coordinate of the upper-left corner of the bullet
@param y the Y coordinate of the upper-left corner of the bullet
@param diameter the diameter of the bullet
@return a path representing the shape. | [
"Return",
"a",
"path",
"for",
"a",
"simple",
"bullet",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L486-L488 |
apache/groovy | subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java | Sql.executeInsert | public List<GroovyRowResult> executeInsert(String sql, String[] keyColumnNames, Object[] params) throws SQLException {
"""
Executes the given SQL statement (typically an INSERT statement).
This variant allows you to receive the values of any auto-generated columns,
such as an autoincrement ID field (or fields) w... | java | public List<GroovyRowResult> executeInsert(String sql, String[] keyColumnNames, Object[] params) throws SQLException {
return executeInsert(sql, Arrays.asList(params), Arrays.asList(keyColumnNames));
} | [
"public",
"List",
"<",
"GroovyRowResult",
">",
"executeInsert",
"(",
"String",
"sql",
",",
"String",
"[",
"]",
"keyColumnNames",
",",
"Object",
"[",
"]",
"params",
")",
"throws",
"SQLException",
"{",
"return",
"executeInsert",
"(",
"sql",
",",
"Arrays",
".",... | Executes the given SQL statement (typically an INSERT statement).
This variant allows you to receive the values of any auto-generated columns,
such as an autoincrement ID field (or fields) when you know the column name(s) of the ID field(s).
<p>
An array variant of {@link #executeInsert(String, List, List)}.
<p>
This m... | [
"Executes",
"the",
"given",
"SQL",
"statement",
"(",
"typically",
"an",
"INSERT",
"statement",
")",
".",
"This",
"variant",
"allows",
"you",
"to",
"receive",
"the",
"values",
"of",
"any",
"auto",
"-",
"generated",
"columns",
"such",
"as",
"an",
"autoincremen... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L2809-L2811 |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/classfile/ConstantStringInfo.java | ConstantStringInfo.make | static ConstantStringInfo make(ConstantPool cp, String str) {
"""
Will return either a new ConstantStringInfo object or one already in
the constant pool. If it is a new ConstantStringInfo, it will be
inserted into the pool.
"""
ConstantInfo ci = new ConstantStringInfo(cp, str);
return (Consta... | java | static ConstantStringInfo make(ConstantPool cp, String str) {
ConstantInfo ci = new ConstantStringInfo(cp, str);
return (ConstantStringInfo)cp.addConstant(ci);
} | [
"static",
"ConstantStringInfo",
"make",
"(",
"ConstantPool",
"cp",
",",
"String",
"str",
")",
"{",
"ConstantInfo",
"ci",
"=",
"new",
"ConstantStringInfo",
"(",
"cp",
",",
"str",
")",
";",
"return",
"(",
"ConstantStringInfo",
")",
"cp",
".",
"addConstant",
"(... | Will return either a new ConstantStringInfo object or one already in
the constant pool. If it is a new ConstantStringInfo, it will be
inserted into the pool. | [
"Will",
"return",
"either",
"a",
"new",
"ConstantStringInfo",
"object",
"or",
"one",
"already",
"in",
"the",
"constant",
"pool",
".",
"If",
"it",
"is",
"a",
"new",
"ConstantStringInfo",
"it",
"will",
"be",
"inserted",
"into",
"the",
"pool",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/classfile/ConstantStringInfo.java#L37-L40 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/BillingApi.java | BillingApi.updatePlan | public BillingPlanUpdateResponse updatePlan(String accountId, BillingPlanInformation billingPlanInformation, BillingApi.UpdatePlanOptions options) throws ApiException {
"""
Updates the account billing plan.
Updates the billing plan information, billing address, and credit card information for the specified accoun... | java | public BillingPlanUpdateResponse updatePlan(String accountId, BillingPlanInformation billingPlanInformation, BillingApi.UpdatePlanOptions options) throws ApiException {
Object localVarPostBody = billingPlanInformation;
// verify the required parameter 'accountId' is set
if (accountId == null) {
... | [
"public",
"BillingPlanUpdateResponse",
"updatePlan",
"(",
"String",
"accountId",
",",
"BillingPlanInformation",
"billingPlanInformation",
",",
"BillingApi",
".",
"UpdatePlanOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"localVarPostBody",
"=",
"billingP... | Updates the account billing plan.
Updates the billing plan information, billing address, and credit card information for the specified account.
@param accountId The external account number (int) or account ID Guid. (required)
@param billingPlanInformation (optional)
@param options for modifying the method behavior.
@r... | [
"Updates",
"the",
"account",
"billing",
"plan",
".",
"Updates",
"the",
"billing",
"plan",
"information",
"billing",
"address",
"and",
"credit",
"card",
"information",
"for",
"the",
"specified",
"account",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/BillingApi.java#L705-L741 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java | DistributedFileSystem.setQuota | public void setQuota(Path src, long namespaceQuota, long diskspaceQuota)
throws IOException {
"""
Set a directory's quotas
@see org.apache.hadoop.hdfs.protocol.ClientProtocol#setQuota(String, long, long)
"""
dfs.setQuota(getPathName(src), namespaceQuota, diskspaceQuota);
} | java | public void setQuota(Path src, long namespaceQuota, long diskspaceQuota)
throws IOException {
dfs.setQuota(getPathName(src), namespaceQuota, diskspaceQuota);
} | [
"public",
"void",
"setQuota",
"(",
"Path",
"src",
",",
"long",
"namespaceQuota",
",",
"long",
"diskspaceQuota",
")",
"throws",
"IOException",
"{",
"dfs",
".",
"setQuota",
"(",
"getPathName",
"(",
"src",
")",
",",
"namespaceQuota",
",",
"diskspaceQuota",
")",
... | Set a directory's quotas
@see org.apache.hadoop.hdfs.protocol.ClientProtocol#setQuota(String, long, long) | [
"Set",
"a",
"directory",
"s",
"quotas"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java#L501-L504 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/util/StreamUtils.java | StreamUtils.copyToString | public static String copyToString(InputStream in, Charset charset) throws IOException {
"""
Copy the contents of the given InputStream into a String.
Leaves the stream open when done.
@param in the InputStream to copy from
@return the String that has been copied to
@throws IOException in case of I/O errors
... | java | public static String copyToString(InputStream in, Charset charset) throws IOException {
Assert.notNull(in, "No InputStream specified");
StringBuilder out = new StringBuilder();
InputStreamReader reader = new InputStreamReader(in, charset);
char[] buffer = new char[BUFFER_SIZE];
int bytesRead = -1;
while ((b... | [
"public",
"static",
"String",
"copyToString",
"(",
"InputStream",
"in",
",",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"Assert",
".",
"notNull",
"(",
"in",
",",
"\"No InputStream specified\"",
")",
";",
"StringBuilder",
"out",
"=",
"new",
"StringB... | Copy the contents of the given InputStream into a String.
Leaves the stream open when done.
@param in the InputStream to copy from
@return the String that has been copied to
@throws IOException in case of I/O errors | [
"Copy",
"the",
"contents",
"of",
"the",
"given",
"InputStream",
"into",
"a",
"String",
".",
"Leaves",
"the",
"stream",
"open",
"when",
"done",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/util/StreamUtils.java#L68-L78 |
jboss/jboss-jstl-api_spec | src/main/java/org/apache/taglibs/standard/tag/common/fmt/LocaleUtil.java | LocaleUtil.parseLocale | public static Locale parseLocale(String locale, String variant) {
"""
Parses the given locale string into its language and (optionally)
country components, and returns the corresponding {@link Locale} object.
@param locale the locale string to parse; must not be null or empty
@param variant the variant
@ret... | java | public static Locale parseLocale(String locale, String variant) {
String language;
String country;
int index;
if (((index = locale.indexOf(HYPHEN)) > -1) || ((index = locale.indexOf(UNDERSCORE)) > -1)) {
if (index == 0) {
throw new IllegalArgumentException(R... | [
"public",
"static",
"Locale",
"parseLocale",
"(",
"String",
"locale",
",",
"String",
"variant",
")",
"{",
"String",
"language",
";",
"String",
"country",
";",
"int",
"index",
";",
"if",
"(",
"(",
"(",
"index",
"=",
"locale",
".",
"indexOf",
"(",
"HYPHEN"... | Parses the given locale string into its language and (optionally)
country components, and returns the corresponding {@link Locale} object.
@param locale the locale string to parse; must not be null or empty
@param variant the variant
@return the specified Locale
@throws IllegalArgumentException if the given locale do... | [
"Parses",
"the",
"given",
"locale",
"string",
"into",
"its",
"language",
"and",
"(",
"optionally",
")",
"country",
"components",
"and",
"returns",
"the",
"corresponding",
"{",
"@link",
"Locale",
"}",
"object",
"."
] | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/tag/common/fmt/LocaleUtil.java#L78-L102 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.mdb/src/com/ibm/ws/ejbcontainer/mdb/internal/MDBRuntimeImpl.java | MDBRuntimeImpl.removeAdminObjectService | protected void removeAdminObjectService(ServiceReference<AdminObjectService> reference, String id, boolean jndiName) {
"""
Should be private, but findbugs complains about remove method with SR.
"""
NamedAdminObjectServiceInfo aosInfo = adminObjectServices.get(id);
if (aosInfo != null) {
... | java | protected void removeAdminObjectService(ServiceReference<AdminObjectService> reference, String id, boolean jndiName) {
NamedAdminObjectServiceInfo aosInfo = adminObjectServices.get(id);
if (aosInfo != null) {
aosInfo.getServices(jndiName).removeReference(reference);
// If the hi... | [
"protected",
"void",
"removeAdminObjectService",
"(",
"ServiceReference",
"<",
"AdminObjectService",
">",
"reference",
",",
"String",
"id",
",",
"boolean",
"jndiName",
")",
"{",
"NamedAdminObjectServiceInfo",
"aosInfo",
"=",
"adminObjectServices",
".",
"get",
"(",
"id... | Should be private, but findbugs complains about remove method with SR. | [
"Should",
"be",
"private",
"but",
"findbugs",
"complains",
"about",
"remove",
"method",
"with",
"SR",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.mdb/src/com/ibm/ws/ejbcontainer/mdb/internal/MDBRuntimeImpl.java#L512-L542 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePoliciesInner.java | ComputePoliciesInner.createOrUpdate | public ComputePolicyInner createOrUpdate(String resourceGroupName, String accountName, String computePolicyName, CreateOrUpdateComputePolicyParameters parameters) {
"""
Creates or updates the specified compute policy. During update, the compute policy with the specified name will be replaced with this new compute ... | java | public ComputePolicyInner createOrUpdate(String resourceGroupName, String accountName, String computePolicyName, CreateOrUpdateComputePolicyParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName, parameters).toBlocking().single().body();
} | [
"public",
"ComputePolicyInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"computePolicyName",
",",
"CreateOrUpdateComputePolicyParameters",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",... | Creates or updates the specified compute policy. During update, the compute policy with the specified name will be replaced with this new compute policy. An account supports, at most, 50 policies.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Analytics acco... | [
"Creates",
"or",
"updates",
"the",
"specified",
"compute",
"policy",
".",
"During",
"update",
"the",
"compute",
"policy",
"with",
"the",
"specified",
"name",
"will",
"be",
"replaced",
"with",
"this",
"new",
"compute",
"policy",
".",
"An",
"account",
"supports"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePoliciesInner.java#L228-L230 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java | DownloadChemCompProvider.checkDoFirstInstall | public void checkDoFirstInstall() {
"""
Checks if the chemical components already have been installed into the PDB directory.
If not, will download the chemical components definitions file and split it up into small
subfiles.
"""
if ( ! downloadAll ) {
return;
}
// this makes sure there is a file... | java | public void checkDoFirstInstall(){
if ( ! downloadAll ) {
return;
}
// this makes sure there is a file separator between every component,
// if path has a trailing file separator or not, it will work for both cases
File dir = new File(getPath(), CHEM_COMP_CACHE_DIRECTORY);
File f = new File(dir, "comp... | [
"public",
"void",
"checkDoFirstInstall",
"(",
")",
"{",
"if",
"(",
"!",
"downloadAll",
")",
"{",
"return",
";",
"}",
"// this makes sure there is a file separator between every component,",
"// if path has a trailing file separator or not, it will work for both cases",
"File",
"d... | Checks if the chemical components already have been installed into the PDB directory.
If not, will download the chemical components definitions file and split it up into small
subfiles. | [
"Checks",
"if",
"the",
"chemical",
"components",
"already",
"have",
"been",
"installed",
"into",
"the",
"PDB",
"directory",
".",
"If",
"not",
"will",
"download",
"the",
"chemical",
"components",
"definitions",
"file",
"and",
"split",
"it",
"up",
"into",
"small... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java#L135-L172 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java | ConnectionMonitorsInner.getAsync | public Observable<ConnectionMonitorResultInner> getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) {
"""
Gets a connection monitor by name.
@param resourceGroupName The name of the resource group containing Network Watcher.
@param networkWatcherName The name of the Netw... | java | public Observable<ConnectionMonitorResultInner> getAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) {
return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1<ServiceResponse<ConnectionMonitorResultInner>, ConnectionMo... | [
"public",
"Observable",
"<",
"ConnectionMonitorResultInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"connectionMonitorName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Gets a connection monitor by name.
@param resourceGroupName The name of the resource group containing Network Watcher.
@param networkWatcherName The name of the Network Watcher resource.
@param connectionMonitorName The name of the connection monitor.
@throws IllegalArgumentException thrown if parameters fail the vali... | [
"Gets",
"a",
"connection",
"monitor",
"by",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java#L330-L337 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/io/IOUtils.java | IOUtils.encodedInputStreamReader | public static Reader encodedInputStreamReader(InputStream stream, String encoding) throws IOException {
"""
Create a Reader with an explicit encoding around an InputStream.
This static method will treat null as meaning to use the platform default,
unlike the Java library methods that disallow a null encoding.
... | java | public static Reader encodedInputStreamReader(InputStream stream, String encoding) throws IOException {
// InputStreamReader doesn't allow encoding to be null;
if (encoding == null) {
return new InputStreamReader(stream);
} else {
return new InputStreamReader(stream, encoding);
}
} | [
"public",
"static",
"Reader",
"encodedInputStreamReader",
"(",
"InputStream",
"stream",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"// InputStreamReader doesn't allow encoding to be null;\r",
"if",
"(",
"encoding",
"==",
"null",
")",
"{",
"return",
"n... | Create a Reader with an explicit encoding around an InputStream.
This static method will treat null as meaning to use the platform default,
unlike the Java library methods that disallow a null encoding.
@param stream An InputStream
@param encoding A charset encoding
@return A Reader
@throws IOException If any IO probl... | [
"Create",
"a",
"Reader",
"with",
"an",
"explicit",
"encoding",
"around",
"an",
"InputStream",
".",
"This",
"static",
"method",
"will",
"treat",
"null",
"as",
"meaning",
"to",
"use",
"the",
"platform",
"default",
"unlike",
"the",
"Java",
"library",
"methods",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L1320-L1327 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java | DepTreeNode.setDependencies | public void setDependencies(String[] defineDependencies, String[] requireDependencies, String[] dependentFeatures, long lastModifiedFile, long lastModifiedDep) {
"""
Specifies the dependency list of modules for the module named by this
node, along with the last modified date of the javascript file that the
depen... | java | public void setDependencies(String[] defineDependencies, String[] requireDependencies, String[] dependentFeatures, long lastModifiedFile, long lastModifiedDep) {
this.defineDependencies = defineDependencies;
this.requireDependencies = requireDependencies;
this.dependentFeatures = dependentFeatures;
this.las... | [
"public",
"void",
"setDependencies",
"(",
"String",
"[",
"]",
"defineDependencies",
",",
"String",
"[",
"]",
"requireDependencies",
",",
"String",
"[",
"]",
"dependentFeatures",
",",
"long",
"lastModifiedFile",
",",
"long",
"lastModifiedDep",
")",
"{",
"this",
"... | Specifies the dependency list of modules for the module named by this
node, along with the last modified date of the javascript file that the
dependency list was obtained from.
@param defineDependencies
The define() dependency list of module names
@param requireDependencies
The require() dependency list of module name... | [
"Specifies",
"the",
"dependency",
"list",
"of",
"modules",
"for",
"the",
"module",
"named",
"by",
"this",
"node",
"along",
"with",
"the",
"last",
"modified",
"date",
"of",
"the",
"javascript",
"file",
"that",
"the",
"dependency",
"list",
"was",
"obtained",
"... | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java#L446-L452 |
eobermuhlner/big-math | ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java | BigDecimalMath.acoth | public static BigDecimal acoth(BigDecimal x, MathContext mathContext) {
"""
Calculates the arc hyperbolic cotangens (inverse hyperbolic cotangens) of {@link BigDecimal} x.
<p>See: <a href="https://en.wikipedia.org/wiki/Hyperbolic_function">Wikipedia: Hyperbolic function</a></p>
@param x the {@link BigDecimal... | java | public static BigDecimal acoth(BigDecimal x, MathContext mathContext) {
checkMathContext(mathContext);
MathContext mc = new MathContext(mathContext.getPrecision() + 6, mathContext.getRoundingMode());
BigDecimal result = log(x.add(ONE, mc).divide(x.subtract(ONE, mc), mc), mc).divide(TWO, mc);
return round(result... | [
"public",
"static",
"BigDecimal",
"acoth",
"(",
"BigDecimal",
"x",
",",
"MathContext",
"mathContext",
")",
"{",
"checkMathContext",
"(",
"mathContext",
")",
";",
"MathContext",
"mc",
"=",
"new",
"MathContext",
"(",
"mathContext",
".",
"getPrecision",
"(",
")",
... | Calculates the arc hyperbolic cotangens (inverse hyperbolic cotangens) of {@link BigDecimal} x.
<p>See: <a href="https://en.wikipedia.org/wiki/Hyperbolic_function">Wikipedia: Hyperbolic function</a></p>
@param x the {@link BigDecimal} to calculate the arc hyperbolic cotangens for
@param mathContext the {@link MathCon... | [
"Calculates",
"the",
"arc",
"hyperbolic",
"cotangens",
"(",
"inverse",
"hyperbolic",
"cotangens",
")",
"of",
"{",
"@link",
"BigDecimal",
"}",
"x",
"."
] | train | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java#L1659-L1664 |
haifengl/smile | plot/src/main/java/smile/plot/Graphics.java | Graphics.fillRectBaseRatio | public void fillRectBaseRatio(double[] topLeft, double[] rightBottom) {
"""
Fill the specified rectangle. The logical coordinates are proportional
to the base coordinates.
"""
if (!(projection instanceof Projection2D)) {
throw new UnsupportedOperationException("Only 2D graphics supports dr... | java | public void fillRectBaseRatio(double[] topLeft, double[] rightBottom) {
if (!(projection instanceof Projection2D)) {
throw new UnsupportedOperationException("Only 2D graphics supports drawing rectangles.");
}
int[] sc = projection.screenProjectionBaseRatio(topLeft);
int[] sc... | [
"public",
"void",
"fillRectBaseRatio",
"(",
"double",
"[",
"]",
"topLeft",
",",
"double",
"[",
"]",
"rightBottom",
")",
"{",
"if",
"(",
"!",
"(",
"projection",
"instanceof",
"Projection2D",
")",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
... | Fill the specified rectangle. The logical coordinates are proportional
to the base coordinates. | [
"Fill",
"the",
"specified",
"rectangle",
".",
"The",
"logical",
"coordinates",
"are",
"proportional",
"to",
"the",
"base",
"coordinates",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/plot/src/main/java/smile/plot/Graphics.java#L562-L571 |
windup/windup | reporting/api/src/main/java/org/jboss/windup/reporting/TagUtil.java | TagUtil.strictCheckMatchingTags | public static boolean strictCheckMatchingTags(Collection<String> tags, Set<String> includeTags, Set<String> excludeTags) {
"""
Returns true if
- includeTags is not empty and tag is in includeTags
- includeTags is empty and tag is not in excludeTags
@param tags Hint tags
@param includeTags Include tags
@param ... | java | public static boolean strictCheckMatchingTags(Collection<String> tags, Set<String> includeTags, Set<String> excludeTags)
{
boolean includeTagsEnabled = !includeTags.isEmpty();
for (String tag : tags)
{
boolean isIncluded = includeTags.contains(tag);
boolean isExclude... | [
"public",
"static",
"boolean",
"strictCheckMatchingTags",
"(",
"Collection",
"<",
"String",
">",
"tags",
",",
"Set",
"<",
"String",
">",
"includeTags",
",",
"Set",
"<",
"String",
">",
"excludeTags",
")",
"{",
"boolean",
"includeTagsEnabled",
"=",
"!",
"include... | Returns true if
- includeTags is not empty and tag is in includeTags
- includeTags is empty and tag is not in excludeTags
@param tags Hint tags
@param includeTags Include tags
@param excludeTags Exclude tags
@return has tag match | [
"Returns",
"true",
"if",
"-",
"includeTags",
"is",
"not",
"empty",
"and",
"tag",
"is",
"in",
"includeTags",
"-",
"includeTags",
"is",
"empty",
"and",
"tag",
"is",
"not",
"in",
"excludeTags"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/TagUtil.java#L35-L51 |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java | GreenMailUtil.sendMessageBody | public static void sendMessageBody(String to, String from, String subject, Object body, String contentType, ServerSetup serverSetup) {
"""
Send the message with the given attributes and the given body using the specified SMTP settings
@param to Destination address(es)
@param from Sender address... | java | public static void sendMessageBody(String to, String from, String subject, Object body, String contentType, ServerSetup serverSetup) {
try {
Session smtpSession = getSession(serverSetup);
MimeMessage mimeMessage = new MimeMessage(smtpSession);
mimeMessage.setRecipients(... | [
"public",
"static",
"void",
"sendMessageBody",
"(",
"String",
"to",
",",
"String",
"from",
",",
"String",
"subject",
",",
"Object",
"body",
",",
"String",
"contentType",
",",
"ServerSetup",
"serverSetup",
")",
"{",
"try",
"{",
"Session",
"smtpSession",
"=",
... | Send the message with the given attributes and the given body using the specified SMTP settings
@param to Destination address(es)
@param from Sender address
@param subject Message subject
@param body Message content. May either be a MimeMultipart or another body that java mail recognizes
@pa... | [
"Send",
"the",
"message",
"with",
"the",
"given",
"attributes",
"and",
"the",
"given",
"body",
"using",
"the",
"specified",
"SMTP",
"settings"
] | train | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java#L289-L302 |
jscep/jscep | src/main/java/org/jscep/client/Client.java | Client.getRevocationList | public X509CRL getRevocationList(final X509Certificate identity,
final PrivateKey key, final X500Principal issuer,
final BigInteger serial) throws ClientException,
OperationFailureException {
"""
Returns the certificate revocation list a given issuer and serial number.
<p>
Thi... | java | public X509CRL getRevocationList(final X509Certificate identity,
final PrivateKey key, final X500Principal issuer,
final BigInteger serial) throws ClientException,
OperationFailureException {
return getRevocationList(identity, key, issuer, serial, null);
} | [
"public",
"X509CRL",
"getRevocationList",
"(",
"final",
"X509Certificate",
"identity",
",",
"final",
"PrivateKey",
"key",
",",
"final",
"X500Principal",
"issuer",
",",
"final",
"BigInteger",
"serial",
")",
"throws",
"ClientException",
",",
"OperationFailureException",
... | Returns the certificate revocation list a given issuer and serial number.
<p>
This method requests a CRL for a certificate as identified by the issuer
name and the certificate serial number.
@param identity
the identity of the client.
@param key
the private key to sign the SCEP request.
@param issuer
the name of the c... | [
"Returns",
"the",
"certificate",
"revocation",
"list",
"a",
"given",
"issuer",
"and",
"serial",
"number",
".",
"<p",
">",
"This",
"method",
"requests",
"a",
"CRL",
"for",
"a",
"certificate",
"as",
"identified",
"by",
"the",
"issuer",
"name",
"and",
"the",
... | train | https://github.com/jscep/jscep/blob/d2c602f8b3adb774704c24eaf62f6b8654a40e35/src/main/java/org/jscep/client/Client.java#L394-L399 |
jeremylong/DependencyCheck | cli/src/main/java/org/owasp/dependencycheck/CliParser.java | CliParser.validatePathExists | private void validatePathExists(String[] paths, String optType) throws FileNotFoundException {
"""
Validates whether or not the path(s) points at a file that exists; if the
path(s) does not point to an existing file a FileNotFoundException is
thrown.
@param paths the paths to validate if they exists
@param o... | java | private void validatePathExists(String[] paths, String optType) throws FileNotFoundException {
for (String path : paths) {
validatePathExists(path, optType);
}
} | [
"private",
"void",
"validatePathExists",
"(",
"String",
"[",
"]",
"paths",
",",
"String",
"optType",
")",
"throws",
"FileNotFoundException",
"{",
"for",
"(",
"String",
"path",
":",
"paths",
")",
"{",
"validatePathExists",
"(",
"path",
",",
"optType",
")",
";... | Validates whether or not the path(s) points at a file that exists; if the
path(s) does not point to an existing file a FileNotFoundException is
thrown.
@param paths the paths to validate if they exists
@param optType the option being validated (e.g. scan, out, etc.)
@throws FileNotFoundException is thrown if one of th... | [
"Validates",
"whether",
"or",
"not",
"the",
"path",
"(",
"s",
")",
"points",
"at",
"a",
"file",
"that",
"exists",
";",
"if",
"the",
"path",
"(",
"s",
")",
"does",
"not",
"point",
"to",
"an",
"existing",
"file",
"a",
"FileNotFoundException",
"is",
"thro... | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/cli/src/main/java/org/owasp/dependencycheck/CliParser.java#L169-L173 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/Entity.java | Entity.setEntity_mentions | public void setEntity_mentions(int i, EntityMention v) {
"""
indexed setter for entity_mentions - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (Entity_Type.featOkTst && ((Entity_Type)jcasType).casFeat_entity_mentions == null)
jc... | java | public void setEntity_mentions(int i, EntityMention v) {
if (Entity_Type.featOkTst && ((Entity_Type)jcasType).casFeat_entity_mentions == null)
jcasType.jcas.throwFeatMissing("entity_mentions", "de.julielab.jules.types.ace.Entity");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Ent... | [
"public",
"void",
"setEntity_mentions",
"(",
"int",
"i",
",",
"EntityMention",
"v",
")",
"{",
"if",
"(",
"Entity_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Entity_Type",
")",
"jcasType",
")",
".",
"casFeat_entity_mentions",
"==",
"null",
")",
"jcasType",
".",... | indexed setter for entity_mentions - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"entity_mentions",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/Entity.java#L182-L186 |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java | XmlPrintStream.openElement | public void openElement(String name, String... attributes) {
"""
Open an XML element with the given name, and attributes. A call to closeElement() will output
the appropriate XML closing tag. This class remembers the tag names.
The String parameters are taken to be alternatively names and values. Any odd value... | java | public void openElement(String name, String... attributes) {
elementStack.push(name);
startElement(name, attributes);
println(">");
} | [
"public",
"void",
"openElement",
"(",
"String",
"name",
",",
"String",
"...",
"attributes",
")",
"{",
"elementStack",
".",
"push",
"(",
"name",
")",
";",
"startElement",
"(",
"name",
",",
"attributes",
")",
";",
"println",
"(",
"\">\"",
")",
";",
"}"
] | Open an XML element with the given name, and attributes. A call to closeElement() will output
the appropriate XML closing tag. This class remembers the tag names.
The String parameters are taken to be alternatively names and values. Any odd value
at the end of the list is added as a valueless attribute.
@param name Na... | [
"Open",
"an",
"XML",
"element",
"with",
"the",
"given",
"name",
"and",
"attributes",
".",
"A",
"call",
"to",
"closeElement",
"()",
"will",
"output",
"the",
"appropriate",
"XML",
"closing",
"tag",
".",
"This",
"class",
"remembers",
"the",
"tag",
"names",
".... | train | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java#L85-L90 |
davidcarboni/restolino | src/main/java/com/github/davidcarboni/restolino/api/Router.java | Router.handleNotFound | private void handleNotFound(HttpServletRequest request, HttpServletResponse response) throws IOException {
"""
Handles a request where no API endpoint is defined. If {@link #notFound}
is set, {@link NotFound#handle(HttpServletRequest, HttpServletResponse)}
will be called. Otherwise a simple 404 will be returned.... | java | private void handleNotFound(HttpServletRequest request, HttpServletResponse response) throws IOException {
// Set a default response code:
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
// Attempt to handle the not-found:
Object notFoundResponse = notFound.handle(request, respon... | [
"private",
"void",
"handleNotFound",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"// Set a default response code:",
"response",
".",
"setStatus",
"(",
"HttpServletResponse",
".",
"SC_NOT_FOUND",
")",
";"... | Handles a request where no API endpoint is defined. If {@link #notFound}
is set, {@link NotFound#handle(HttpServletRequest, HttpServletResponse)}
will be called. Otherwise a simple 404 will be returned.
@param request {@link HttpServletRequest}
@param response {@link HttpServletResponse}
@throws IOException If an err... | [
"Handles",
"a",
"request",
"where",
"no",
"API",
"endpoint",
"is",
"defined",
".",
"If",
"{",
"@link",
"#notFound",
"}",
"is",
"set",
"{",
"@link",
"NotFound#handle",
"(",
"HttpServletRequest",
"HttpServletResponse",
")",
"}",
"will",
"be",
"called",
".",
"O... | train | https://github.com/davidcarboni/restolino/blob/3f84ece1bd016fbb597c624d46fcca5a2580a33d/src/main/java/com/github/davidcarboni/restolino/api/Router.java#L371-L381 |
bazaarvoice/jolt | jolt-core/src/main/java/com/bazaarvoice/jolt/common/DeepCopy.java | DeepCopy.simpleDeepCopy | public static Object simpleDeepCopy( Object object ) {
"""
Simple deep copy, that leverages Java Serialization.
Supplied object is serialized to an in memory buffer (byte array),
and then a new object is reconstituted from that byte array.
This is meant for copying small objects or object graphs, and will
pr... | java | public static Object simpleDeepCopy( Object object ) {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(object);
oos.flush();
oos.close();
bos.close();
... | [
"public",
"static",
"Object",
"simpleDeepCopy",
"(",
"Object",
"object",
")",
"{",
"try",
"{",
"ByteArrayOutputStream",
"bos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"ObjectOutputStream",
"oos",
"=",
"new",
"ObjectOutputStream",
"(",
"bos",
")",
";"... | Simple deep copy, that leverages Java Serialization.
Supplied object is serialized to an in memory buffer (byte array),
and then a new object is reconstituted from that byte array.
This is meant for copying small objects or object graphs, and will
probably do nasty things if asked to copy a large graph.
@param object... | [
"Simple",
"deep",
"copy",
"that",
"leverages",
"Java",
"Serialization",
".",
"Supplied",
"object",
"is",
"serialized",
"to",
"an",
"in",
"memory",
"buffer",
"(",
"byte",
"array",
")",
"and",
"then",
"a",
"new",
"object",
"is",
"reconstituted",
"from",
"that"... | train | https://github.com/bazaarvoice/jolt/blob/4cf866a9f4222142da41b50dbcccce022a956bff/jolt-core/src/main/java/com/bazaarvoice/jolt/common/DeepCopy.java#L37-L58 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.beginGetAzureReachabilityReportAsync | public Observable<AzureReachabilityReportInner> beginGetAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) {
"""
Gets the relative latency score for internet service providers from a specified location to Azure regions.
@param resource... | java | public Observable<AzureReachabilityReportInner> beginGetAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) {
return beginGetAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func... | [
"public",
"Observable",
"<",
"AzureReachabilityReportInner",
">",
"beginGetAzureReachabilityReportAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"AzureReachabilityReportParameters",
"parameters",
")",
"{",
"return",
"beginGetAzureReachabilit... | Gets the relative latency score for internet service providers from a specified location to Azure regions.
@param resourceGroupName The name of the network watcher resource group.
@param networkWatcherName The name of the network watcher resource.
@param parameters Parameters that determine Azure reachability report c... | [
"Gets",
"the",
"relative",
"latency",
"score",
"for",
"internet",
"service",
"providers",
"from",
"a",
"specified",
"location",
"to",
"Azure",
"regions",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L2410-L2417 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java | BinaryImageOps.edge4 | public static GrayU8 edge4(GrayU8 input, GrayU8 output, boolean outsideZero ) {
"""
<p>
Binary operation which is designed to remove all pixels but ones which are on the edge of an object.
The edge is defined as lying on the object and not being surrounded by a pixel along a 4-neighborhood.
</p>
<p/>
<p>
NOT... | java | public static GrayU8 edge4(GrayU8 input, GrayU8 output, boolean outsideZero ) {
output = InputSanityCheck.checkDeclare(input, output);
if( BoofConcurrency.USE_CONCURRENT ) {
ImplBinaryInnerOps_MT.edge4(input, output);
} else {
ImplBinaryInnerOps.edge4(input, output);
}
ImplBinaryBorderOps.edge4(input, ... | [
"public",
"static",
"GrayU8",
"edge4",
"(",
"GrayU8",
"input",
",",
"GrayU8",
"output",
",",
"boolean",
"outsideZero",
")",
"{",
"output",
"=",
"InputSanityCheck",
".",
"checkDeclare",
"(",
"input",
",",
"output",
")",
";",
"if",
"(",
"BoofConcurrency",
".",... | <p>
Binary operation which is designed to remove all pixels but ones which are on the edge of an object.
The edge is defined as lying on the object and not being surrounded by a pixel along a 4-neighborhood.
</p>
<p/>
<p>
NOTE: There are many ways to define an edge, this is just one of them.
</p>
@param input Input i... | [
"<p",
">",
"Binary",
"operation",
"which",
"is",
"designed",
"to",
"remove",
"all",
"pixels",
"but",
"ones",
"which",
"are",
"on",
"the",
"edge",
"of",
"an",
"object",
".",
"The",
"edge",
"is",
"defined",
"as",
"lying",
"on",
"the",
"object",
"and",
"n... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java#L258-L269 |
craftercms/commons | git/src/main/java/org/craftercms/commons/git/auth/AbstractSshAuthConfigurator.java | AbstractSshAuthConfigurator.setHostKeyType | protected void setHostKeyType(OpenSshConfig.Host host, Session session) {
"""
/*
Iterates through the known hosts (host key repository).
If one of the know hosts matches the current host we're trying to connect too,
it configures the session to use that key's algorithm
(thus avoiding conflicts between JSch wan... | java | protected void setHostKeyType(OpenSshConfig.Host host, Session session) {
HostKey[] hostKeys = session.getHostKeyRepository().getHostKey();
for(HostKey hostKey : hostKeys) {
if(hostKey.getHost().contains(host.getHostName())) {
session.setConfig(KEY_TYPE_CONFIG, hostKey.getTyp... | [
"protected",
"void",
"setHostKeyType",
"(",
"OpenSshConfig",
".",
"Host",
"host",
",",
"Session",
"session",
")",
"{",
"HostKey",
"[",
"]",
"hostKeys",
"=",
"session",
".",
"getHostKeyRepository",
"(",
")",
".",
"getHostKey",
"(",
")",
";",
"for",
"(",
"Ho... | /*
Iterates through the known hosts (host key repository).
If one of the know hosts matches the current host we're trying to connect too,
it configures the session to use that key's algorithm
(thus avoiding conflicts between JSch wanting RSA and the key being ECDSA) | [
"/",
"*",
"Iterates",
"through",
"the",
"known",
"hosts",
"(",
"host",
"key",
"repository",
")",
".",
"If",
"one",
"of",
"the",
"know",
"hosts",
"matches",
"the",
"current",
"host",
"we",
"re",
"trying",
"to",
"connect",
"too",
"it",
"configures",
"the",... | train | https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/git/src/main/java/org/craftercms/commons/git/auth/AbstractSshAuthConfigurator.java#L50-L57 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagEditable.java | CmsJspTagEditable.doEndTag | @Override
public int doEndTag() throws JspException {
"""
Close the direct edit tag, also prints the direct edit HTML to the current page.<p>
@return {@link #EVAL_PAGE}
@throws JspException in case something goes wrong
"""
if (m_firstOnPage || m_manualPlacement) {
// only execute... | java | @Override
public int doEndTag() throws JspException {
if (m_firstOnPage || m_manualPlacement) {
// only execute action for the first "editable" tag on the page (include file), or in manual mode
editableTagAction(pageContext, m_provider, m_mode, m_file);
}
if (OpenCms... | [
"@",
"Override",
"public",
"int",
"doEndTag",
"(",
")",
"throws",
"JspException",
"{",
"if",
"(",
"m_firstOnPage",
"||",
"m_manualPlacement",
")",
"{",
"// only execute action for the first \"editable\" tag on the page (include file), or in manual mode",
"editableTagAction",
"(... | Close the direct edit tag, also prints the direct edit HTML to the current page.<p>
@return {@link #EVAL_PAGE}
@throws JspException in case something goes wrong | [
"Close",
"the",
"direct",
"edit",
"tag",
"also",
"prints",
"the",
"direct",
"edit",
"HTML",
"to",
"the",
"current",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagEditable.java#L368-L381 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/DataFrame.java | DataFrame.startNewEntry | boolean startNewEntry(boolean firstRecordEntry) {
"""
Indicates that a new DataFrame Entry should be opened.
@param firstRecordEntry If true, this entry will be marked as the first entry in a record (records can be split
across multiple frames, and this helps ensure that, upon reading, the records are recompos... | java | boolean startNewEntry(boolean firstRecordEntry) {
Preconditions.checkState(!this.sealed, "DataFrame is sealed and cannot accept any more entries.");
endEntry(true);
if (getAvailableLength() < MIN_ENTRY_LENGTH_NEEDED) {
// If we cannot fit at least entry header + 1 byte, we cannot re... | [
"boolean",
"startNewEntry",
"(",
"boolean",
"firstRecordEntry",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"this",
".",
"sealed",
",",
"\"DataFrame is sealed and cannot accept any more entries.\"",
")",
";",
"endEntry",
"(",
"true",
")",
";",
"if",
"(",... | Indicates that a new DataFrame Entry should be opened.
@param firstRecordEntry If true, this entry will be marked as the first entry in a record (records can be split
across multiple frames, and this helps ensure that, upon reading, the records are recomposed
starting with the right Data Frame Entry).
@return True if ... | [
"Indicates",
"that",
"a",
"new",
"DataFrame",
"Entry",
"should",
"be",
"opened",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/DataFrame.java#L152-L166 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/transform/transform/time/DeriveColumnsFromTimeTransform.java | DeriveColumnsFromTimeTransform.map | @Override
public Object map(Object input) {
"""
Transform an object
in to another object
@param input the record to transform
@return the transformed writable
"""
List<Object> ret = new ArrayList<>();
Long l = (Long) input;
for (DerivedColumn d : derivedColumns) {
s... | java | @Override
public Object map(Object input) {
List<Object> ret = new ArrayList<>();
Long l = (Long) input;
for (DerivedColumn d : derivedColumns) {
switch (d.columnType) {
case String:
ret.add(d.dateTimeFormatter.print(l));
br... | [
"@",
"Override",
"public",
"Object",
"map",
"(",
"Object",
"input",
")",
"{",
"List",
"<",
"Object",
">",
"ret",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Long",
"l",
"=",
"(",
"Long",
")",
"input",
";",
"for",
"(",
"DerivedColumn",
"d",
":",
... | Transform an object
in to another object
@param input the record to transform
@return the transformed writable | [
"Transform",
"an",
"object",
"in",
"to",
"another",
"object"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/transform/time/DeriveColumnsFromTimeTransform.java#L196-L215 |
leancloud/java-sdk-all | realtime/src/main/java/cn/leancloud/session/AVDefaultConnectionListener.java | AVDefaultConnectionListener.processMessageReceipt | private void processMessageReceipt(String msgId, String conversationId, int convType, long timestamp) {
"""
处理 v2 版本中 message 的 rcp 消息
@param msgId
@param conversationId
@param timestamp
"""
Object messageCache =
MessageReceiptCache.get(session.getSelfPeerId(), msgId);
if (messageCache =... | java | private void processMessageReceipt(String msgId, String conversationId, int convType, long timestamp) {
Object messageCache =
MessageReceiptCache.get(session.getSelfPeerId(), msgId);
if (messageCache == null) {
return;
}
Message m = (Message) messageCache;
AVIMMessage msg =
... | [
"private",
"void",
"processMessageReceipt",
"(",
"String",
"msgId",
",",
"String",
"conversationId",
",",
"int",
"convType",
",",
"long",
"timestamp",
")",
"{",
"Object",
"messageCache",
"=",
"MessageReceiptCache",
".",
"get",
"(",
"session",
".",
"getSelfPeerId",... | 处理 v2 版本中 message 的 rcp 消息
@param msgId
@param conversationId
@param timestamp | [
"处理",
"v2",
"版本中",
"message",
"的",
"rcp",
"消息"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/realtime/src/main/java/cn/leancloud/session/AVDefaultConnectionListener.java#L550-L564 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java | Transforms.greaterThanOrEqual | public static INDArray greaterThanOrEqual(INDArray first, INDArray ndArray) {
"""
1 if greater than or equal to 0 otherwise (at each element)
@param first
@param ndArray
@return
"""
return greaterThanOrEqual(first, ndArray, true);
} | java | public static INDArray greaterThanOrEqual(INDArray first, INDArray ndArray) {
return greaterThanOrEqual(first, ndArray, true);
} | [
"public",
"static",
"INDArray",
"greaterThanOrEqual",
"(",
"INDArray",
"first",
",",
"INDArray",
"ndArray",
")",
"{",
"return",
"greaterThanOrEqual",
"(",
"first",
",",
"ndArray",
",",
"true",
")",
";",
"}"
] | 1 if greater than or equal to 0 otherwise (at each element)
@param first
@param ndArray
@return | [
"1",
"if",
"greater",
"than",
"or",
"equal",
"to",
"0",
"otherwise",
"(",
"at",
"each",
"element",
")"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java#L761-L763 |
dwdyer/watchmaker | framework/src/java/main/org/uncommons/util/reflection/ReflectionUtils.java | ReflectionUtils.invokeUnchecked | public static <T> T invokeUnchecked(Constructor<T> constructor, Object... arguments) {
"""
Invokes the specified constructor without throwing any checked exceptions.
This is only valid for constructors that are not declared to throw any checked
exceptions. Any unchecked exceptions thrown by the specified constr... | java | public static <T> T invokeUnchecked(Constructor<T> constructor, Object... arguments)
{
try
{
return constructor.newInstance(arguments);
}
catch (IllegalAccessException ex)
{
// This cannot happen if the constructor is public.
throw new Ille... | [
"public",
"static",
"<",
"T",
">",
"T",
"invokeUnchecked",
"(",
"Constructor",
"<",
"T",
">",
"constructor",
",",
"Object",
"...",
"arguments",
")",
"{",
"try",
"{",
"return",
"constructor",
".",
"newInstance",
"(",
"arguments",
")",
";",
"}",
"catch",
"... | Invokes the specified constructor without throwing any checked exceptions.
This is only valid for constructors that are not declared to throw any checked
exceptions. Any unchecked exceptions thrown by the specified constructor will be
re-thrown (in their original form, not wrapped in an InvocationTargetException
as wo... | [
"Invokes",
"the",
"specified",
"constructor",
"without",
"throwing",
"any",
"checked",
"exceptions",
".",
"This",
"is",
"only",
"valid",
"for",
"constructors",
"that",
"are",
"not",
"declared",
"to",
"throw",
"any",
"checked",
"exceptions",
".",
"Any",
"unchecke... | train | https://github.com/dwdyer/watchmaker/blob/33d942350e6bf7d9a17b9262a4f898158530247e/framework/src/java/main/org/uncommons/util/reflection/ReflectionUtils.java#L96-L127 |
b3log/latke | latke-core/src/main/java/org/b3log/latke/ioc/SingletonContext.java | SingletonContext.destroyReference | private <T> void destroyReference(final Bean<T> bean, final T beanInstance) {
"""
Destroys the specified bean's instance.
@param <T> the type of contextual
@param bean the specified bean
@param beanInstance the specified bean's instance
"""
bean.destroy(beanInstance);
} | java | private <T> void destroyReference(final Bean<T> bean, final T beanInstance) {
bean.destroy(beanInstance);
} | [
"private",
"<",
"T",
">",
"void",
"destroyReference",
"(",
"final",
"Bean",
"<",
"T",
">",
"bean",
",",
"final",
"T",
"beanInstance",
")",
"{",
"bean",
".",
"destroy",
"(",
"beanInstance",
")",
";",
"}"
] | Destroys the specified bean's instance.
@param <T> the type of contextual
@param bean the specified bean
@param beanInstance the specified bean's instance | [
"Destroys",
"the",
"specified",
"bean",
"s",
"instance",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/ioc/SingletonContext.java#L104-L106 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/ShakeAroundAPI.java | ShakeAroundAPI.deviceSearch | public static DeviceSearchResult deviceSearch(String accessToken,
DeviceSearch deviceSearch) {
"""
查询设备列表
@param accessToken accessToken
@param deviceSearch deviceSearch
@return result
"""
return deviceSearch(accessToken, JsonUtil.toJSONString(d... | java | public static DeviceSearchResult deviceSearch(String accessToken,
DeviceSearch deviceSearch) {
return deviceSearch(accessToken, JsonUtil.toJSONString(deviceSearch));
} | [
"public",
"static",
"DeviceSearchResult",
"deviceSearch",
"(",
"String",
"accessToken",
",",
"DeviceSearch",
"deviceSearch",
")",
"{",
"return",
"deviceSearch",
"(",
"accessToken",
",",
"JsonUtil",
".",
"toJSONString",
"(",
"deviceSearch",
")",
")",
";",
"}"
] | 查询设备列表
@param accessToken accessToken
@param deviceSearch deviceSearch
@return result | [
"查询设备列表"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/ShakeAroundAPI.java#L506-L509 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Betner.java | Betner.between | protected Betner between(String left, String right, Character sameTagMatch) {
"""
Reset the range from the given left and right with same tag match way
'N': NEXT, 'E': LAST, 'R': NOLEFT, 'L': NORIGHT
@param left
@param right
@param sameTagMatch
@return
"""
return inrange(left, right, sameTagMatch);
} | java | protected Betner between(String left, String right, Character sameTagMatch) {
return inrange(left, right, sameTagMatch);
} | [
"protected",
"Betner",
"between",
"(",
"String",
"left",
",",
"String",
"right",
",",
"Character",
"sameTagMatch",
")",
"{",
"return",
"inrange",
"(",
"left",
",",
"right",
",",
"sameTagMatch",
")",
";",
"}"
] | Reset the range from the given left and right with same tag match way
'N': NEXT, 'E': LAST, 'R': NOLEFT, 'L': NORIGHT
@param left
@param right
@param sameTagMatch
@return | [
"Reset",
"the",
"range",
"from",
"the",
"given",
"left",
"and",
"right",
"with",
"same",
"tag",
"match",
"way",
"N",
":",
"NEXT",
"E",
":",
"LAST",
"R",
":",
"NOLEFT",
"L",
":",
"NORIGHT"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Betner.java#L336-L338 |
doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.getBoolean | public boolean getBoolean(String key) {
"""
Returns the boolean value stored in this object for the given key.
@param key the name of the field on this object
@return a boolean value
@throws LazyException if the value for the given key was not a boolean.
"""
LazyNode token=getFieldToken(key);
if(token... | java | public boolean getBoolean(String key){
LazyNode token=getFieldToken(key);
if(token.type==LazyNode.VALUE_STRING || token.type==LazyNode.VALUE_ESTRING){
String str=token.getStringValue().toLowerCase().trim();
if(str.equals("true"))return true;
if(str.equals("false"))return false;
throw new LazyException("... | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
")",
"{",
"LazyNode",
"token",
"=",
"getFieldToken",
"(",
"key",
")",
";",
"if",
"(",
"token",
".",
"type",
"==",
"LazyNode",
".",
"VALUE_STRING",
"||",
"token",
".",
"type",
"==",
"LazyNode",
".",... | Returns the boolean value stored in this object for the given key.
@param key the name of the field on this object
@return a boolean value
@throws LazyException if the value for the given key was not a boolean. | [
"Returns",
"the",
"boolean",
"value",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L514-L525 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.initiateTransfer | public void initiateTransfer(String connId, String destination) throws WorkspaceApiException {
"""
Initiate a two-step transfer by placing the first call on hold and dialing the destination number (step 1).
After initiating the transfer, you can use `completeTransfer()` to complete the transfer (step 2).
@param ... | java | public void initiateTransfer(String connId, String destination) throws WorkspaceApiException {
this.initiateTransfer(connId, destination, null, null, null, null, null);
} | [
"public",
"void",
"initiateTransfer",
"(",
"String",
"connId",
",",
"String",
"destination",
")",
"throws",
"WorkspaceApiException",
"{",
"this",
".",
"initiateTransfer",
"(",
"connId",
",",
"destination",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
",... | Initiate a two-step transfer by placing the first call on hold and dialing the destination number (step 1).
After initiating the transfer, you can use `completeTransfer()` to complete the transfer (step 2).
@param connId The connection ID of the call to be transferred. This call will be placed on hold.
@param destinati... | [
"Initiate",
"a",
"two",
"-",
"step",
"transfer",
"by",
"placing",
"the",
"first",
"call",
"on",
"hold",
"and",
"dialing",
"the",
"destination",
"number",
"(",
"step",
"1",
")",
".",
"After",
"initiating",
"the",
"transfer",
"you",
"can",
"use",
"completeTr... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L768-L770 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java | CPDefinitionPersistenceImpl.countByC_ERC | @Override
public int countByC_ERC(long companyId, String externalReferenceCode) {
"""
Returns the number of cp definitions where companyId = ? and externalReferenceCode = ?.
@param companyId the company ID
@param externalReferenceCode the external reference code
@return the number of matching cp defi... | java | @Override
public int countByC_ERC(long companyId, String externalReferenceCode) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_C_ERC;
Object[] finderArgs = new Object[] { companyId, externalReferenceCode };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
Strin... | [
"@",
"Override",
"public",
"int",
"countByC_ERC",
"(",
"long",
"companyId",
",",
"String",
"externalReferenceCode",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_C_ERC",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
"[",
"]",
"{... | Returns the number of cp definitions where companyId = ? and externalReferenceCode = ?.
@param companyId the company ID
@param externalReferenceCode the external reference code
@return the number of matching cp definitions | [
"Returns",
"the",
"number",
"of",
"cp",
"definitions",
"where",
"companyId",
"=",
"?",
";",
"and",
"externalReferenceCode",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java#L5371-L5432 |
inkstand-io/scribble | scribble-http/src/main/java/io/inkstand/scribble/http/rules/HttpServerBuilder.java | HttpServerBuilder.contentFrom | public HttpServerBuilder contentFrom(final String path, final URL resource) {
"""
Defines a file to be hosted on the specified path. The file's content is provided by the specified URL.
@param path
the path where the file is accessible from the server
@param resource
the resource providing the content for the ... | java | public HttpServerBuilder contentFrom(final String path, final URL resource) {
resources.put(path, resource);
return this;
} | [
"public",
"HttpServerBuilder",
"contentFrom",
"(",
"final",
"String",
"path",
",",
"final",
"URL",
"resource",
")",
"{",
"resources",
".",
"put",
"(",
"path",
",",
"resource",
")",
";",
"return",
"this",
";",
"}"
] | Defines a file to be hosted on the specified path. The file's content is provided by the specified URL.
@param path
the path where the file is accessible from the server
@param resource
the resource providing the content for the file
@return
this builder | [
"Defines",
"a",
"file",
"to",
"be",
"hosted",
"on",
"the",
"specified",
"path",
".",
"The",
"file",
"s",
"content",
"is",
"provided",
"by",
"the",
"specified",
"URL",
"."
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-http/src/main/java/io/inkstand/scribble/http/rules/HttpServerBuilder.java#L133-L136 |
i-net-software/jlessc | src/com/inet/lib/less/Operation.java | Operation.doubleValueLeftColor | private double doubleValueLeftColor( double color, double right ) {
"""
Calculate a color on left with a number on the right side. The calculation occur for every color channel.
@param color the color
@param right the right
@return color value as long
"""
return rgba( doubleValue( red( color ), ri... | java | private double doubleValueLeftColor( double color, double right ) {
return rgba( doubleValue( red( color ), right ), //
doubleValue( green( color ), right ), //
doubleValue( blue( color ), right ), 1 );
} | [
"private",
"double",
"doubleValueLeftColor",
"(",
"double",
"color",
",",
"double",
"right",
")",
"{",
"return",
"rgba",
"(",
"doubleValue",
"(",
"red",
"(",
"color",
")",
",",
"right",
")",
",",
"//",
"doubleValue",
"(",
"green",
"(",
"color",
")",
",",... | Calculate a color on left with a number on the right side. The calculation occur for every color channel.
@param color the color
@param right the right
@return color value as long | [
"Calculate",
"a",
"color",
"on",
"left",
"with",
"a",
"number",
"on",
"the",
"right",
"side",
".",
"The",
"calculation",
"occur",
"for",
"every",
"color",
"channel",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/Operation.java#L380-L384 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java | BuildStepsInner.createAsync | public Observable<BuildStepInner> createAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepProperties properties) {
"""
Creates a build step for a build task.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@para... | java | public Observable<BuildStepInner> createAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepProperties properties) {
return createWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, properties).map(new Func1<ServiceResponse<BuildSte... | [
"public",
"Observable",
"<",
"BuildStepInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"buildTaskName",
",",
"String",
"stepName",
",",
"BuildStepProperties",
"properties",
")",
"{",
"return",
"createWithSe... | Creates a build step for a build task.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildTaskName The name of the container registry build task.
@param stepName The name of a build step for a container re... | [
"Creates",
"a",
"build",
"step",
"for",
"a",
"build",
"task",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java#L468-L475 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java | TmdbLists.modifyMovieList | private StatusCode modifyMovieList(String sessionId, String listId, int movieId, MethodSub operation) throws MovieDbException {
"""
Modify a list
This can be used to add or remove an item from the list
@param sessionId
@param listId
@param movieId
@param operation
@return
@throws MovieDbException
""... | java | private StatusCode modifyMovieList(String sessionId, String listId, int movieId, MethodSub operation) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.SESSION_ID, sessionId);
parameters.add(Param.ID, listId);
String jsonBody = new PostTool... | [
"private",
"StatusCode",
"modifyMovieList",
"(",
"String",
"sessionId",
",",
"String",
"listId",
",",
"int",
"movieId",
",",
"MethodSub",
"operation",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
"... | Modify a list
This can be used to add or remove an item from the list
@param sessionId
@param listId
@param movieId
@param operation
@return
@throws MovieDbException | [
"Modify",
"a",
"list"
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java#L167-L184 |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/TokenResponseException.java | TokenResponseException.from | public static TokenResponseException from(JsonFactory jsonFactory, HttpResponse response) {
"""
Returns a new instance of {@link TokenResponseException}.
<p>
If there is a JSON error response, it is parsed using {@link TokenErrorResponse}, which can be
inspected using {@link #getDetails()}. Otherwise, the ful... | java | public static TokenResponseException from(JsonFactory jsonFactory, HttpResponse response) {
HttpResponseException.Builder builder = new HttpResponseException.Builder(
response.getStatusCode(), response.getStatusMessage(), response.getHeaders());
// details
Preconditions.checkNotNull(jsonFactory);
... | [
"public",
"static",
"TokenResponseException",
"from",
"(",
"JsonFactory",
"jsonFactory",
",",
"HttpResponse",
"response",
")",
"{",
"HttpResponseException",
".",
"Builder",
"builder",
"=",
"new",
"HttpResponseException",
".",
"Builder",
"(",
"response",
".",
"getStatu... | Returns a new instance of {@link TokenResponseException}.
<p>
If there is a JSON error response, it is parsed using {@link TokenErrorResponse}, which can be
inspected using {@link #getDetails()}. Otherwise, the full response content is read and
included in the exception message.
</p>
@param jsonFactory JSON factory
@... | [
"Returns",
"a",
"new",
"instance",
"of",
"{",
"@link",
"TokenResponseException",
"}",
"."
] | train | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/TokenResponseException.java#L77-L106 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/handler/JsonRequestHandler.java | JsonRequestHandler.checkForModifiedSince | protected void checkForModifiedSince(MBeanServerExecutor pServerManager, JmxRequest pRequest)
throws NotChangedException {
"""
Check, whether the set of MBeans for any managed MBeanServer has been change since the timestamp
provided in the given request
@param pServerManager manager for all MBeanServ... | java | protected void checkForModifiedSince(MBeanServerExecutor pServerManager, JmxRequest pRequest)
throws NotChangedException {
int ifModifiedSince = pRequest.getParameterAsInt(ConfigKey.IF_MODIFIED_SINCE);
if (!pServerManager.hasMBeansListChangedSince(ifModifiedSince)) {
throw new No... | [
"protected",
"void",
"checkForModifiedSince",
"(",
"MBeanServerExecutor",
"pServerManager",
",",
"JmxRequest",
"pRequest",
")",
"throws",
"NotChangedException",
"{",
"int",
"ifModifiedSince",
"=",
"pRequest",
".",
"getParameterAsInt",
"(",
"ConfigKey",
".",
"IF_MODIFIED_S... | Check, whether the set of MBeans for any managed MBeanServer has been change since the timestamp
provided in the given request
@param pServerManager manager for all MBeanServers
@param pRequest the request from where to fetch the timestamp
@throws NotChangedException if there has been no REGISTER/UNREGISTER notificatio... | [
"Check",
"whether",
"the",
"set",
"of",
"MBeans",
"for",
"any",
"managed",
"MBeanServer",
"has",
"been",
"change",
"since",
"the",
"timestamp",
"provided",
"in",
"the",
"given",
"request"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/JsonRequestHandler.java#L208-L214 |
opendatatrentino/s-match | src/main/java/it/unitn/disi/smatch/loaders/context/SimpleXMLDeDupContextLoader.java | SimpleXMLDeDupContextLoader.moveChildren | private void moveChildren(INode source, INode target) {
"""
Move children from <var>source</var> to <var>target</var>.
@param source source node
@param target target node
"""
List<INode> children = new ArrayList<INode>(source.getChildrenList());
while (0 < children.size()) {
... | java | private void moveChildren(INode source, INode target) {
List<INode> children = new ArrayList<INode>(source.getChildrenList());
while (0 < children.size()) {
INode child = children.remove(0);
int idx = target.getChildIndex(child);
if (-1 == idx) {
... | [
"private",
"void",
"moveChildren",
"(",
"INode",
"source",
",",
"INode",
"target",
")",
"{",
"List",
"<",
"INode",
">",
"children",
"=",
"new",
"ArrayList",
"<",
"INode",
">",
"(",
"source",
".",
"getChildrenList",
"(",
")",
")",
";",
"while",
"(",
"0"... | Move children from <var>source</var> to <var>target</var>.
@param source source node
@param target target node | [
"Move",
"children",
"from",
"<var",
">",
"source<",
"/",
"var",
">",
"to",
"<var",
">",
"target<",
"/",
"var",
">",
"."
] | train | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/smatch/loaders/context/SimpleXMLDeDupContextLoader.java#L95-L106 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/ClassUtil.java | ClassUtil.classForName | public static <T> Class<T> classForName(String pClassName, ClassLoader ... pClassLoaders) {
"""
Lookup a class. See {@link ClassUtil#classForName(String, boolean,ClassLoader[])} for details. The class
gets initialized during lookup.
@param pClassName name to lookup.
@return the class found or null if no class... | java | public static <T> Class<T> classForName(String pClassName, ClassLoader ... pClassLoaders) {
return classForName(pClassName, true, pClassLoaders);
} | [
"public",
"static",
"<",
"T",
">",
"Class",
"<",
"T",
">",
"classForName",
"(",
"String",
"pClassName",
",",
"ClassLoader",
"...",
"pClassLoaders",
")",
"{",
"return",
"classForName",
"(",
"pClassName",
",",
"true",
",",
"pClassLoaders",
")",
";",
"}"
] | Lookup a class. See {@link ClassUtil#classForName(String, boolean,ClassLoader[])} for details. The class
gets initialized during lookup.
@param pClassName name to lookup.
@return the class found or null if no class could be found. | [
"Lookup",
"a",
"class",
".",
"See",
"{",
"@link",
"ClassUtil#classForName",
"(",
"String",
"boolean",
"ClassLoader",
"[]",
")",
"}",
"for",
"details",
".",
"The",
"class",
"gets",
"initialized",
"during",
"lookup",
"."
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/ClassUtil.java#L41-L43 |
rundeck/rundeck | rundeckapp/src/main/groovy/com/dtolabs/rundeck/jetty/jaas/JettyCachingLdapLoginModule.java | JettyCachingLdapLoginModule.getUserInfo | @SuppressWarnings("unchecked")
public UserInfo getUserInfo(String username) throws Exception {
"""
get the available information about the user
<br>
for this LoginModule, the credential can be null which will result in a
binding ldap authentication scenario
<br>
roles are also an optional concept if requi... | java | @SuppressWarnings("unchecked")
public UserInfo getUserInfo(String username) throws Exception {
String pwdCredential = getUserCredentials(username);
if (pwdCredential == null) {
return null;
}
pwdCredential = convertCredentialLdapToJetty(pwdCredential);
pwdCrede... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"UserInfo",
"getUserInfo",
"(",
"String",
"username",
")",
"throws",
"Exception",
"{",
"String",
"pwdCredential",
"=",
"getUserCredentials",
"(",
"username",
")",
";",
"if",
"(",
"pwdCredential",
"==",
... | get the available information about the user
<br>
for this LoginModule, the credential can be null which will result in a
binding ldap authentication scenario
<br>
roles are also an optional concept if required
@param username
@return
@throws Exception | [
"get",
"the",
"available",
"information",
"about",
"the",
"user",
"<br",
">",
"for",
"this",
"LoginModule",
"the",
"credential",
"can",
"be",
"null",
"which",
"will",
"result",
"in",
"a",
"binding",
"ldap",
"authentication",
"scenario",
"<br",
">",
"roles",
... | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/rundeckapp/src/main/groovy/com/dtolabs/rundeck/jetty/jaas/JettyCachingLdapLoginModule.java#L299-L314 |
sakserv/hadoop-mini-clusters | hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/util/EnvironmentUtils.java | EnvironmentUtils.put | public static void put(String key, String value) throws Exception {
"""
Allows dynamic update to the environment variables.
@param key
@param value
"""
Map<String, String> environemnt = new HashMap<String, String>(System.getenv());
environemnt.put(key, value);
updateEnvironment(envi... | java | public static void put(String key, String value) throws Exception {
Map<String, String> environemnt = new HashMap<String, String>(System.getenv());
environemnt.put(key, value);
updateEnvironment(environemnt);
} | [
"public",
"static",
"void",
"put",
"(",
"String",
"key",
",",
"String",
"value",
")",
"throws",
"Exception",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"environemnt",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
"System",
".",
"ge... | Allows dynamic update to the environment variables.
@param key
@param value | [
"Allows",
"dynamic",
"update",
"to",
"the",
"environment",
"variables",
"."
] | train | https://github.com/sakserv/hadoop-mini-clusters/blob/c3915274714b457cf7e1af62f2f289274510dc0b/hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/util/EnvironmentUtils.java#L33-L37 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/event/ProgressInputStream.java | ProgressInputStream.inputStreamForResponse | public static InputStream inputStreamForResponse(InputStream is, ProgressListener progressListener) {
"""
Returns an input stream for response progress tracking purposes. If request/response progress tracking is not enabled, this
method simply return the given input stream as is.
@param is the re... | java | public static InputStream inputStreamForResponse(InputStream is, ProgressListener progressListener) {
return progressListener == null
? is
: new ResponseProgressInputStream(is, progressListener);
} | [
"public",
"static",
"InputStream",
"inputStreamForResponse",
"(",
"InputStream",
"is",
",",
"ProgressListener",
"progressListener",
")",
"{",
"return",
"progressListener",
"==",
"null",
"?",
"is",
":",
"new",
"ResponseProgressInputStream",
"(",
"is",
",",
"progressLis... | Returns an input stream for response progress tracking purposes. If request/response progress tracking is not enabled, this
method simply return the given input stream as is.
@param is the response content input stream
@param progressListener Optional progress listener
@return If the progress listener is... | [
"Returns",
"an",
"input",
"stream",
"for",
"response",
"progress",
"tracking",
"purposes",
".",
"If",
"request",
"/",
"response",
"progress",
"tracking",
"is",
"not",
"enabled",
"this",
"method",
"simply",
"return",
"the",
"given",
"input",
"stream",
"as",
"is... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/event/ProgressInputStream.java#L81-L85 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/IncidentUtil.java | IncidentUtil.generateIncidentV2WithException | public static Throwable generateIncidentV2WithException(
String serverUrl,
String sessionToken,
Throwable exc,
String jobId,
String requestId) {
"""
Makes a V2 incident object and triggers it, effectively reporting the
given exception to GS and possibly to crashmanager.
<p>
This fu... | java | public static Throwable generateIncidentV2WithException(
String serverUrl,
String sessionToken,
Throwable exc,
String jobId,
String requestId)
{
new Incident(serverUrl, sessionToken, exc, jobId, requestId).trigger();
return exc;
} | [
"public",
"static",
"Throwable",
"generateIncidentV2WithException",
"(",
"String",
"serverUrl",
",",
"String",
"sessionToken",
",",
"Throwable",
"exc",
",",
"String",
"jobId",
",",
"String",
"requestId",
")",
"{",
"new",
"Incident",
"(",
"serverUrl",
",",
"session... | Makes a V2 incident object and triggers it, effectively reporting the
given exception to GS and possibly to crashmanager.
<p>
This function should be proceeded by a throw as it returns the
originally given exception.
@param serverUrl url of GS to report incident to
@param sessionToken session token to be used to re... | [
"Makes",
"a",
"V2",
"incident",
"object",
"and",
"triggers",
"it",
"effectively",
"reporting",
"the",
"given",
"exception",
"to",
"GS",
"and",
"possibly",
"to",
"crashmanager",
".",
"<p",
">",
"This",
"function",
"should",
"be",
"proceeded",
"by",
"a",
"thro... | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/IncidentUtil.java#L302-L311 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/format/FastDateFormat.java | FastDateFormat.getDateTimeInstance | public static FastDateFormat getDateTimeInstance(final int dateStyle, final int timeStyle) {
"""
获得 {@link FastDateFormat} 实例<br>
支持缓存
@param dateStyle date style: FULL, LONG, MEDIUM, or SHORT
@param timeStyle time style: FULL, LONG, MEDIUM, or SHORT
@return 本地化 {@link FastDateFormat}
"""
return cache.... | java | public static FastDateFormat getDateTimeInstance(final int dateStyle, final int timeStyle) {
return cache.getDateTimeInstance(dateStyle, timeStyle, null, null);
} | [
"public",
"static",
"FastDateFormat",
"getDateTimeInstance",
"(",
"final",
"int",
"dateStyle",
",",
"final",
"int",
"timeStyle",
")",
"{",
"return",
"cache",
".",
"getDateTimeInstance",
"(",
"dateStyle",
",",
"timeStyle",
",",
"null",
",",
"null",
")",
";",
"}... | 获得 {@link FastDateFormat} 实例<br>
支持缓存
@param dateStyle date style: FULL, LONG, MEDIUM, or SHORT
@param timeStyle time style: FULL, LONG, MEDIUM, or SHORT
@return 本地化 {@link FastDateFormat} | [
"获得",
"{",
"@link",
"FastDateFormat",
"}",
"实例<br",
">",
"支持缓存"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/format/FastDateFormat.java#L220-L222 |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/model/CPOptionWrapper.java | CPOptionWrapper.getName | @Override
public String getName(String languageId, boolean useDefault) {
"""
Returns the localized name of this cp option in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the d... | java | @Override
public String getName(String languageId, boolean useDefault) {
return _cpOption.getName(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getName",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_cpOption",
".",
"getName",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized name of this cp option in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the default language if no localization exists for the requested language
@return the local... | [
"Returns",
"the",
"localized",
"name",
"of",
"this",
"cp",
"option",
"in",
"the",
"language",
"optionally",
"using",
"the",
"default",
"language",
"if",
"no",
"localization",
"exists",
"for",
"the",
"requested",
"language",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/model/CPOptionWrapper.java#L447-L450 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.removeEntries | public static void removeEntries(File zip, String[] paths, File destZip) {
"""
Copies an existing ZIP file and removes entries with given paths.
@param zip
an existing ZIP file (only read)
@param paths
paths of the entries to remove
@param destZip
new ZIP file created.
@since 1.7
"""
if (log.isDeb... | java | public static void removeEntries(File zip, String[] paths, File destZip) {
if (log.isDebugEnabled()) {
log.debug("Copying '" + zip + "' to '" + destZip + "' and removing paths " + Arrays.asList(paths) + ".");
}
ZipOutputStream out = null;
try {
out = new ZipOutputStream(new BufferedOutputSt... | [
"public",
"static",
"void",
"removeEntries",
"(",
"File",
"zip",
",",
"String",
"[",
"]",
"paths",
",",
"File",
"destZip",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Copying '\"",
"+",
"zip",
"... | Copies an existing ZIP file and removes entries with given paths.
@param zip
an existing ZIP file (only read)
@param paths
paths of the entries to remove
@param destZip
new ZIP file created.
@since 1.7 | [
"Copies",
"an",
"existing",
"ZIP",
"file",
"and",
"removes",
"entries",
"with",
"given",
"paths",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2303-L2319 |
jbundle/jbundle | thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/mem/serial/SDatabase.java | SDatabase.makeNewPTable | public PTable makeNewPTable(FieldList record, Object lookupKey) {
"""
Create a raw data table for this table.
@param table The table to create a raw data table for.
@param key The lookup key that will be passed (on initialization) to the new raw data table.
@return The new raw data table.
"""
InputS... | java | public PTable makeNewPTable(FieldList record, Object lookupKey)
{
InputStream istream = null;
try
{
if (lookupKey instanceof String)
istream = this.openSerialStream(record, (String)lookupKey);
if (istream != null)
{
ObjectIn... | [
"public",
"PTable",
"makeNewPTable",
"(",
"FieldList",
"record",
",",
"Object",
"lookupKey",
")",
"{",
"InputStream",
"istream",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"lookupKey",
"instanceof",
"String",
")",
"istream",
"=",
"this",
".",
"openSerialStream",... | Create a raw data table for this table.
@param table The table to create a raw data table for.
@param key The lookup key that will be passed (on initialization) to the new raw data table.
@return The new raw data table. | [
"Create",
"a",
"raw",
"data",
"table",
"for",
"this",
"table",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/mem/serial/SDatabase.java#L67-L95 |
Jasig/uPortal | uPortal-layout/uPortal-layout-core/src/main/java/org/apereo/portal/layout/LayoutStructure.java | LayoutStructure.addParameter | public void addParameter(String paramName, String paramValue) {
"""
Add a parameter to this LayoutStructure.
@param paramName the name of the parameter
@param paramValue the value of the parameter
"""
this.parameters.add(new StructureParameter(paramName, paramValue));
} | java | public void addParameter(String paramName, String paramValue) {
this.parameters.add(new StructureParameter(paramName, paramValue));
} | [
"public",
"void",
"addParameter",
"(",
"String",
"paramName",
",",
"String",
"paramValue",
")",
"{",
"this",
".",
"parameters",
".",
"add",
"(",
"new",
"StructureParameter",
"(",
"paramName",
",",
"paramValue",
")",
")",
";",
"}"
] | Add a parameter to this LayoutStructure.
@param paramName the name of the parameter
@param paramValue the value of the parameter | [
"Add",
"a",
"parameter",
"to",
"this",
"LayoutStructure",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-core/src/main/java/org/apereo/portal/layout/LayoutStructure.java#L168-L170 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONObject.java | JSONObject.toBean | public static Object toBean( JSONObject jsonObject, Class beanClass, Map classMap ) {
"""
Creates a bean from a JSONObject, with a specific target class.<br>
If beanClass is null, this method will return a graph of DynaBeans. Any
attribute that is a JSONObject and matches a key in the classMap will be
converted... | java | public static Object toBean( JSONObject jsonObject, Class beanClass, Map classMap ) {
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setRootClass( beanClass );
jsonConfig.setClassMap( classMap );
return toBean( jsonObject, jsonConfig );
} | [
"public",
"static",
"Object",
"toBean",
"(",
"JSONObject",
"jsonObject",
",",
"Class",
"beanClass",
",",
"Map",
"classMap",
")",
"{",
"JsonConfig",
"jsonConfig",
"=",
"new",
"JsonConfig",
"(",
")",
";",
"jsonConfig",
".",
"setRootClass",
"(",
"beanClass",
")",... | Creates a bean from a JSONObject, with a specific target class.<br>
If beanClass is null, this method will return a graph of DynaBeans. Any
attribute that is a JSONObject and matches a key in the classMap will be
converted to that target class.<br>
The classMap has the following conventions:
<ul>
<li>Every key must be ... | [
"Creates",
"a",
"bean",
"from",
"a",
"JSONObject",
"with",
"a",
"specific",
"target",
"class",
".",
"<br",
">",
"If",
"beanClass",
"is",
"null",
"this",
"method",
"will",
"return",
"a",
"graph",
"of",
"DynaBeans",
".",
"Any",
"attribute",
"that",
"is",
"... | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONObject.java#L237-L242 |
dihedron/dihedron-commons | src/main/java/org/dihedron/core/zip/ZipArchive.java | ZipArchive.addFile | public void addFile(String zipEntry, ByteArrayOutputStream baos) throws IOException {
"""
Adds the contents of a ByteArrayOutputStream to the ZIP archive.
@param zipEntry
name of the entry in the archive.
@param baos
ByteArrayOutputStream to be added to the archive.
"""
addFile(zipEntry, baos.toByteArr... | java | public void addFile(String zipEntry, ByteArrayOutputStream baos) throws IOException {
addFile(zipEntry, baos.toByteArray());
} | [
"public",
"void",
"addFile",
"(",
"String",
"zipEntry",
",",
"ByteArrayOutputStream",
"baos",
")",
"throws",
"IOException",
"{",
"addFile",
"(",
"zipEntry",
",",
"baos",
".",
"toByteArray",
"(",
")",
")",
";",
"}"
] | Adds the contents of a ByteArrayOutputStream to the ZIP archive.
@param zipEntry
name of the entry in the archive.
@param baos
ByteArrayOutputStream to be added to the archive. | [
"Adds",
"the",
"contents",
"of",
"a",
"ByteArrayOutputStream",
"to",
"the",
"ZIP",
"archive",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/zip/ZipArchive.java#L132-L134 |
apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ColumnOperationUtils.java | ColumnOperationUtils.dropFields | public static List<Expression> dropFields(List<String> inputFields, List<Expression> dropExpressions) {
"""
Creates a projection list that removes given columns.
<p><b>NOTE:</b> Resulting expression are still unresolved.
@param inputFields names of current columns
@param dropExpressions columns to remove
@... | java | public static List<Expression> dropFields(List<String> inputFields, List<Expression> dropExpressions) {
Set<String> columnsToDrop = dropExpressions.stream()
.map(expr -> expr.accept(dropColumnsExtractor))
.collect(Collectors.toSet());
columnsToDrop.forEach(c -> {
if (!inputFields.contains(c)) {
throw ... | [
"public",
"static",
"List",
"<",
"Expression",
">",
"dropFields",
"(",
"List",
"<",
"String",
">",
"inputFields",
",",
"List",
"<",
"Expression",
">",
"dropExpressions",
")",
"{",
"Set",
"<",
"String",
">",
"columnsToDrop",
"=",
"dropExpressions",
".",
"stre... | Creates a projection list that removes given columns.
<p><b>NOTE:</b> Resulting expression are still unresolved.
@param inputFields names of current columns
@param dropExpressions columns to remove
@return projection expressions | [
"Creates",
"a",
"projection",
"list",
"that",
"removes",
"given",
"columns",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ColumnOperationUtils.java#L100-L115 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/selector/SelectorRefresher.java | SelectorRefresher.checkBeginSelection | private void checkBeginSelection(Cursor cursor, SelectorModel model) {
"""
Check if can begin selection. Notify listeners if started.
@param cursor The cursor reference.
@param model The selector model.
"""
final boolean canClick = !model.getClickableArea().contains(cursor.getScreenX(), cursor.getS... | java | private void checkBeginSelection(Cursor cursor, SelectorModel model)
{
final boolean canClick = !model.getClickableArea().contains(cursor.getScreenX(), cursor.getScreenY());
if (!model.isSelecting() && !canClick)
{
model.setSelecting(true);
startX = cursor.getX();
... | [
"private",
"void",
"checkBeginSelection",
"(",
"Cursor",
"cursor",
",",
"SelectorModel",
"model",
")",
"{",
"final",
"boolean",
"canClick",
"=",
"!",
"model",
".",
"getClickableArea",
"(",
")",
".",
"contains",
"(",
"cursor",
".",
"getScreenX",
"(",
")",
","... | Check if can begin selection. Notify listeners if started.
@param cursor The cursor reference.
@param model The selector model. | [
"Check",
"if",
"can",
"begin",
"selection",
".",
"Notify",
"listeners",
"if",
"started",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/selector/SelectorRefresher.java#L157-L171 |
whitesource/agents | wss-agent-utils/src/main/java/org/whitesource/agent/utils/ZipUtils.java | ZipUtils.decompressChunks | public static void decompressChunks(InputStream inputStream, Path tempFileOut) throws IOException {
"""
The method decompresses the big strings using gzip - low memory via the File system
@param inputStream
@param tempFileOut
@throws IOException
"""
try (BufferedWriter writer = Files.newBufferedWr... | java | public static void decompressChunks(InputStream inputStream, Path tempFileOut) throws IOException {
try (BufferedWriter writer = Files.newBufferedWriter(tempFileOut)) {
try (GZIPInputStream chunkZipper = new GZIPInputStream(inputStream);
InputStream in = new BufferedInputStream(chun... | [
"public",
"static",
"void",
"decompressChunks",
"(",
"InputStream",
"inputStream",
",",
"Path",
"tempFileOut",
")",
"throws",
"IOException",
"{",
"try",
"(",
"BufferedWriter",
"writer",
"=",
"Files",
".",
"newBufferedWriter",
"(",
"tempFileOut",
")",
")",
"{",
"... | The method decompresses the big strings using gzip - low memory via the File system
@param inputStream
@param tempFileOut
@throws IOException | [
"The",
"method",
"decompresses",
"the",
"big",
"strings",
"using",
"gzip",
"-",
"low",
"memory",
"via",
"the",
"File",
"system"
] | train | https://github.com/whitesource/agents/blob/8a947a3dbad257aff70f23f79fb3a55ca90b765f/wss-agent-utils/src/main/java/org/whitesource/agent/utils/ZipUtils.java#L150-L164 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/kg/AipKnowledgeGraphic.java | AipKnowledgeGraphic.startTask | public JSONObject startTask(int id, HashMap<String, String> options) {
"""
启动任务接口
启动一个已经创建的信息抽取任务
@param id - 任务ID
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject
"""
AipRequest request = new AipRequest();
preOperation(request);
reque... | java | public JSONObject startTask(int id, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("id", id);
if (options != null) {
request.addBody(options);
}
request.setUri(KnowledgeGraphicConsts.TA... | [
"public",
"JSONObject",
"startTask",
"(",
"int",
"id",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",
".",
"ad... | 启动任务接口
启动一个已经创建的信息抽取任务
@param id - 任务ID
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject | [
"启动任务接口",
"启动一个已经创建的信息抽取任务"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/kg/AipKnowledgeGraphic.java#L145-L156 |
micronaut-projects/micronaut-core | http-server-netty/src/main/java/io/micronaut/http/server/netty/websocket/NettyServerWebSocketUpgradeHandler.java | NettyServerWebSocketUpgradeHandler.handleHandshake | protected ChannelFuture handleHandshake(ChannelHandlerContext ctx, NettyHttpRequest req, WebSocketBean<?> webSocketBean, MutableHttpResponse<?> response) {
"""
Do the handshaking for WebSocket request.
@param ctx The channel handler context
@param req The request
@param webSocketBean The web socket bean
@param... | java | protected ChannelFuture handleHandshake(ChannelHandlerContext ctx, NettyHttpRequest req, WebSocketBean<?> webSocketBean, MutableHttpResponse<?> response) {
int maxFramePayloadLength = webSocketBean.messageMethod().flatMap(m -> m.getValue(OnMessage.class, "maxPayloadLength", Integer.class)).orElse(65536);
... | [
"protected",
"ChannelFuture",
"handleHandshake",
"(",
"ChannelHandlerContext",
"ctx",
",",
"NettyHttpRequest",
"req",
",",
"WebSocketBean",
"<",
"?",
">",
"webSocketBean",
",",
"MutableHttpResponse",
"<",
"?",
">",
"response",
")",
"{",
"int",
"maxFramePayloadLength",... | Do the handshaking for WebSocket request.
@param ctx The channel handler context
@param req The request
@param webSocketBean The web socket bean
@param response The response
@return The channel future | [
"Do",
"the",
"handshaking",
"for",
"WebSocket",
"request",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server-netty/src/main/java/io/micronaut/http/server/netty/websocket/NettyServerWebSocketUpgradeHandler.java#L225-L256 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SslTlsUtil.java | SslTlsUtil.initializeKeyManagers | public static KeyManager[] initializeKeyManagers(File _keyStoreFile, String _keyStorePassword, String _keyPassword) throws IOException {
"""
Initialization of keyStoreManager used to provide access to the configured keyStore.
@param _keyStoreFile key store file
@param _keyStorePassword key store password
@par... | java | public static KeyManager[] initializeKeyManagers(File _keyStoreFile, String _keyStorePassword, String _keyPassword) throws IOException {
if (_keyStoreFile == null) {
return null;
}
String keyStorePwd = StringUtil.defaultIfBlank(_keyStorePassword, System.getProperty("javax.net.ssl.ke... | [
"public",
"static",
"KeyManager",
"[",
"]",
"initializeKeyManagers",
"(",
"File",
"_keyStoreFile",
",",
"String",
"_keyStorePassword",
",",
"String",
"_keyPassword",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_keyStoreFile",
"==",
"null",
")",
"{",
"return",
... | Initialization of keyStoreManager used to provide access to the configured keyStore.
@param _keyStoreFile key store file
@param _keyStorePassword key store password
@param _keyPassword key password
@return KeyManager array or null
@throws IOException on error | [
"Initialization",
"of",
"keyStoreManager",
"used",
"to",
"provide",
"access",
"to",
"the",
"configured",
"keyStore",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SslTlsUtil.java#L91-L123 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.updateRelationsForResource | public void updateRelationsForResource(CmsRequestContext context, CmsResource resource, List<CmsLink> relations)
throws CmsException {
"""
Updates/Creates the relations for the given resource.<p>
@param context the current user context
@param resource the resource to update the relations for
@param relati... | java | public void updateRelationsForResource(CmsRequestContext context, CmsResource resource, List<CmsLink> relations)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
m_driverManager.updateRelationsForResource(dbc, resource, relations);
} catch... | [
"public",
"void",
"updateRelationsForResource",
"(",
"CmsRequestContext",
"context",
",",
"CmsResource",
"resource",
",",
"List",
"<",
"CmsLink",
">",
"relations",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext... | Updates/Creates the relations for the given resource.<p>
@param context the current user context
@param resource the resource to update the relations for
@param relations the relations to update
@throws CmsException if something goes wrong
@see CmsDriverManager#updateRelationsForResource(CmsDbContext, CmsResource, L... | [
"Updates",
"/",
"Creates",
"the",
"relations",
"for",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L6490-L6504 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/jbeanbox/BeanBoxUtils.java | BeanBoxUtils.getInjectAnnotationAsArray | private static Object[] getInjectAnnotationAsArray(Object target, boolean allowSpringJsrAnno) {
"""
Get @INJECT or @POSTCONSTRUCT or @PARAM or @PREDESTROY or @PROTOTYPE
annotation values, return Object[3] or null if no above annotations found
"""
Annotation[] anno = getAnnotations(target);
return getInjec... | java | private static Object[] getInjectAnnotationAsArray(Object target, boolean allowSpringJsrAnno) {
Annotation[] anno = getAnnotations(target);
return getInjectAsArray(anno, allowSpringJsrAnno);
} | [
"private",
"static",
"Object",
"[",
"]",
"getInjectAnnotationAsArray",
"(",
"Object",
"target",
",",
"boolean",
"allowSpringJsrAnno",
")",
"{",
"Annotation",
"[",
"]",
"anno",
"=",
"getAnnotations",
"(",
"target",
")",
";",
"return",
"getInjectAsArray",
"(",
"an... | Get @INJECT or @POSTCONSTRUCT or @PARAM or @PREDESTROY or @PROTOTYPE
annotation values, return Object[3] or null if no above annotations found | [
"Get"
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/jbeanbox/BeanBoxUtils.java#L218-L221 |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/ftp/FtpUtil.java | FtpUtil.recursiveCreateDirectory | static public void recursiveCreateDirectory(FTPClient ftpClient, String path) throws IOException {
"""
Create a directory and all missing parent-directories.
@param ftpClient
@param path
@throws IOException
"""
logger.info("Create Directory: {}", path);
int createDirectoryStatus = ftpClient.mkd(path)... | java | static public void recursiveCreateDirectory(FTPClient ftpClient, String path) throws IOException {
logger.info("Create Directory: {}", path);
int createDirectoryStatus = ftpClient.mkd(path); // makeDirectory...
logger.debug("Create Directory Status: {}", createDirectoryStatus);
if (createDirectoryStatus == ... | [
"static",
"public",
"void",
"recursiveCreateDirectory",
"(",
"FTPClient",
"ftpClient",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"logger",
".",
"info",
"(",
"\"Create Directory: {}\"",
",",
"path",
")",
";",
"int",
"createDirectoryStatus",
"=",
"ft... | Create a directory and all missing parent-directories.
@param ftpClient
@param path
@throws IOException | [
"Create",
"a",
"directory",
"and",
"all",
"missing",
"parent",
"-",
"directories",
"."
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/ftp/FtpUtil.java#L172-L189 |
OpenTSDB/opentsdb | src/core/HistogramSpan.java | HistogramSpan.lastTimestampInRow | static long lastTimestampInRow(final short metric_width, final KeyValue row) {
"""
Package private helper to access the last timestamp in an HBase row.
@param metric_width The number of bytes on which metric IDs are stored.
@param row A compacted HBase row.
@return A strictly positive timestamp in seconds or ... | java | static long lastTimestampInRow(final short metric_width, final KeyValue row) {
final long base_time = Internal.baseTime(row.key());
final byte[] qual = row.qualifier();
return Internal.getTimeStampFromNonDP(base_time, qual);
} | [
"static",
"long",
"lastTimestampInRow",
"(",
"final",
"short",
"metric_width",
",",
"final",
"KeyValue",
"row",
")",
"{",
"final",
"long",
"base_time",
"=",
"Internal",
".",
"baseTime",
"(",
"row",
".",
"key",
"(",
")",
")",
";",
"final",
"byte",
"[",
"]... | Package private helper to access the last timestamp in an HBase row.
@param metric_width The number of bytes on which metric IDs are stored.
@param row A compacted HBase row.
@return A strictly positive timestamp in seconds or ms.
@throws IllegalArgumentException if {@code row} doesn't contain any cell. | [
"Package",
"private",
"helper",
"to",
"access",
"the",
"last",
"timestamp",
"in",
"an",
"HBase",
"row",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/HistogramSpan.java#L338-L342 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/Drawer.java | Drawer.setItemAtPosition | public void setItemAtPosition(@NonNull IDrawerItem drawerItem, int position) {
"""
Set a drawerItem at a specific position
@param drawerItem
@param position
"""
mDrawerBuilder.getItemAdapter().add(position, drawerItem);
} | java | public void setItemAtPosition(@NonNull IDrawerItem drawerItem, int position) {
mDrawerBuilder.getItemAdapter().add(position, drawerItem);
} | [
"public",
"void",
"setItemAtPosition",
"(",
"@",
"NonNull",
"IDrawerItem",
"drawerItem",
",",
"int",
"position",
")",
"{",
"mDrawerBuilder",
".",
"getItemAdapter",
"(",
")",
".",
"add",
"(",
"position",
",",
"drawerItem",
")",
";",
"}"
] | Set a drawerItem at a specific position
@param drawerItem
@param position | [
"Set",
"a",
"drawerItem",
"at",
"a",
"specific",
"position"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L743-L745 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserWpt.java | AbstractGpxParserWpt.startElement | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
"""
Fires whenever an XML start markup is encountered.
@param uri URI of the local element
@param localName Name of the local element (without prefix)
@param qName qName of the local... | java | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
// Clear content buffer
getContentBuffer().delete(0, getContentBuffer().length());
// Store name of current element in stack
getElementNames().push(qName);
... | [
"@",
"Override",
"public",
"void",
"startElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
",",
"Attributes",
"attributes",
")",
"throws",
"SAXException",
"{",
"// Clear content buffer",
"getContentBuffer",
"(",
")",
".",
"delete"... | Fires whenever an XML start markup is encountered.
@param uri URI of the local element
@param localName Name of the local element (without prefix)
@param qName qName of the local element (with prefix)
@param attributes Attributes of the local element (contained in the
markup)
@throws SAXException Any SAX exception, po... | [
"Fires",
"whenever",
"an",
"XML",
"start",
"markup",
"is",
"encountered",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserWpt.java#L68-L74 |
grails/grails-core | grails-spring/src/main/groovy/org/grails/spring/GrailsApplicationContext.java | GrailsApplicationContext.registerPrototype | public void registerPrototype(String name, Class<?> clazz) throws BeansException {
"""
Register a prototype bean with the underlying bean factory.
<p>For more advanced needs, register with the underlying BeanFactory directly.
@see #getDefaultListableBeanFactory
"""
GenericBeanDefinition bd = new Gene... | java | public void registerPrototype(String name, Class<?> clazz) throws BeansException {
GenericBeanDefinition bd = new GenericBeanDefinition();
bd.setScope(GenericBeanDefinition.SCOPE_PROTOTYPE);
bd.setBeanClass(clazz);
getDefaultListableBeanFactory().registerBeanDefinition(name, bd);
} | [
"public",
"void",
"registerPrototype",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"throws",
"BeansException",
"{",
"GenericBeanDefinition",
"bd",
"=",
"new",
"GenericBeanDefinition",
"(",
")",
";",
"bd",
".",
"setScope",
"(",
"GenericBea... | Register a prototype bean with the underlying bean factory.
<p>For more advanced needs, register with the underlying BeanFactory directly.
@see #getDefaultListableBeanFactory | [
"Register",
"a",
"prototype",
"bean",
"with",
"the",
"underlying",
"bean",
"factory",
".",
"<p",
">",
"For",
"more",
"advanced",
"needs",
"register",
"with",
"the",
"underlying",
"BeanFactory",
"directly",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-spring/src/main/groovy/org/grails/spring/GrailsApplicationContext.java#L155-L160 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/tag/Tags.java | Tags.parseTag | public static Tag parseTag(String tagString) {
"""
Parse a string representing a tag. A tag string should have the format {@code key=value}.
Whitespace at the ends of the key and value will be removed. Both the key and value must
have at least one character.
@param tagString string with encoded tag
@return t... | java | public static Tag parseTag(String tagString) {
String k;
String v;
int eqIndex = tagString.indexOf("=");
if (eqIndex < 0) {
throw new IllegalArgumentException("key and value must be separated by '='");
}
k = tagString.substring(0, eqIndex).trim();
v = tagString.substring(eqIndex + 1,... | [
"public",
"static",
"Tag",
"parseTag",
"(",
"String",
"tagString",
")",
"{",
"String",
"k",
";",
"String",
"v",
";",
"int",
"eqIndex",
"=",
"tagString",
".",
"indexOf",
"(",
"\"=\"",
")",
";",
"if",
"(",
"eqIndex",
"<",
"0",
")",
"{",
"throw",
"new",... | Parse a string representing a tag. A tag string should have the format {@code key=value}.
Whitespace at the ends of the key and value will be removed. Both the key and value must
have at least one character.
@param tagString string with encoded tag
@return tag parsed from the string | [
"Parse",
"a",
"string",
"representing",
"a",
"tag",
".",
"A",
"tag",
"string",
"should",
"have",
"the",
"format",
"{",
"@code",
"key",
"=",
"value",
"}",
".",
"Whitespace",
"at",
"the",
"ends",
"of",
"the",
"key",
"and",
"value",
"will",
"be",
"removed... | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/tag/Tags.java#L75-L87 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/periodic/GVRPeriodicEngine.java | GVRPeriodicEngine.runEvery | public PeriodicEvent runEvery(Runnable task, float delay, float period,
KeepRunning callback) {
"""
Run a task periodically, with a callback.
@param task
Task to run.
@param delay
The first execution will happen in {@code delay} seconds.
@param period
Subsequent executions will happen every {@c... | java | public PeriodicEvent runEvery(Runnable task, float delay, float period,
KeepRunning callback) {
validateDelay(delay);
validatePeriod(period);
return new Event(task, delay, period, callback);
} | [
"public",
"PeriodicEvent",
"runEvery",
"(",
"Runnable",
"task",
",",
"float",
"delay",
",",
"float",
"period",
",",
"KeepRunning",
"callback",
")",
"{",
"validateDelay",
"(",
"delay",
")",
";",
"validatePeriod",
"(",
"period",
")",
";",
"return",
"new",
"Eve... | Run a task periodically, with a callback.
@param task
Task to run.
@param delay
The first execution will happen in {@code delay} seconds.
@param period
Subsequent executions will happen every {@code period} seconds
after the first.
@param callback
Callback that lets you cancel the task. {@code null} means run
indefini... | [
"Run",
"a",
"task",
"periodically",
"with",
"a",
"callback",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/periodic/GVRPeriodicEngine.java#L186-L191 |
Hygieia/Hygieia | collectors/performance/appdynamics/src/main/java/com/capitalone/dashboard/collector/DefaultAppdynamicsClient.java | DefaultAppdynamicsClient.joinURL | public static String joinURL(String base, String... paths) throws MalformedURLException {
"""
join a base url to another path or paths - this will handle trailing or non-trailing /'s
"""
StringBuilder result = new StringBuilder(base);
for (String path : paths) {
String p = path.repl... | java | public static String joinURL(String base, String... paths) throws MalformedURLException {
StringBuilder result = new StringBuilder(base);
for (String path : paths) {
String p = path.replaceFirst("^(\\/)+", "");
if (result.lastIndexOf("/") != result.length() - 1) {
... | [
"public",
"static",
"String",
"joinURL",
"(",
"String",
"base",
",",
"String",
"...",
"paths",
")",
"throws",
"MalformedURLException",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
"base",
")",
";",
"for",
"(",
"String",
"path",
":",
"pat... | join a base url to another path or paths - this will handle trailing or non-trailing /'s | [
"join",
"a",
"base",
"url",
"to",
"another",
"path",
"or",
"paths",
"-",
"this",
"will",
"handle",
"trailing",
"or",
"non",
"-",
"trailing",
"/",
"s"
] | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/performance/appdynamics/src/main/java/com/capitalone/dashboard/collector/DefaultAppdynamicsClient.java#L67-L77 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/LocalUnitsManager.java | LocalUnitsManager.unitMap | public static <T> T unitMap(Function<Map<String, List<Unit>>, T> function) {
"""
Iterate the {@link #unitMap local unit map} thread-safely.
This iteration is for you to read the map, not to modify the map.
@param function the function whatever you want to do with the unit map.
"""
readWriteLock.r... | java | public static <T> T unitMap(Function<Map<String, List<Unit>>, T> function) {
readWriteLock.readLock().lock();
try {
return function.apply(Collections.unmodifiableMap(unitMap));
} finally {
readWriteLock.readLock().unlock();
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"unitMap",
"(",
"Function",
"<",
"Map",
"<",
"String",
",",
"List",
"<",
"Unit",
">",
">",
",",
"T",
">",
"function",
")",
"{",
"readWriteLock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",... | Iterate the {@link #unitMap local unit map} thread-safely.
This iteration is for you to read the map, not to modify the map.
@param function the function whatever you want to do with the unit map. | [
"Iterate",
"the",
"{",
"@link",
"#unitMap",
"local",
"unit",
"map",
"}",
"thread",
"-",
"safely",
".",
"This",
"iteration",
"is",
"for",
"you",
"to",
"read",
"the",
"map",
"not",
"to",
"modify",
"the",
"map",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/LocalUnitsManager.java#L213-L220 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java | AbstractXbaseSemanticSequencer.sequence_XThrowExpression | protected void sequence_XThrowExpression(ISerializationContext context, XThrowExpression semanticObject) {
"""
Contexts:
XExpression returns XThrowExpression
XAssignment returns XThrowExpression
XAssignment.XBinaryOperation_1_1_0_0_0 returns XThrowExpression
XOrExpression returns XThrowExpression
XOrExpressio... | java | protected void sequence_XThrowExpression(ISerializationContext context, XThrowExpression semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XTHROW_EXPRESSION__EXPRESSION) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.create... | [
"protected",
"void",
"sequence_XThrowExpression",
"(",
"ISerializationContext",
"context",
",",
"XThrowExpression",
"semanticObject",
")",
"{",
"if",
"(",
"errorAcceptor",
"!=",
"null",
")",
"{",
"if",
"(",
"transientValues",
".",
"isValueTransient",
"(",
"semanticObj... | Contexts:
XExpression returns XThrowExpression
XAssignment returns XThrowExpression
XAssignment.XBinaryOperation_1_1_0_0_0 returns XThrowExpression
XOrExpression returns XThrowExpression
XOrExpression.XBinaryOperation_1_0_0_0 returns XThrowExpression
XAndExpression returns XThrowExpression
XAndExpression.XBinaryOperati... | [
"Contexts",
":",
"XExpression",
"returns",
"XThrowExpression",
"XAssignment",
"returns",
"XThrowExpression",
"XAssignment",
".",
"XBinaryOperation_1_1_0_0_0",
"returns",
"XThrowExpression",
"XOrExpression",
"returns",
"XThrowExpression",
"XOrExpression",
".",
"XBinaryOperation_1_... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java#L1620-L1628 |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/resources/DictionaryBuilder.java | DictionaryBuilder.addWord | public DictionaryBuilder addWord(final String word, final int rank) {
"""
Add word to dictionary.
@param word key to add to the dictionary, will be lowercased.
@param rank the rank of the word in the dictionary.
Should increment from most common to least common if ranked.
If unranked, an example would be if ... | java | public DictionaryBuilder addWord(final String word, final int rank)
{
this.dictonary.put(word.toLowerCase(), rank);
return this;
} | [
"public",
"DictionaryBuilder",
"addWord",
"(",
"final",
"String",
"word",
",",
"final",
"int",
"rank",
")",
"{",
"this",
".",
"dictonary",
".",
"put",
"(",
"word",
".",
"toLowerCase",
"(",
")",
",",
"rank",
")",
";",
"return",
"this",
";",
"}"
] | Add word to dictionary.
@param word key to add to the dictionary, will be lowercased.
@param rank the rank of the word in the dictionary.
Should increment from most common to least common if ranked.
If unranked, an example would be if there were 500 values in the dictionary, every word should have a rank of 250.
If ex... | [
"Add",
"word",
"to",
"dictionary",
"."
] | train | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/resources/DictionaryBuilder.java#L49-L53 |
joniles/mpxj | src/main/java/net/sf/mpxj/RecurringData.java | RecurringData.getMonthlyRelativeDates | private void getMonthlyRelativeDates(Calendar calendar, int frequency, List<Date> dates) {
"""
Calculate start dates for a monthly relative recurrence.
@param calendar current date
@param frequency frequency
@param dates array of start dates
"""
long startDate = calendar.getTimeInMillis();
cal... | java | private void getMonthlyRelativeDates(Calendar calendar, int frequency, List<Date> dates)
{
long startDate = calendar.getTimeInMillis();
calendar.set(Calendar.DAY_OF_MONTH, 1);
int dayNumber = NumberHelper.getInt(m_dayNumber);
while (moreDates(calendar, dates))
{
if (dayNumber ... | [
"private",
"void",
"getMonthlyRelativeDates",
"(",
"Calendar",
"calendar",
",",
"int",
"frequency",
",",
"List",
"<",
"Date",
">",
"dates",
")",
"{",
"long",
"startDate",
"=",
"calendar",
".",
"getTimeInMillis",
"(",
")",
";",
"calendar",
".",
"set",
"(",
... | Calculate start dates for a monthly relative recurrence.
@param calendar current date
@param frequency frequency
@param dates array of start dates | [
"Calculate",
"start",
"dates",
"for",
"a",
"monthly",
"relative",
"recurrence",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/RecurringData.java#L483-L511 |
JavaMoney/jsr354-api | src/main/java/javax/money/convert/MonetaryConversions.java | MonetaryConversions.isConversionAvailable | public static boolean isConversionAvailable(String currencyCode, String... providers) {
"""
Checks if a {@link javax.money.convert.CurrencyConversion} is available for the given parameters.
@param currencyCode The currency code, resolvable by {@link javax.money.Monetary#getCurrency
(String, String...)}
@param... | java | public static boolean isConversionAvailable(String currencyCode, String... providers){
return getMonetaryConversionsSpi()
.isConversionAvailable(Monetary.getCurrency(currencyCode), providers);
} | [
"public",
"static",
"boolean",
"isConversionAvailable",
"(",
"String",
"currencyCode",
",",
"String",
"...",
"providers",
")",
"{",
"return",
"getMonetaryConversionsSpi",
"(",
")",
".",
"isConversionAvailable",
"(",
"Monetary",
".",
"getCurrency",
"(",
"currencyCode",... | Checks if a {@link javax.money.convert.CurrencyConversion} is available for the given parameters.
@param currencyCode The currency code, resolvable by {@link javax.money.Monetary#getCurrency
(String, String...)}
@param providers Additional providers, for building a provider chain
@return true, if a conversion is ac... | [
"Checks",
"if",
"a",
"{",
"@link",
"javax",
".",
"money",
".",
"convert",
".",
"CurrencyConversion",
"}",
"is",
"available",
"for",
"the",
"given",
"parameters",
"."
] | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/convert/MonetaryConversions.java#L144-L147 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/SpringUtil.java | SpringUtil.getBean | public static <T> T getBean(String id, Class<T> clazz) {
"""
Returns the bean with an id matching the specified id, or null if none found.
@param <T> Class of return type.
@param id Bean id
@param clazz Expected return type.
@return Returns the bean instance whose id matches the specified id, or null if none... | java | public static <T> T getBean(String id, Class<T> clazz) {
ApplicationContext appContext = getAppContext();
return appContext == null ? null
: appContext.containsBean(id) && appContext.isTypeMatch(id, clazz) ? appContext.getBean(id, clazz) : null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getBean",
"(",
"String",
"id",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"ApplicationContext",
"appContext",
"=",
"getAppContext",
"(",
")",
";",
"return",
"appContext",
"==",
"null",
"?",
"null",
":",
"ap... | Returns the bean with an id matching the specified id, or null if none found.
@param <T> Class of return type.
@param id Bean id
@param clazz Expected return type.
@return Returns the bean instance whose id matches the specified id, or null if none found or
if the application context cannot be determined. | [
"Returns",
"the",
"bean",
"with",
"an",
"id",
"matching",
"the",
"specified",
"id",
"or",
"null",
"if",
"none",
"found",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/SpringUtil.java#L106-L110 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/patterns/observer/SubjectRegistry.java | SubjectRegistry.removeRegistraion | @SuppressWarnings( {
"""
Remove an observer for a registered observer
@param <T> the class type
@param subjectName the subject name to remove
@param subjectObserver the subject observer
""" "unchecked", "rawtypes" })
public <T> void removeRegistraion(String subjectName, SubjectObserver<T> subjectObserver... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public <T> void removeRegistraion(String subjectName, SubjectObserver<T> subjectObserver)
{
Subject subject = (Subject)this.registry.get(subjectName);
if(subject == null)
return;
subject.remove(subjectObserver);
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"<",
"T",
">",
"void",
"removeRegistraion",
"(",
"String",
"subjectName",
",",
"SubjectObserver",
"<",
"T",
">",
"subjectObserver",
")",
"{",
"Subject",
"subject",
"="... | Remove an observer for a registered observer
@param <T> the class type
@param subjectName the subject name to remove
@param subjectObserver the subject observer | [
"Remove",
"an",
"observer",
"for",
"a",
"registered",
"observer"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/patterns/observer/SubjectRegistry.java#L81-L91 |
haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ProxyServlet.java | ProxyServlet.copyHeadersFromClient | private void copyHeadersFromClient(HttpServletRequest pRequest, HttpURLConnection pRemoteConnection) {
"""
Copies headers from the client (the incoming {@code HttpServletRequest})
to the outgoing connection.
All headers except the "Host" header are copied.
@param pRequest
@param pRemoteConnection
"""
... | java | private void copyHeadersFromClient(HttpServletRequest pRequest, HttpURLConnection pRemoteConnection) {
Enumeration headerNames = pRequest.getHeaderNames();
while (headerNames.hasMoreElements()) {
String headerName = (String) headerNames.nextElement();
Enumeration headerValues... | [
"private",
"void",
"copyHeadersFromClient",
"(",
"HttpServletRequest",
"pRequest",
",",
"HttpURLConnection",
"pRemoteConnection",
")",
"{",
"Enumeration",
"headerNames",
"=",
"pRequest",
".",
"getHeaderNames",
"(",
")",
";",
"while",
"(",
"headerNames",
".",
"hasMoreE... | Copies headers from the client (the incoming {@code HttpServletRequest})
to the outgoing connection.
All headers except the "Host" header are copied.
@param pRequest
@param pRemoteConnection | [
"Copies",
"headers",
"from",
"the",
"client",
"(",
"the",
"incoming",
"{",
"@code",
"HttpServletRequest",
"}",
")",
"to",
"the",
"outgoing",
"connection",
".",
"All",
"headers",
"except",
"the",
"Host",
"header",
"are",
"copied",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ProxyServlet.java#L407-L436 |
documents4j/documents4j | documents4j-util-conversion/src/main/java/com/documents4j/job/AbstractConverterBuilder.java | AbstractConverterBuilder.workerPool | @SuppressWarnings("unchecked")
public T workerPool(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit) {
"""
Configures a worker pool for the converter. This worker pool implicitly sets a maximum
number of conversions that are concurrently undertaken by the resulting converter. When a
c... | java | @SuppressWarnings("unchecked")
public T workerPool(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit) {
assertNumericArgument(corePoolSize, true);
assertNumericArgument(maximumPoolSize, false);
assertSmallerEquals(corePoolSize, maximumPoolSize);
assertNumericAr... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"T",
"workerPool",
"(",
"int",
"corePoolSize",
",",
"int",
"maximumPoolSize",
",",
"long",
"keepAliveTime",
",",
"TimeUnit",
"unit",
")",
"{",
"assertNumericArgument",
"(",
"corePoolSize",
",",
"true",
... | Configures a worker pool for the converter. This worker pool implicitly sets a maximum
number of conversions that are concurrently undertaken by the resulting converter. When a
converter is requested to concurrently execute more conversions than {@code maximumPoolSize},
it will queue excess conversions until capacities... | [
"Configures",
"a",
"worker",
"pool",
"for",
"the",
"converter",
".",
"This",
"worker",
"pool",
"implicitly",
"sets",
"a",
"maximum",
"number",
"of",
"conversions",
"that",
"are",
"concurrently",
"undertaken",
"by",
"the",
"resulting",
"converter",
".",
"When",
... | train | https://github.com/documents4j/documents4j/blob/eebb3ede43ffeb5fbfc85b3134f67a9c379a5594/documents4j-util-conversion/src/main/java/com/documents4j/job/AbstractConverterBuilder.java#L73-L84 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java | PackageSummaryBuilder.buildEnumSummary | public void buildEnumSummary(XMLNode node, Content summaryContentTree) {
"""
Build the summary for the enums in this package.
@param node the XML element that specifies which components to document
@param summaryContentTree the summary tree to which the enum summary will
be added
"""
String enumTa... | java | public void buildEnumSummary(XMLNode node, Content summaryContentTree) {
String enumTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Enum_Summary"),
configuration.getText("doclet.enums"));
List<String> enumT... | [
"public",
"void",
"buildEnumSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"summaryContentTree",
")",
"{",
"String",
"enumTableSummary",
"=",
"configuration",
".",
"getText",
"(",
"\"doclet.Member_Table_Summary\"",
",",
"configuration",
".",
"getText",
"(",
"\"docl... | Build the summary for the enums in this package.
@param node the XML element that specifies which components to document
@param summaryContentTree the summary tree to which the enum summary will
be added | [
"Build",
"the",
"summary",
"for",
"the",
"enums",
"in",
"this",
"package",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java#L227-L243 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.matchCondition | public SDVariable matchCondition(SDVariable in, Condition condition) {
"""
Returns a boolean mask of equal shape to the input, where the condition is satisfied - value 1 where satisfied, 0 otherwise
@param in Input variable
@param condition Condition
@return Boolean mask mariable
"""
return... | java | public SDVariable matchCondition(SDVariable in, Condition condition) {
return matchCondition(null, in, condition);
} | [
"public",
"SDVariable",
"matchCondition",
"(",
"SDVariable",
"in",
",",
"Condition",
"condition",
")",
"{",
"return",
"matchCondition",
"(",
"null",
",",
"in",
",",
"condition",
")",
";",
"}"
] | Returns a boolean mask of equal shape to the input, where the condition is satisfied - value 1 where satisfied, 0 otherwise
@param in Input variable
@param condition Condition
@return Boolean mask mariable | [
"Returns",
"a",
"boolean",
"mask",
"of",
"equal",
"shape",
"to",
"the",
"input",
"where",
"the",
"condition",
"is",
"satisfied",
"-",
"value",
"1",
"where",
"satisfied",
"0",
"otherwise"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L974-L976 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/IntCounter.java | IntCounter.setCount | public void setCount(E key, int count) {
"""
Sets the current count for the given key. This will wipe out any existing
count for that key.
<p/>
To add to a count instead of replacing it, use
{@link #incrementCount(Object,int)}.
"""
if (tempMInteger == null) {
tempMInteger = new MutableInteger()... | java | public void setCount(E key, int count) {
if (tempMInteger == null) {
tempMInteger = new MutableInteger();
}
tempMInteger.set(count);
tempMInteger = map.put(key, tempMInteger);
totalCount += count;
if (tempMInteger != null) {
totalCount -= tempMInteger.intValue();
}
... | [
"public",
"void",
"setCount",
"(",
"E",
"key",
",",
"int",
"count",
")",
"{",
"if",
"(",
"tempMInteger",
"==",
"null",
")",
"{",
"tempMInteger",
"=",
"new",
"MutableInteger",
"(",
")",
";",
"}",
"tempMInteger",
".",
"set",
"(",
"count",
")",
";",
"te... | Sets the current count for the given key. This will wipe out any existing
count for that key.
<p/>
To add to a count instead of replacing it, use
{@link #incrementCount(Object,int)}. | [
"Sets",
"the",
"current",
"count",
"for",
"the",
"given",
"key",
".",
"This",
"will",
"wipe",
"out",
"any",
"existing",
"count",
"for",
"that",
"key",
".",
"<p",
"/",
">",
"To",
"add",
"to",
"a",
"count",
"instead",
"of",
"replacing",
"it",
"use",
"{... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/IntCounter.java#L189-L202 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/JobScheduleOperations.java | JobScheduleOperations.getJobSchedule | public CloudJobSchedule getJobSchedule(String jobScheduleId, DetailLevel detailLevel) throws BatchErrorException, IOException {
"""
Gets the specified {@link CloudJobSchedule}.
@param jobScheduleId The ID of the job schedule.
@param detailLevel A {@link DetailLevel} used for controlling which properties are re... | java | public CloudJobSchedule getJobSchedule(String jobScheduleId, DetailLevel detailLevel) throws BatchErrorException, IOException {
return getJobSchedule(jobScheduleId, detailLevel, null);
} | [
"public",
"CloudJobSchedule",
"getJobSchedule",
"(",
"String",
"jobScheduleId",
",",
"DetailLevel",
"detailLevel",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"return",
"getJobSchedule",
"(",
"jobScheduleId",
",",
"detailLevel",
",",
"null",
")",
";... | Gets the specified {@link CloudJobSchedule}.
@param jobScheduleId The ID of the job schedule.
@param detailLevel A {@link DetailLevel} used for controlling which properties are retrieved from the service.
@return A {@link CloudJobSchedule} containing information about the specified Azure Batch job schedule.
@throws Ba... | [
"Gets",
"the",
"specified",
"{",
"@link",
"CloudJobSchedule",
"}",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobScheduleOperations.java#L145-L147 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_account_primaryEmailAddress_outlookURL_POST | public OvhTask organizationName_service_exchangeService_account_primaryEmailAddress_outlookURL_POST(String organizationName, String exchangeService, String primaryEmailAddress, OvhLanguageEnum language, OvhOutlookVersionEnum version) throws IOException {
"""
Generate outlook url
REST: POST /email/exchange/{orga... | java | public OvhTask organizationName_service_exchangeService_account_primaryEmailAddress_outlookURL_POST(String organizationName, String exchangeService, String primaryEmailAddress, OvhLanguageEnum language, OvhOutlookVersionEnum version) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exc... | [
"public",
"OvhTask",
"organizationName_service_exchangeService_account_primaryEmailAddress_outlookURL_POST",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"primaryEmailAddress",
",",
"OvhLanguageEnum",
"language",
",",
"OvhOutlookVersionEnum",
... | Generate outlook url
REST: POST /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/outlookURL
@param version [required] Version of outlook
@param language [required] Language of outlook
@param organizationName [required] The internal name of your exchange organization
@param exc... | [
"Generate",
"outlook",
"url"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L2058-L2066 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/internal/io/SchemaTypeAdapter.java | SchemaTypeAdapter.readUnion | private Schema readUnion(JsonReader reader, Set<String> knownRecords) throws IOException {
"""
Constructs {@link Schema.Type#UNION UNION} type schema from the json input.
@param reader The {@link JsonReader} for streaming json input tokens.
@param knownRecords Set of record name already encountered during the ... | java | private Schema readUnion(JsonReader reader, Set<String> knownRecords) throws IOException {
ImmutableList.Builder<Schema> unionSchemas = ImmutableList.builder();
reader.beginArray();
while (reader.peek() != JsonToken.END_ARRAY) {
unionSchemas.add(read(reader, knownRecords));
}
reader.endArray()... | [
"private",
"Schema",
"readUnion",
"(",
"JsonReader",
"reader",
",",
"Set",
"<",
"String",
">",
"knownRecords",
")",
"throws",
"IOException",
"{",
"ImmutableList",
".",
"Builder",
"<",
"Schema",
">",
"unionSchemas",
"=",
"ImmutableList",
".",
"builder",
"(",
")... | Constructs {@link Schema.Type#UNION UNION} type schema from the json input.
@param reader The {@link JsonReader} for streaming json input tokens.
@param knownRecords Set of record name already encountered during the reading.
@return A {@link Schema} of type {@link Schema.Type#UNION UNION}.
@throws java.io.IOException ... | [
"Constructs",
"{",
"@link",
"Schema",
".",
"Type#UNION",
"UNION",
"}",
"type",
"schema",
"from",
"the",
"json",
"input",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/internal/io/SchemaTypeAdapter.java#L127-L135 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/util/SaslUtils.java | SaslUtils.getSaslClientFactories | public static Iterator<SaslClientFactory> getSaslClientFactories(ClassLoader classLoader, boolean includeGlobal) {
"""
Returns an iterator of all of the registered {@code SaslClientFactory}s where the order is based on the
order of the Provider registration and/or class path order. Class path providers are liste... | java | public static Iterator<SaslClientFactory> getSaslClientFactories(ClassLoader classLoader, boolean includeGlobal) {
return getFactories(SaslClientFactory.class, classLoader, includeGlobal);
} | [
"public",
"static",
"Iterator",
"<",
"SaslClientFactory",
">",
"getSaslClientFactories",
"(",
"ClassLoader",
"classLoader",
",",
"boolean",
"includeGlobal",
")",
"{",
"return",
"getFactories",
"(",
"SaslClientFactory",
".",
"class",
",",
"classLoader",
",",
"includeGl... | Returns an iterator of all of the registered {@code SaslClientFactory}s where the order is based on the
order of the Provider registration and/or class path order. Class path providers are listed before
global providers; in the event of a name conflict, the class path provider is preferred.
@param classLoader the cla... | [
"Returns",
"an",
"iterator",
"of",
"all",
"of",
"the",
"registered",
"{",
"@code",
"SaslClientFactory",
"}",
"s",
"where",
"the",
"order",
"is",
"based",
"on",
"the",
"order",
"of",
"the",
"Provider",
"registration",
"and",
"/",
"or",
"class",
"path",
"ord... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/SaslUtils.java#L54-L56 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.