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 |
|---|---|---|---|---|---|---|---|---|---|---|
jblas-project/jblas | src/main/java/org/jblas/Eigen.java | Eigen.symmetricGeneralizedEigenvalues | public static DoubleMatrix symmetricGeneralizedEigenvalues(DoubleMatrix A, DoubleMatrix B) {
"""
Compute generalized eigenvalues of the problem A x = L B x.
@param A symmetric Matrix A. Only the upper triangle will be considered.
@param B symmetric Matrix B. Only the upper triangle will be considered.
@return... | java | public static DoubleMatrix symmetricGeneralizedEigenvalues(DoubleMatrix A, DoubleMatrix B) {
A.assertSquare();
B.assertSquare();
DoubleMatrix W = new DoubleMatrix(A.rows);
SimpleBlas.sygvd(1, 'N', 'U', A.dup(), B.dup(), W);
return W;
} | [
"public",
"static",
"DoubleMatrix",
"symmetricGeneralizedEigenvalues",
"(",
"DoubleMatrix",
"A",
",",
"DoubleMatrix",
"B",
")",
"{",
"A",
".",
"assertSquare",
"(",
")",
";",
"B",
".",
"assertSquare",
"(",
")",
";",
"DoubleMatrix",
"W",
"=",
"new",
"DoubleMatri... | Compute generalized eigenvalues of the problem A x = L B x.
@param A symmetric Matrix A. Only the upper triangle will be considered.
@param B symmetric Matrix B. Only the upper triangle will be considered.
@return a vector of eigenvalues L. | [
"Compute",
"generalized",
"eigenvalues",
"of",
"the",
"problem",
"A",
"x",
"=",
"L",
"B",
"x",
"."
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Eigen.java#L134-L140 |
trellis-ldp/trellis | core/http/src/main/java/org/trellisldp/http/impl/GetHandler.java | GetHandler.standardHeaders | public ResponseBuilder standardHeaders(final ResponseBuilder builder) {
"""
Get the standard headers.
@param builder the response builder
@return the response builder
"""
// Standard HTTP Headers
builder.lastModified(from(getResource().getModified())).header(VARY, ACCEPT);
final IRI... | java | public ResponseBuilder standardHeaders(final ResponseBuilder builder) {
// Standard HTTP Headers
builder.lastModified(from(getResource().getModified())).header(VARY, ACCEPT);
final IRI model;
if (getRequest().getExt() == null || DESCRIPTION.equals(getRequest().getExt())) {
... | [
"public",
"ResponseBuilder",
"standardHeaders",
"(",
"final",
"ResponseBuilder",
"builder",
")",
"{",
"// Standard HTTP Headers",
"builder",
".",
"lastModified",
"(",
"from",
"(",
"getResource",
"(",
")",
".",
"getModified",
"(",
")",
")",
")",
".",
"header",
"(... | Get the standard headers.
@param builder the response builder
@return the response builder | [
"Get",
"the",
"standard",
"headers",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/impl/GetHandler.java#L168-L197 |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.setPattern | public void setPattern(Tag tag, String regex) {
"""
Change the pattern of the tag.
@param tag the tag.
@param regex the regular expression.
"""
if (Strings.isNullOrEmpty(regex)) {
this.rawPatterns.remove(tag);
this.compiledPatterns.remove(tag);
} else {
this.rawPatterns.put(tag, regex);
... | java | public void setPattern(Tag tag, String regex) {
if (Strings.isNullOrEmpty(regex)) {
this.rawPatterns.remove(tag);
this.compiledPatterns.remove(tag);
} else {
this.rawPatterns.put(tag, regex);
this.compiledPatterns.put(tag, Pattern.compile("^\\s*" + regex, PATTERN_COMPILE_OPTIONS)); //$NON-NLS-1$
... | [
"public",
"void",
"setPattern",
"(",
"Tag",
"tag",
",",
"String",
"regex",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"regex",
")",
")",
"{",
"this",
".",
"rawPatterns",
".",
"remove",
"(",
"tag",
")",
";",
"this",
".",
"compiledPattern... | Change the pattern of the tag.
@param tag the tag.
@param regex the regular expression. | [
"Change",
"the",
"pattern",
"of",
"the",
"tag",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L289-L297 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java | BindDataSourceBuilder.orderEntitiesList | public static List<SQLiteEntity> orderEntitiesList(SQLiteDatabaseSchema schema) {
"""
Generate ordered entities list.
@param schema
the schema
@return the list
"""
List<SQLiteEntity> entities = schema.getEntitiesAsList();
Collections.sort(entities, new Comparator<SQLiteEntity>() {
@Override
pub... | java | public static List<SQLiteEntity> orderEntitiesList(SQLiteDatabaseSchema schema) {
List<SQLiteEntity> entities = schema.getEntitiesAsList();
Collections.sort(entities, new Comparator<SQLiteEntity>() {
@Override
public int compare(SQLiteEntity lhs, SQLiteEntity rhs) {
return lhs.getTableName().compareTo(rh... | [
"public",
"static",
"List",
"<",
"SQLiteEntity",
">",
"orderEntitiesList",
"(",
"SQLiteDatabaseSchema",
"schema",
")",
"{",
"List",
"<",
"SQLiteEntity",
">",
"entities",
"=",
"schema",
".",
"getEntitiesAsList",
"(",
")",
";",
"Collections",
".",
"sort",
"(",
"... | Generate ordered entities list.
@param schema
the schema
@return the list | [
"Generate",
"ordered",
"entities",
"list",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java#L1008-L1034 |
google/identity-toolkit-java-client | src/main/java/com/google/identitytoolkit/RpcHelper.java | RpcHelper.getAccountInfo | public JSONObject getAccountInfo(String idToken)
throws GitkitClientException, GitkitServerException {
"""
Uses idToken to retrieve the user account information from GITkit service.
@param idToken
"""
try {
// Uses idToken to make the server call to GITKit
JSONObject params = new JSONO... | java | public JSONObject getAccountInfo(String idToken)
throws GitkitClientException, GitkitServerException {
try {
// Uses idToken to make the server call to GITKit
JSONObject params = new JSONObject().put("idToken", idToken);
return invokeGoogle2LegOauthApi("getAccountInfo", params);
} catch ... | [
"public",
"JSONObject",
"getAccountInfo",
"(",
"String",
"idToken",
")",
"throws",
"GitkitClientException",
",",
"GitkitServerException",
"{",
"try",
"{",
"// Uses idToken to make the server call to GITKit",
"JSONObject",
"params",
"=",
"new",
"JSONObject",
"(",
")",
".",... | Uses idToken to retrieve the user account information from GITkit service.
@param idToken | [
"Uses",
"idToken",
"to",
"retrieve",
"the",
"user",
"account",
"information",
"from",
"GITkit",
"service",
"."
] | train | https://github.com/google/identity-toolkit-java-client/blob/61dda1aabbd541ad5e431e840fd266bfca5f8a4a/src/main/java/com/google/identitytoolkit/RpcHelper.java#L129-L138 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vod/VodClient.java | VodClient.updateMediaResource | public UpdateMediaResourceResponse updateMediaResource(String mediaId, String title, String description) {
"""
Update the title and description for the specific media resource managed by VOD service.
<p>
The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair.
@param mediaId The u... | java | public UpdateMediaResourceResponse updateMediaResource(String mediaId, String title, String description) {
UpdateMediaResourceRequest request =
new UpdateMediaResourceRequest().withMediaId(mediaId).withTitle(title).withDescription(description);
return updateMediaResource(request);
} | [
"public",
"UpdateMediaResourceResponse",
"updateMediaResource",
"(",
"String",
"mediaId",
",",
"String",
"title",
",",
"String",
"description",
")",
"{",
"UpdateMediaResourceRequest",
"request",
"=",
"new",
"UpdateMediaResourceRequest",
"(",
")",
".",
"withMediaId",
"("... | Update the title and description for the specific media resource managed by VOD service.
<p>
The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair.
@param mediaId The unique ID for each media resource
@param title New title string
@param description New description string
@return empty re... | [
"Update",
"the",
"title",
"and",
"description",
"for",
"the",
"specific",
"media",
"resource",
"managed",
"by",
"VOD",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L633-L638 |
kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java | KieServerHttpRequest.encodeUrlToUTF8 | static String encodeUrlToUTF8( final CharSequence url ) throws KieServerHttpRequestException {
"""
Encode the given URL as an ASCII {@link String}
<p>
This method ensures the path and query segments of the URL are properly encoded such as ' ' characters being encoded to '%20'
or any UTF-8 characters that are no... | java | static String encodeUrlToUTF8( final CharSequence url ) throws KieServerHttpRequestException {
URL parsed;
try {
parsed = new URL(url.toString());
} catch( IOException ioe ) {
throw new KieServerHttpRequestException("Unable to encode url '" + url.toString() + "'", ioe);
... | [
"static",
"String",
"encodeUrlToUTF8",
"(",
"final",
"CharSequence",
"url",
")",
"throws",
"KieServerHttpRequestException",
"{",
"URL",
"parsed",
";",
"try",
"{",
"parsed",
"=",
"new",
"URL",
"(",
"url",
".",
"toString",
"(",
")",
")",
";",
"}",
"catch",
"... | Encode the given URL as an ASCII {@link String}
<p>
This method ensures the path and query segments of the URL are properly encoded such as ' ' characters being encoded to '%20'
or any UTF-8 characters that are non-ASCII. No encoding of URLs is done by default by the {@link KieServerHttpRequest}
constructors and so if ... | [
"Encode",
"the",
"given",
"URL",
"as",
"an",
"ASCII",
"{",
"@link",
"String",
"}",
"<p",
">",
"This",
"method",
"ensures",
"the",
"path",
"and",
"query",
"segments",
"of",
"the",
"URL",
"are",
"properly",
"encoded",
"such",
"as",
"characters",
"being",
"... | train | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java#L471-L494 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/SubnetsInner.java | SubnetsInner.listAsync | public Observable<Page<SubnetInner>> listAsync(final String resourceGroupName, final String virtualNetworkName) {
"""
Gets all subnets in a virtual network.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@throws IllegalArgumentException thro... | java | public Observable<Page<SubnetInner>> listAsync(final String resourceGroupName, final String virtualNetworkName) {
return listWithServiceResponseAsync(resourceGroupName, virtualNetworkName)
.map(new Func1<ServiceResponse<Page<SubnetInner>>, Page<SubnetInner>>() {
@Override
... | [
"public",
"Observable",
"<",
"Page",
"<",
"SubnetInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"virtualNetworkName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetwor... | Gets all subnets in a virtual network.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<SubnetInner> object | [
"Gets",
"all",
"subnets",
"in",
"a",
"virtual",
"network",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/SubnetsInner.java#L670-L678 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Graphics.java | Graphics.fillOval | public void fillOval(float x1, float y1, float width, float height) {
"""
Fill an oval to the canvas
@param x1
The x coordinate of the top left corner of a box containing
the oval
@param y1
The y coordinate of the top left corner of a box containing
the oval
@param width
The width of the oval
@param hei... | java | public void fillOval(float x1, float y1, float width, float height) {
fillOval(x1, y1, width, height, DEFAULT_SEGMENTS);
} | [
"public",
"void",
"fillOval",
"(",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"width",
",",
"float",
"height",
")",
"{",
"fillOval",
"(",
"x1",
",",
"y1",
",",
"width",
",",
"height",
",",
"DEFAULT_SEGMENTS",
")",
";",
"}"
] | Fill an oval to the canvas
@param x1
The x coordinate of the top left corner of a box containing
the oval
@param y1
The y coordinate of the top left corner of a box containing
the oval
@param width
The width of the oval
@param height
The height of the oval | [
"Fill",
"an",
"oval",
"to",
"the",
"canvas"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Graphics.java#L1027-L1029 |
venmo/cursor-utils | cursor-utils/src/main/java/com/venmo/cursor/IterableCursorWrapper.java | IterableCursorWrapper.getInteger | public int getInteger(String columnName, int defaultValue) {
"""
Convenience alias to {@code getInt\(getColumnIndex(columnName))}. If the column does not
exist for the cursor, return {@code defaultValue}.
"""
int index = getColumnIndex(columnName);
if (isValidIndex(index)) {
return... | java | public int getInteger(String columnName, int defaultValue) {
int index = getColumnIndex(columnName);
if (isValidIndex(index)) {
return getInt(index);
} else {
return defaultValue;
}
} | [
"public",
"int",
"getInteger",
"(",
"String",
"columnName",
",",
"int",
"defaultValue",
")",
"{",
"int",
"index",
"=",
"getColumnIndex",
"(",
"columnName",
")",
";",
"if",
"(",
"isValidIndex",
"(",
"index",
")",
")",
"{",
"return",
"getInt",
"(",
"index",
... | Convenience alias to {@code getInt\(getColumnIndex(columnName))}. If the column does not
exist for the cursor, return {@code defaultValue}. | [
"Convenience",
"alias",
"to",
"{"
] | train | https://github.com/venmo/cursor-utils/blob/52cf91c4253346632fe70b8d7b7eab8bbcc9b248/cursor-utils/src/main/java/com/venmo/cursor/IterableCursorWrapper.java#L110-L117 |
OpenLiberty/open-liberty | dev/com.ibm.ws.junit.extensions/src/com/ibm/websphere/ras/CapturedOutputHolder.java | CapturedOutputHolder.writeCapturedData | private synchronized ByteArrayOutputStream writeCapturedData(SystemLogHolder holder, String txt, ByteArrayOutputStream capturedStream) {
"""
Write the text from the string (and the text for a newline) into the captured
byte array. If all is well, return the hushed stream for the next write.
If there is an except... | java | private synchronized ByteArrayOutputStream writeCapturedData(SystemLogHolder holder, String txt, ByteArrayOutputStream capturedStream) {
try {
capturedStream.write(txt.getBytes());
// If we're running in an Eclipse GUI, tee the output for usability
if (IS_RUNNING_IN_ECLIPSE)... | [
"private",
"synchronized",
"ByteArrayOutputStream",
"writeCapturedData",
"(",
"SystemLogHolder",
"holder",
",",
"String",
"txt",
",",
"ByteArrayOutputStream",
"capturedStream",
")",
"{",
"try",
"{",
"capturedStream",
".",
"write",
"(",
"txt",
".",
"getBytes",
"(",
"... | Write the text from the string (and the text for a newline) into the captured
byte array. If all is well, return the hushed stream for the next write.
If there is an exception writing to the stream, return null to disable subsequent
writes.
@param holder LogHolder : system err or system out
@param txt Text to be logge... | [
"Write",
"the",
"text",
"from",
"the",
"string",
"(",
"and",
"the",
"text",
"for",
"a",
"newline",
")",
"into",
"the",
"captured",
"byte",
"array",
".",
"If",
"all",
"is",
"well",
"return",
"the",
"hushed",
"stream",
"for",
"the",
"next",
"write",
".",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.junit.extensions/src/com/ibm/websphere/ras/CapturedOutputHolder.java#L192-L211 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/ConditionalFunctions.java | ConditionalFunctions.ifInf | public static Expression ifInf(Expression expression1, Expression expression2, Expression... others) {
"""
Returned expression results in first non-MISSING, non-Inf number.
Returns MISSING or NULL if a non-number input is encountered first.
"""
return build("IFINF", expression1, expression2, others);
... | java | public static Expression ifInf(Expression expression1, Expression expression2, Expression... others) {
return build("IFINF", expression1, expression2, others);
} | [
"public",
"static",
"Expression",
"ifInf",
"(",
"Expression",
"expression1",
",",
"Expression",
"expression2",
",",
"Expression",
"...",
"others",
")",
"{",
"return",
"build",
"(",
"\"IFINF\"",
",",
"expression1",
",",
"expression2",
",",
"others",
")",
";",
"... | Returned expression results in first non-MISSING, non-Inf number.
Returns MISSING or NULL if a non-number input is encountered first. | [
"Returned",
"expression",
"results",
"in",
"first",
"non",
"-",
"MISSING",
"non",
"-",
"Inf",
"number",
".",
"Returns",
"MISSING",
"or",
"NULL",
"if",
"a",
"non",
"-",
"number",
"input",
"is",
"encountered",
"first",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/ConditionalFunctions.java#L100-L102 |
camunda/camunda-bpmn-model | src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractCallActivityBuilder.java | AbstractCallActivityBuilder.camundaOut | public B camundaOut(String source, String target) {
"""
Sets a "camunda out" parameter to pass a variable from a sub process instance to the super process instance
@param source the name of variable in the sub process instance
@param target the name of the variable in the super process instance
@return the bu... | java | public B camundaOut(String source, String target) {
CamundaOut param = modelInstance.newInstance(CamundaOut.class);
param.setCamundaSource(source);
param.setCamundaTarget(target);
addExtensionElement(param);
return myself;
} | [
"public",
"B",
"camundaOut",
"(",
"String",
"source",
",",
"String",
"target",
")",
"{",
"CamundaOut",
"param",
"=",
"modelInstance",
".",
"newInstance",
"(",
"CamundaOut",
".",
"class",
")",
";",
"param",
".",
"setCamundaSource",
"(",
"source",
")",
";",
... | Sets a "camunda out" parameter to pass a variable from a sub process instance to the super process instance
@param source the name of variable in the sub process instance
@param target the name of the variable in the super process instance
@return the builder object | [
"Sets",
"a",
"camunda",
"out",
"parameter",
"to",
"pass",
"a",
"variable",
"from",
"a",
"sub",
"process",
"instance",
"to",
"the",
"super",
"process",
"instance"
] | train | https://github.com/camunda/camunda-bpmn-model/blob/debcadf041d10fa62b799de0307b832cea84e5d4/src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractCallActivityBuilder.java#L181-L187 |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java | MongoDBDialect.getEmbeddingEntity | private Document getEmbeddingEntity(AssociationKey key, AssociationContext associationContext) {
"""
Returns a {@link Document} representing the entity which embeds the specified association.
"""
Document embeddingEntityDocument = associationContext.getEntityTuplePointer().getTuple() != null ?
( (MongoDB... | java | private Document getEmbeddingEntity(AssociationKey key, AssociationContext associationContext) {
Document embeddingEntityDocument = associationContext.getEntityTuplePointer().getTuple() != null ?
( (MongoDBTupleSnapshot) associationContext.getEntityTuplePointer().getTuple().getSnapshot() ).getDbObject() : null;
... | [
"private",
"Document",
"getEmbeddingEntity",
"(",
"AssociationKey",
"key",
",",
"AssociationContext",
"associationContext",
")",
"{",
"Document",
"embeddingEntityDocument",
"=",
"associationContext",
".",
"getEntityTuplePointer",
"(",
")",
".",
"getTuple",
"(",
")",
"!=... | Returns a {@link Document} representing the entity which embeds the specified association. | [
"Returns",
"a",
"{"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java#L315-L329 |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.prepareQuery | @Override
public Query prepareQuery(String queryString, String baseURI) throws RepositoryException, MalformedQueryException {
"""
overload for prepareQuery
@param queryString
@param baseURI
@return MarkLogicQuery
@throws RepositoryException
@throws MalformedQueryException
"""
return prepareQ... | java | @Override
public Query prepareQuery(String queryString, String baseURI) throws RepositoryException, MalformedQueryException {
return prepareQuery(QueryLanguage.SPARQL, queryString, baseURI);
} | [
"@",
"Override",
"public",
"Query",
"prepareQuery",
"(",
"String",
"queryString",
",",
"String",
"baseURI",
")",
"throws",
"RepositoryException",
",",
"MalformedQueryException",
"{",
"return",
"prepareQuery",
"(",
"QueryLanguage",
".",
"SPARQL",
",",
"queryString",
... | overload for prepareQuery
@param queryString
@param baseURI
@return MarkLogicQuery
@throws RepositoryException
@throws MalformedQueryException | [
"overload",
"for",
"prepareQuery"
] | train | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L164-L167 |
alibaba/transmittable-thread-local | src/main/java/com/alibaba/ttl/TtlRunnable.java | TtlRunnable.gets | @Nonnull
public static List<TtlRunnable> gets(@Nullable Collection<? extends Runnable> tasks, boolean releaseTtlValueReferenceAfterRun) {
"""
wrap input {@link Runnable} Collection to {@link TtlRunnable} Collection.
@param tasks task to be wrapped. if input is {@code null}, return... | java | @Nonnull
public static List<TtlRunnable> gets(@Nullable Collection<? extends Runnable> tasks, boolean releaseTtlValueReferenceAfterRun) {
return gets(tasks, releaseTtlValueReferenceAfterRun, false);
} | [
"@",
"Nonnull",
"public",
"static",
"List",
"<",
"TtlRunnable",
">",
"gets",
"(",
"@",
"Nullable",
"Collection",
"<",
"?",
"extends",
"Runnable",
">",
"tasks",
",",
"boolean",
"releaseTtlValueReferenceAfterRun",
")",
"{",
"return",
"gets",
"(",
"tasks",
",",
... | wrap input {@link Runnable} Collection to {@link TtlRunnable} Collection.
@param tasks task to be wrapped. if input is {@code null}, return {@code null}.
@param releaseTtlValueReferenceAfterRun release TTL value reference after run, avoid memory leak even if {@link TtlRunnable} is referred.
... | [
"wrap",
"input",
"{",
"@link",
"Runnable",
"}",
"Collection",
"to",
"{",
"@link",
"TtlRunnable",
"}",
"Collection",
"."
] | train | https://github.com/alibaba/transmittable-thread-local/blob/30b4d99cdb7064b4c1797d2e40bfa07adce8e7f9/src/main/java/com/alibaba/ttl/TtlRunnable.java#L153-L156 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/datetime/PDTFormatter.java | PDTFormatter.getFormatterDateTime | @Nonnull
public static DateTimeFormatter getFormatterDateTime (@Nonnull final FormatStyle eStyle,
@Nullable final Locale aDisplayLocale,
@Nonnull final EDTFormatterMode eMode) {
"""
Get the date time f... | java | @Nonnull
public static DateTimeFormatter getFormatterDateTime (@Nonnull final FormatStyle eStyle,
@Nullable final Locale aDisplayLocale,
@Nonnull final EDTFormatterMode eMode)
{
return _getFormatter (... | [
"@",
"Nonnull",
"public",
"static",
"DateTimeFormatter",
"getFormatterDateTime",
"(",
"@",
"Nonnull",
"final",
"FormatStyle",
"eStyle",
",",
"@",
"Nullable",
"final",
"Locale",
"aDisplayLocale",
",",
"@",
"Nonnull",
"final",
"EDTFormatterMode",
"eMode",
")",
"{",
... | Get the date time formatter for the passed locale.
@param eStyle
The format style to be used. May not be <code>null</code>.
@param aDisplayLocale
The display locale to be used. May be <code>null</code>.
@param eMode
Print or parse? May not be <code>null</code>.
@return The created date time formatter. Never <code>null... | [
"Get",
"the",
"date",
"time",
"formatter",
"for",
"the",
"passed",
"locale",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/datetime/PDTFormatter.java#L297-L303 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java | TimeFinder.timeOfBeat | private long timeOfBeat(BeatGrid beatGrid, int beatNumber, DeviceUpdate update) {
"""
Translates a beat number to a track time, given a beat grid. In almost all cases, simply delegates that task
to the beat grid. However, since players sometimes report beats that are outside the beat grid (especially when
loopin... | java | private long timeOfBeat(BeatGrid beatGrid, int beatNumber, DeviceUpdate update) {
if (beatNumber <= beatGrid.beatCount) {
return beatGrid.getTimeWithinTrack(beatNumber);
}
logger.warn("Received beat number " + beatNumber + " from " + update.getDeviceName() + " " +
upd... | [
"private",
"long",
"timeOfBeat",
"(",
"BeatGrid",
"beatGrid",
",",
"int",
"beatNumber",
",",
"DeviceUpdate",
"update",
")",
"{",
"if",
"(",
"beatNumber",
"<=",
"beatGrid",
".",
"beatCount",
")",
"{",
"return",
"beatGrid",
".",
"getTimeWithinTrack",
"(",
"beatN... | Translates a beat number to a track time, given a beat grid. In almost all cases, simply delegates that task
to the beat grid. However, since players sometimes report beats that are outside the beat grid (especially when
looping tracks that extend for more than a beat's worth of time past the last beat in the beat grid... | [
"Translates",
"a",
"beat",
"number",
"to",
"a",
"track",
"time",
"given",
"a",
"beat",
"grid",
".",
"In",
"almost",
"all",
"cases",
"simply",
"delegates",
"that",
"task",
"to",
"the",
"beat",
"grid",
".",
"However",
"since",
"players",
"sometimes",
"report... | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/TimeFinder.java#L499-L512 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java | AnnotationTypeBuilder.buildAnnotationTypeDoc | public void buildAnnotationTypeDoc(XMLNode node, Content contentTree) throws DocletException {
"""
Build the annotation type documentation.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the documentation will be added
@throws DocletExcepti... | java | public void buildAnnotationTypeDoc(XMLNode node, Content contentTree) throws DocletException {
contentTree = writer.getHeader(configuration.getText("doclet.AnnotationType") +
" " + utils.getSimpleName(annotationType));
Content annotationContentTree = writer.getAnnotationContentHeader();
... | [
"public",
"void",
"buildAnnotationTypeDoc",
"(",
"XMLNode",
"node",
",",
"Content",
"contentTree",
")",
"throws",
"DocletException",
"{",
"contentTree",
"=",
"writer",
".",
"getHeader",
"(",
"configuration",
".",
"getText",
"(",
"\"doclet.AnnotationType\"",
")",
"+"... | Build the annotation type documentation.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the documentation will be added
@throws DocletException if there is a problem building the documentation | [
"Build",
"the",
"annotation",
"type",
"documentation",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java#L121-L130 |
alipay/sofa-rpc | extension-impl/remoting-bolt/src/main/java/com/alipay/sofa/rpc/codec/bolt/SimpleMapSerializer.java | SimpleMapSerializer.writeInt | private void writeInt(OutputStream out, int i) throws IOException {
"""
OutputStream.write(int) 仅 write 第一个 byte, 而不是整个 int
@param out OutputStream
@param i int value
@throws IOException if an I/O error occurs.
"""
out.write((byte) (i >> 24));
out.write((byte) (i >> 16));
out.write... | java | private void writeInt(OutputStream out, int i) throws IOException {
out.write((byte) (i >> 24));
out.write((byte) (i >> 16));
out.write((byte) (i >> 8));
out.write(i);
} | [
"private",
"void",
"writeInt",
"(",
"OutputStream",
"out",
",",
"int",
"i",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"(",
"byte",
")",
"(",
"i",
">>",
"24",
")",
")",
";",
"out",
".",
"write",
"(",
"(",
"byte",
")",
"(",
"i",
... | OutputStream.write(int) 仅 write 第一个 byte, 而不是整个 int
@param out OutputStream
@param i int value
@throws IOException if an I/O error occurs. | [
"OutputStream",
".",
"write",
"(",
"int",
")",
"仅",
"write",
"第一个",
"byte",
"而不是整个",
"int"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/remoting-bolt/src/main/java/com/alipay/sofa/rpc/codec/bolt/SimpleMapSerializer.java#L137-L142 |
liferay/com-liferay-commerce | commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java | CommerceCurrencyPersistenceImpl.removeByG_P_A | @Override
public void removeByG_P_A(long groupId, boolean primary, boolean active) {
"""
Removes all the commerce currencies where groupId = ? and primary = ? and active = ? from the database.
@param groupId the group ID
@param primary the primary
@param active the active
"""
for (CommerceC... | java | @Override
public void removeByG_P_A(long groupId, boolean primary, boolean active) {
for (CommerceCurrency commerceCurrency : findByG_P_A(groupId, primary,
active, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceCurrency);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_P_A",
"(",
"long",
"groupId",
",",
"boolean",
"primary",
",",
"boolean",
"active",
")",
"{",
"for",
"(",
"CommerceCurrency",
"commerceCurrency",
":",
"findByG_P_A",
"(",
"groupId",
",",
"primary",
",",
"active",
",... | Removes all the commerce currencies where groupId = ? and primary = ? and active = ? from the database.
@param groupId the group ID
@param primary the primary
@param active the active | [
"Removes",
"all",
"the",
"commerce",
"currencies",
"where",
"groupId",
"=",
"?",
";",
"and",
"primary",
"=",
"?",
";",
"and",
"active",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java#L3847-L3853 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java | Agg.rankBy | public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<Long>> rankBy(U value, Function<? super T, ? extends U> function) {
"""
Get a {@link Collector} that calculates the derived <code>RANK()</code> function given natural ordering.
"""
return rankBy(value, function, naturalOrder())... | java | public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<Long>> rankBy(U value, Function<? super T, ? extends U> function) {
return rankBy(value, function, naturalOrder());
} | [
"public",
"static",
"<",
"T",
",",
"U",
"extends",
"Comparable",
"<",
"?",
"super",
"U",
">",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Optional",
"<",
"Long",
">",
">",
"rankBy",
"(",
"U",
"value",
",",
"Function",
"<",
"?",
"super",
"T",
",",... | Get a {@link Collector} that calculates the derived <code>RANK()</code> function given natural ordering. | [
"Get",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java#L669-L671 |
groovy/groovy-core | src/main/groovy/lang/GroovyClassLoader.java | GroovyClassLoader.defineClass | public Class defineClass(ClassNode classNode, String file, String newCodeBase) {
"""
Loads the given class node returning the implementation Class.
<p>
WARNING: this compilation is not synchronized
@param classNode
@return a class
"""
CodeSource codeSource = null;
try {
codeSo... | java | public Class defineClass(ClassNode classNode, String file, String newCodeBase) {
CodeSource codeSource = null;
try {
codeSource = new CodeSource(new URL("file", "", newCodeBase), (java.security.cert.Certificate[]) null);
} catch (MalformedURLException e) {
//swallow
... | [
"public",
"Class",
"defineClass",
"(",
"ClassNode",
"classNode",
",",
"String",
"file",
",",
"String",
"newCodeBase",
")",
"{",
"CodeSource",
"codeSource",
"=",
"null",
";",
"try",
"{",
"codeSource",
"=",
"new",
"CodeSource",
"(",
"new",
"URL",
"(",
"\"file\... | Loads the given class node returning the implementation Class.
<p>
WARNING: this compilation is not synchronized
@param classNode
@return a class | [
"Loads",
"the",
"given",
"class",
"node",
"returning",
"the",
"implementation",
"Class",
".",
"<p",
">",
"WARNING",
":",
"this",
"compilation",
"is",
"not",
"synchronized"
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/lang/GroovyClassLoader.java#L168-L187 |
leadware/jpersistence-tools | jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/utils/RestrictionsContainer.java | RestrictionsContainer.addNotEq | public <Y extends Comparable<? super Y>> RestrictionsContainer addNotEq(String property, Y value) {
"""
Methode d'ajout de la restriction NotEq
@param property Nom de la Propriete
@param value Valeur de la propriete
@param <Y> Type de valeur
@return Conteneur
"""
// Ajout de la restriction
restri... | java | public <Y extends Comparable<? super Y>> RestrictionsContainer addNotEq(String property, Y value) {
// Ajout de la restriction
restrictions.add(new NotEq<Y>(property, value));
// On retourne le conteneur
return this;
} | [
"public",
"<",
"Y",
"extends",
"Comparable",
"<",
"?",
"super",
"Y",
">",
">",
"RestrictionsContainer",
"addNotEq",
"(",
"String",
"property",
",",
"Y",
"value",
")",
"{",
"// Ajout de la restriction\r",
"restrictions",
".",
"add",
"(",
"new",
"NotEq",
"<",
... | Methode d'ajout de la restriction NotEq
@param property Nom de la Propriete
@param value Valeur de la propriete
@param <Y> Type de valeur
@return Conteneur | [
"Methode",
"d",
"ajout",
"de",
"la",
"restriction",
"NotEq"
] | train | https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/utils/RestrictionsContainer.java#L105-L112 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java | EnglishEnums.valueOf | public static <T extends Enum<T>> T valueOf(final Class<T> enumType, final String name) {
"""
Returns the Result for the given string.
<p>
The {@code name} is converted internally to upper case with the {@linkplain Locale#ENGLISH ENGLISH} locale to
avoid problems on the Turkish locale. Do not use with Turkish e... | java | public static <T extends Enum<T>> T valueOf(final Class<T> enumType, final String name) {
return valueOf(enumType, name, null);
} | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"valueOf",
"(",
"final",
"Class",
"<",
"T",
">",
"enumType",
",",
"final",
"String",
"name",
")",
"{",
"return",
"valueOf",
"(",
"enumType",
",",
"name",
",",
"null",
")",
";... | Returns the Result for the given string.
<p>
The {@code name} is converted internally to upper case with the {@linkplain Locale#ENGLISH ENGLISH} locale to
avoid problems on the Turkish locale. Do not use with Turkish enum values.
</p>
@param enumType The Class of the enum.
@param name The enum name, case-insensitive. ... | [
"Returns",
"the",
"Result",
"for",
"the",
"given",
"string",
".",
"<p",
">",
"The",
"{",
"@code",
"name",
"}",
"is",
"converted",
"internally",
"to",
"upper",
"case",
"with",
"the",
"{",
"@linkplain",
"Locale#ENGLISH",
"ENGLISH",
"}",
"locale",
"to",
"avoi... | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java#L49-L51 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.reverseIndexes | public int reverseIndexes(int... indexes) {
"""
Return the index of the value corresponding to the indexes
@param indexes
@return index of the value
"""
long[] idx = translateToPhysical(ArrayUtil.toLongArray(indexes));
sort();
// FIXME: int cast
return indexesBinarySearch(0, ... | java | public int reverseIndexes(int... indexes) {
long[] idx = translateToPhysical(ArrayUtil.toLongArray(indexes));
sort();
// FIXME: int cast
return indexesBinarySearch(0, (int) length(), ArrayUtil.toInts(idx));
} | [
"public",
"int",
"reverseIndexes",
"(",
"int",
"...",
"indexes",
")",
"{",
"long",
"[",
"]",
"idx",
"=",
"translateToPhysical",
"(",
"ArrayUtil",
".",
"toLongArray",
"(",
"indexes",
")",
")",
";",
"sort",
"(",
")",
";",
"// FIXME: int cast",
"return",
"ind... | Return the index of the value corresponding to the indexes
@param indexes
@return index of the value | [
"Return",
"the",
"index",
"of",
"the",
"value",
"corresponding",
"to",
"the",
"indexes"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java#L615-L621 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/FieldListener.java | FieldListener.getSyncedListenersField | public BaseField getSyncedListenersField(BaseField field, FieldListener listener) {
"""
When cloning a listener, if the field is contained in the source record, get the same field is the new record.
@param field
@param listener
@return
"""
if (field != null)
if (field.getRecord() == this... | java | public BaseField getSyncedListenersField(BaseField field, FieldListener listener)
{
if (field != null)
if (field.getRecord() == this.getOwner().getRecord())
field = listener.getOwner().getRecord().getField(field.getFieldName());
return field;
} | [
"public",
"BaseField",
"getSyncedListenersField",
"(",
"BaseField",
"field",
",",
"FieldListener",
"listener",
")",
"{",
"if",
"(",
"field",
"!=",
"null",
")",
"if",
"(",
"field",
".",
"getRecord",
"(",
")",
"==",
"this",
".",
"getOwner",
"(",
")",
".",
... | When cloning a listener, if the field is contained in the source record, get the same field is the new record.
@param field
@param listener
@return | [
"When",
"cloning",
"a",
"listener",
"if",
"the",
"field",
"is",
"contained",
"in",
"the",
"source",
"record",
"get",
"the",
"same",
"field",
"is",
"the",
"new",
"record",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/FieldListener.java#L132-L138 |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/concurrency/ThreadMethods.java | ThreadMethods.forkJoinExecution | public static void forkJoinExecution(Runnable runnable, ConcurrencyConfiguration concurrencyConfiguration, boolean parallelStream) {
"""
Alternative to parallelStreams() which executes a runnable in a separate
pool.
@param runnable
@param concurrencyConfiguration
@param parallelStream
"""
if(para... | java | public static void forkJoinExecution(Runnable runnable, ConcurrencyConfiguration concurrencyConfiguration, boolean parallelStream) {
if(parallelStream && concurrencyConfiguration.isParallelized()) {
try {
ForkJoinPool pool = new ForkJoinPool(concurrencyConfiguration.getMaxNumberOfThr... | [
"public",
"static",
"void",
"forkJoinExecution",
"(",
"Runnable",
"runnable",
",",
"ConcurrencyConfiguration",
"concurrencyConfiguration",
",",
"boolean",
"parallelStream",
")",
"{",
"if",
"(",
"parallelStream",
"&&",
"concurrencyConfiguration",
".",
"isParallelized",
"("... | Alternative to parallelStreams() which executes a runnable in a separate
pool.
@param runnable
@param concurrencyConfiguration
@param parallelStream | [
"Alternative",
"to",
"parallelStreams",
"()",
"which",
"executes",
"a",
"runnable",
"in",
"a",
"separate",
"pool",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/concurrency/ThreadMethods.java#L108-L122 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/CustomUserRegistryFactory.java | CustomUserRegistryFactory.setCustomUserRegistry | @Reference(cardinality = ReferenceCardinality.MULTIPLE,
policyOption = ReferencePolicyOption.GREEDY)
protected synchronized void setCustomUserRegistry(com.ibm.websphere.security.UserRegistry externalUserRegistry, Map<String, Object> props) {
"""
Method will be called for each com.ibm.websphere.s... | java | @Reference(cardinality = ReferenceCardinality.MULTIPLE,
policyOption = ReferencePolicyOption.GREEDY)
protected synchronized void setCustomUserRegistry(com.ibm.websphere.security.UserRegistry externalUserRegistry, Map<String, Object> props) {
String id = getId(props);
customUserRegistr... | [
"@",
"Reference",
"(",
"cardinality",
"=",
"ReferenceCardinality",
".",
"MULTIPLE",
",",
"policyOption",
"=",
"ReferencePolicyOption",
".",
"GREEDY",
")",
"protected",
"synchronized",
"void",
"setCustomUserRegistry",
"(",
"com",
".",
"ibm",
".",
"websphere",
".",
... | Method will be called for each com.ibm.websphere.security.UserRegistry that is
registered in the OSGi service registry. We maintain an internal set
of these for easy access.
@param ref Reference to a registered com.ibm.websphere.security.UserRegistry | [
"Method",
"will",
"be",
"called",
"for",
"each",
"com",
".",
"ibm",
".",
"websphere",
".",
"security",
".",
"UserRegistry",
"that",
"is",
"registered",
"in",
"the",
"OSGi",
"service",
"registry",
".",
"We",
"maintain",
"an",
"internal",
"set",
"of",
"these... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/CustomUserRegistryFactory.java#L56-L61 |
Alluxio/alluxio | core/base/src/main/java/alluxio/util/URIUtils.java | URIUtils.normalizedHash | private static int normalizedHash(int hash, String s) {
"""
Hashes a string (which includes octets) for a URI hash.
@param hash the input hash
@param s the string to hash and combine with the input hash
@return the resulting hash
"""
int nextHash = 0;
for (int index = 0; index < s.length(); index+... | java | private static int normalizedHash(int hash, String s) {
int nextHash = 0;
for (int index = 0; index < s.length(); index++) {
char ch = s.charAt(index);
nextHash = 31 * nextHash + ch;
if (ch == '%') {
// hash next 2 characters
index++;
nextHash = 31 * nextHash + URIUtils... | [
"private",
"static",
"int",
"normalizedHash",
"(",
"int",
"hash",
",",
"String",
"s",
")",
"{",
"int",
"nextHash",
"=",
"0",
";",
"for",
"(",
"int",
"index",
"=",
"0",
";",
"index",
"<",
"s",
".",
"length",
"(",
")",
";",
"index",
"++",
")",
"{",... | Hashes a string (which includes octets) for a URI hash.
@param hash the input hash
@param s the string to hash and combine with the input hash
@return the resulting hash | [
"Hashes",
"a",
"string",
"(",
"which",
"includes",
"octets",
")",
"for",
"a",
"URI",
"hash",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/util/URIUtils.java#L309-L324 |
opoo/opoopress | core/src/main/java/org/opoo/util/ArrayUtils.java | ArrayUtils.find | public static <T> T find(T[] array, Predicate<T> predicate) {
"""
Returns the first element in {@code array} that satisfies the given
predicate.
@param array
@param predicate
@param <T>
@return
"""
if(array == null){
return null;
}
for(T t: array){
if(pred... | java | public static <T> T find(T[] array, Predicate<T> predicate){
if(array == null){
return null;
}
for(T t: array){
if(predicate.apply(t)){
return t;
}
}
return null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"find",
"(",
"T",
"[",
"]",
"array",
",",
"Predicate",
"<",
"T",
">",
"predicate",
")",
"{",
"if",
"(",
"array",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"for",
"(",
"T",
"t",
":",
"array",
"... | Returns the first element in {@code array} that satisfies the given
predicate.
@param array
@param predicate
@param <T>
@return | [
"Returns",
"the",
"first",
"element",
"in",
"{",
"@code",
"array",
"}",
"that",
"satisfies",
"the",
"given",
"predicate",
"."
] | train | https://github.com/opoo/opoopress/blob/4ed0265d294c8b748be48cf097949aa905ff1df2/core/src/main/java/org/opoo/util/ArrayUtils.java#L36-L46 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/IsoChronology.java | IsoChronology.zonedDateTime | @Override // override with covariant return type
public ZonedDateTime zonedDateTime(Instant instant, ZoneId zone) {
"""
Obtains an ISO zoned date-time from an instant.
<p>
This is equivalent to {@link ZonedDateTime#ofInstant(Instant, ZoneId)}.
@param instant the instant to convert, not null
@param zone... | java | @Override // override with covariant return type
public ZonedDateTime zonedDateTime(Instant instant, ZoneId zone) {
return ZonedDateTime.ofInstant(instant, zone);
} | [
"@",
"Override",
"// override with covariant return type",
"public",
"ZonedDateTime",
"zonedDateTime",
"(",
"Instant",
"instant",
",",
"ZoneId",
"zone",
")",
"{",
"return",
"ZonedDateTime",
".",
"ofInstant",
"(",
"instant",
",",
"zone",
")",
";",
"}"
] | Obtains an ISO zoned date-time from an instant.
<p>
This is equivalent to {@link ZonedDateTime#ofInstant(Instant, ZoneId)}.
@param instant the instant to convert, not null
@param zone the zone to use, not null
@return the ISO zoned date-time, not null
@throws DateTimeException if unable to create the date-time | [
"Obtains",
"an",
"ISO",
"zoned",
"date",
"-",
"time",
"from",
"an",
"instant",
".",
"<p",
">",
"This",
"is",
"equivalent",
"to",
"{",
"@link",
"ZonedDateTime#ofInstant",
"(",
"Instant",
"ZoneId",
")",
"}",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/IsoChronology.java#L278-L281 |
code4everything/util | src/main/java/com/zhazhapan/util/ReflectUtils.java | ReflectUtils.executeExpression | public static Object executeExpression(String jexlExpression, Map<String, Object> map) {
"""
将字符串转成代码,并执行
<p>
<br><a href="https://blog.csdn.net/qq_26954773/article/details/80379015#3-%E6%B5%8B%E8%AF%95">怎么使用</a>
@param jexlExpression 代码表达式
@param map 参数映射
@return 执行结果
@since 1.0.8
"""
Jexl... | java | public static Object executeExpression(String jexlExpression, Map<String, Object> map) {
JexlExpression expression = jexlEngine.createExpression(jexlExpression);
JexlContext context = new MapContext();
if (Checker.isNotEmpty(map)) {
map.forEach(context::set);
}
return... | [
"public",
"static",
"Object",
"executeExpression",
"(",
"String",
"jexlExpression",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"JexlExpression",
"expression",
"=",
"jexlEngine",
".",
"createExpression",
"(",
"jexlExpression",
")",
";",
"Jexl... | 将字符串转成代码,并执行
<p>
<br><a href="https://blog.csdn.net/qq_26954773/article/details/80379015#3-%E6%B5%8B%E8%AF%95">怎么使用</a>
@param jexlExpression 代码表达式
@param map 参数映射
@return 执行结果
@since 1.0.8 | [
"将字符串转成代码,并执行",
"<p",
">",
"<br",
">",
"<a",
"href",
"=",
"https",
":",
"//",
"blog",
".",
"csdn",
".",
"net",
"/",
"qq_26954773",
"/",
"article",
"/",
"details",
"/",
"80379015#3",
"-",
"%E6%B5%8B%E8%AF%95",
">",
"怎么使用<",
"/",
"a",
">"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/ReflectUtils.java#L79-L86 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/eip/EipClient.java | EipClient.bindEip | public void bindEip(String eip, String instanceId, String instanceType) {
"""
bind the eip to a specified instanceId and instanceType(BCC|BLB).
@param eip eip address to be bound
@param instanceId id of instance to be bound
@param instanceType type of instance to be bound
"""
this.bindEip(new BindEi... | java | public void bindEip(String eip, String instanceId, String instanceType) {
this.bindEip(new BindEipRequest().withEip(eip).withInstanceId(instanceId).withInstanceType(instanceType));
} | [
"public",
"void",
"bindEip",
"(",
"String",
"eip",
",",
"String",
"instanceId",
",",
"String",
"instanceType",
")",
"{",
"this",
".",
"bindEip",
"(",
"new",
"BindEipRequest",
"(",
")",
".",
"withEip",
"(",
"eip",
")",
".",
"withInstanceId",
"(",
"instanceI... | bind the eip to a specified instanceId and instanceType(BCC|BLB).
@param eip eip address to be bound
@param instanceId id of instance to be bound
@param instanceType type of instance to be bound | [
"bind",
"the",
"eip",
"to",
"a",
"specified",
"instanceId",
"and",
"instanceType",
"(",
"BCC|BLB",
")",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/eip/EipClient.java#L202-L204 |
getsentry/sentry-java | sentry/src/main/java/io/sentry/connection/AsyncConnection.java | AsyncConnection.send | @Override
public void send(Event event) {
"""
{@inheritDoc}
<p>
The event will be added to a queue and will be handled by a separate {@code Thread} later on.
"""
if (!closed) {
executorService.execute(new EventSubmitter(event, MDC.getCopyOfContextMap()));
}
} | java | @Override
public void send(Event event) {
if (!closed) {
executorService.execute(new EventSubmitter(event, MDC.getCopyOfContextMap()));
}
} | [
"@",
"Override",
"public",
"void",
"send",
"(",
"Event",
"event",
")",
"{",
"if",
"(",
"!",
"closed",
")",
"{",
"executorService",
".",
"execute",
"(",
"new",
"EventSubmitter",
"(",
"event",
",",
"MDC",
".",
"getCopyOfContextMap",
"(",
")",
")",
")",
"... | {@inheritDoc}
<p>
The event will be added to a queue and will be handled by a separate {@code Thread} later on. | [
"{"
] | train | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/connection/AsyncConnection.java#L93-L98 |
hawkular/hawkular-agent | hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/inventory/InventoryIdUtil.java | InventoryIdUtil.generateMetricInstanceId | public static ID generateMetricInstanceId(String feedId, ID resourceId, MetricType<?> metricType) {
"""
Generates an ID for an {@link MetricInstance}.
@param resource the resource that owns the MetricInstance
@param metricType the type of the MetricInstance whose ID is being generated
@return the ID
"""... | java | public static ID generateMetricInstanceId(String feedId, ID resourceId, MetricType<?> metricType) {
ID id = new ID(String.format("MI~R~[%s/%s]~MT~%s", feedId, resourceId, metricType.getID()));
return id;
} | [
"public",
"static",
"ID",
"generateMetricInstanceId",
"(",
"String",
"feedId",
",",
"ID",
"resourceId",
",",
"MetricType",
"<",
"?",
">",
"metricType",
")",
"{",
"ID",
"id",
"=",
"new",
"ID",
"(",
"String",
".",
"format",
"(",
"\"MI~R~[%s/%s]~MT~%s\"",
",",
... | Generates an ID for an {@link MetricInstance}.
@param resource the resource that owns the MetricInstance
@param metricType the type of the MetricInstance whose ID is being generated
@return the ID | [
"Generates",
"an",
"ID",
"for",
"an",
"{",
"@link",
"MetricInstance",
"}",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/inventory/InventoryIdUtil.java#L96-L99 |
alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/MyScpClient.java | MyScpClient.put | public void put(byte[] data, String remoteFileName, String remoteTargetDirectory) throws IOException {
"""
Create a remote file and copy the contents of the passed byte array into it.
Uses mode 0600 for creating the remote file.
@param data the data to be copied into the remote file.
@param r... | java | public void put(byte[] data, String remoteFileName, String remoteTargetDirectory) throws IOException {
put(data, remoteFileName, remoteTargetDirectory, "0600");
} | [
"public",
"void",
"put",
"(",
"byte",
"[",
"]",
"data",
",",
"String",
"remoteFileName",
",",
"String",
"remoteTargetDirectory",
")",
"throws",
"IOException",
"{",
"put",
"(",
"data",
",",
"remoteFileName",
",",
"remoteTargetDirectory",
",",
"\"0600\"",
")",
"... | Create a remote file and copy the contents of the passed byte array into it.
Uses mode 0600 for creating the remote file.
@param data the data to be copied into the remote file.
@param remoteFileName The name of the file which will be created in the remote target directory.
@param remoteTargetD... | [
"Create",
"a",
"remote",
"file",
"and",
"copy",
"the",
"contents",
"of",
"the",
"passed",
"byte",
"array",
"into",
"it",
".",
"Uses",
"mode",
"0600",
"for",
"creating",
"the",
"remote",
"file",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/MyScpClient.java#L343-L345 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/DepAnn.java | DepAnn.checkDeprecatedAnnotation | @SuppressWarnings("javadoc")
private Description checkDeprecatedAnnotation(Tree tree, VisitorState state) {
"""
Reports a dep-ann error for a declaration if: (1) javadoc contains the deprecated javadoc tag
(2) the declaration is not annotated with {@link java.lang.Deprecated}
"""
Symbol symbol = ASTHelp... | java | @SuppressWarnings("javadoc")
private Description checkDeprecatedAnnotation(Tree tree, VisitorState state) {
Symbol symbol = ASTHelpers.getSymbol(tree);
// (1)
// javac sets the DEPRECATED bit in flags if the Javadoc contains @deprecated
if ((symbol.flags() & DEPRECATED) == 0) {
return Descripti... | [
"@",
"SuppressWarnings",
"(",
"\"javadoc\"",
")",
"private",
"Description",
"checkDeprecatedAnnotation",
"(",
"Tree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"Symbol",
"symbol",
"=",
"ASTHelpers",
".",
"getSymbol",
"(",
"tree",
")",
";",
"// (1)",
"// ja... | Reports a dep-ann error for a declaration if: (1) javadoc contains the deprecated javadoc tag
(2) the declaration is not annotated with {@link java.lang.Deprecated} | [
"Reports",
"a",
"dep",
"-",
"ann",
"error",
"for",
"a",
"declaration",
"if",
":",
"(",
"1",
")",
"javadoc",
"contains",
"the",
"deprecated",
"javadoc",
"tag",
"(",
"2",
")",
"the",
"declaration",
"is",
"not",
"annotated",
"with",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/DepAnn.java#L70-L86 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java | ReviewsImpl.addVideoFrameStream | public void addVideoFrameStream(String teamName, String reviewId, String contentType, byte[] frameImageZip, String frameMetadata, AddVideoFrameStreamOptionalParameter addVideoFrameStreamOptionalParameter) {
"""
Use this method to add frames for a video review.Timescale: This parameter is a factor which is used to ... | java | public void addVideoFrameStream(String teamName, String reviewId, String contentType, byte[] frameImageZip, String frameMetadata, AddVideoFrameStreamOptionalParameter addVideoFrameStreamOptionalParameter) {
addVideoFrameStreamWithServiceResponseAsync(teamName, reviewId, contentType, frameImageZip, frameMetadata... | [
"public",
"void",
"addVideoFrameStream",
"(",
"String",
"teamName",
",",
"String",
"reviewId",
",",
"String",
"contentType",
",",
"byte",
"[",
"]",
"frameImageZip",
",",
"String",
"frameMetadata",
",",
"AddVideoFrameStreamOptionalParameter",
"addVideoFrameStreamOptionalPa... | Use this method to add frames for a video review.Timescale: This parameter is a factor which is used to convert the timestamp on a frame into milliseconds. Timescale is provided in the output of the Content Moderator video media processor on the Azure Media Services platform.Timescale in the Video Moderation output is ... | [
"Use",
"this",
"method",
"to",
"add",
"frames",
"for",
"a",
"video",
"review",
".",
"Timescale",
":",
"This",
"parameter",
"is",
"a",
"factor",
"which",
"is",
"used",
"to",
"convert",
"the",
"timestamp",
"on",
"a",
"frame",
"into",
"milliseconds",
".",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java#L2388-L2390 |
pf4j/pf4j | pf4j/src/main/java/org/pf4j/DefaultVersionManager.java | DefaultVersionManager.checkVersionConstraint | @Override
public boolean checkVersionConstraint(String version, String constraint) {
"""
Checks if a version satisfies the specified SemVer {@link Expression} string.
If the constraint is empty or null then the method returns true.
Constraint examples: {@code >2.0.0} (simple), {@code ">=1.4.0 & <1.6.0"} (ran... | java | @Override
public boolean checkVersionConstraint(String version, String constraint) {
return StringUtils.isNullOrEmpty(constraint) || Version.valueOf(version).satisfies(constraint);
} | [
"@",
"Override",
"public",
"boolean",
"checkVersionConstraint",
"(",
"String",
"version",
",",
"String",
"constraint",
")",
"{",
"return",
"StringUtils",
".",
"isNullOrEmpty",
"(",
"constraint",
")",
"||",
"Version",
".",
"valueOf",
"(",
"version",
")",
".",
"... | Checks if a version satisfies the specified SemVer {@link Expression} string.
If the constraint is empty or null then the method returns true.
Constraint examples: {@code >2.0.0} (simple), {@code ">=1.4.0 & <1.6.0"} (range).
See https://github.com/zafarkhaja/jsemver#semver-expressions-api-ranges for more info.
@param ... | [
"Checks",
"if",
"a",
"version",
"satisfies",
"the",
"specified",
"SemVer",
"{",
"@link",
"Expression",
"}",
"string",
".",
"If",
"the",
"constraint",
"is",
"empty",
"or",
"null",
"then",
"the",
"method",
"returns",
"true",
".",
"Constraint",
"examples",
":",... | train | https://github.com/pf4j/pf4j/blob/6dd7a6069f0e2fbd842c81e2c8c388918b88ea81/pf4j/src/main/java/org/pf4j/DefaultVersionManager.java#L40-L43 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/beans/AbstractBean.java | AbstractBean.changeState | void changeState(String propertyName, Object newValue) {
"""
Changes the value of the given property, referenced by name, to the new Object value, effectively modifying
the internal state of this Bean. This method uses the Java reflective APIs to set the field corresponding
to the specified property.
@param ... | java | void changeState(String propertyName, Object newValue) {
try {
ObjectUtils.setField(this, getFieldName(propertyName), newValue);
}
catch (IllegalArgumentException e) {
throw new PropertyNotFoundException(String.format(
"The property (%1$s) corresponding to field (%2$s) was not found in t... | [
"void",
"changeState",
"(",
"String",
"propertyName",
",",
"Object",
"newValue",
")",
"{",
"try",
"{",
"ObjectUtils",
".",
"setField",
"(",
"this",
",",
"getFieldName",
"(",
"propertyName",
")",
",",
"newValue",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentE... | Changes the value of the given property, referenced by name, to the new Object value, effectively modifying
the internal state of this Bean. This method uses the Java reflective APIs to set the field corresponding
to the specified property.
@param propertyName a String value specifying the name of the property (inter... | [
"Changes",
"the",
"value",
"of",
"the",
"given",
"property",
"referenced",
"by",
"name",
"to",
"the",
"new",
"Object",
"value",
"effectively",
"modifying",
"the",
"internal",
"state",
"of",
"this",
"Bean",
".",
"This",
"method",
"uses",
"the",
"Java",
"refle... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/beans/AbstractBean.java#L444-L453 |
voldemort/voldemort | src/java/voldemort/utils/JmxUtils.java | JmxUtils.registerMbean | public static ObjectName registerMbean(String typeName, Object obj) {
"""
Register the given object under the package name of the object's class
with the given type name.
this method using the platform mbean server as returned by
ManagementFactory.getPlatformMBeanServer()
@param typeName The name of the ty... | java | public static ObjectName registerMbean(String typeName, Object obj) {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
ObjectName name = JmxUtils.createObjectName(JmxUtils.getPackageName(obj.getClass()),
typeName);
registerMbean... | [
"public",
"static",
"ObjectName",
"registerMbean",
"(",
"String",
"typeName",
",",
"Object",
"obj",
")",
"{",
"MBeanServer",
"server",
"=",
"ManagementFactory",
".",
"getPlatformMBeanServer",
"(",
")",
";",
"ObjectName",
"name",
"=",
"JmxUtils",
".",
"createObject... | Register the given object under the package name of the object's class
with the given type name.
this method using the platform mbean server as returned by
ManagementFactory.getPlatformMBeanServer()
@param typeName The name of the type to register
@param obj The object to register as an mbean | [
"Register",
"the",
"given",
"object",
"under",
"the",
"package",
"name",
"of",
"the",
"object",
"s",
"class",
"with",
"the",
"given",
"type",
"name",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L300-L306 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/support/i18n/message/ResourceBundleMessageSource.java | ResourceBundleMessageSource.getStringOrNull | protected String getStringOrNull(ResourceBundle bundle, String key) {
"""
Efficiently retrieve the String value for the specified key,
or return {@code null} if not found.
@param bundle the ResourceBundle to perform the lookup in
@param key the key to look up
@return the associated value, or {@code null} if ... | java | protected String getStringOrNull(ResourceBundle bundle, String key) {
if (bundle.containsKey(key)) {
try {
return bundle.getString(key);
} catch (MissingResourceException ex) {
// Assume key not found for some other reason
// -> do NOT thro... | [
"protected",
"String",
"getStringOrNull",
"(",
"ResourceBundle",
"bundle",
",",
"String",
"key",
")",
"{",
"if",
"(",
"bundle",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"try",
"{",
"return",
"bundle",
".",
"getString",
"(",
"key",
")",
";",
"}",
... | Efficiently retrieve the String value for the specified key,
or return {@code null} if not found.
@param bundle the ResourceBundle to perform the lookup in
@param key the key to look up
@return the associated value, or {@code null} if none
@see ResourceBundle#getString(String) ResourceBundle#getString(String)
@see Res... | [
"Efficiently",
"retrieve",
"the",
"String",
"value",
"for",
"the",
"specified",
"key",
"or",
"return",
"{",
"@code",
"null",
"}",
"if",
"not",
"found",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/support/i18n/message/ResourceBundleMessageSource.java#L389-L399 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PathNormalizer.java | PathNormalizer.joinDomainToPath | public static String joinDomainToPath(String domainName, String path) {
"""
Normalizes a domain name and a path and joins them as a single url.
@param domainName
@param path
@return
"""
StringBuilder sb = new StringBuilder();
if (domainName.endsWith(JawrConstant.URL_SEPARATOR)) {
sb.append(domainNa... | java | public static String joinDomainToPath(String domainName, String path) {
StringBuilder sb = new StringBuilder();
if (domainName.endsWith(JawrConstant.URL_SEPARATOR)) {
sb.append(domainName.substring(0, domainName.length() - 1));
} else {
sb.append(domainName);
}
sb.append(JawrConstant.URL_SEPARATOR).app... | [
"public",
"static",
"String",
"joinDomainToPath",
"(",
"String",
"domainName",
",",
"String",
"path",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"domainName",
".",
"endsWith",
"(",
"JawrConstant",
".",
"URL_SEPARATO... | Normalizes a domain name and a path and joins them as a single url.
@param domainName
@param path
@return | [
"Normalizes",
"a",
"domain",
"name",
"and",
"a",
"path",
"and",
"joins",
"them",
"as",
"a",
"single",
"url",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PathNormalizer.java#L341-L353 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java | NodeIndexer.addNameValue | protected void addNameValue(Document doc, String fieldName, Object internalValue) {
"""
Adds the name value to the document as the named field. The name
value is converted to an indexable string treating the internal value
as a qualified name and mapping the name space using the name space
mappings with which t... | java | protected void addNameValue(Document doc, String fieldName, Object internalValue)
{
doc.add(createFieldWithoutNorms(fieldName, internalValue.toString(), PropertyType.NAME));
} | [
"protected",
"void",
"addNameValue",
"(",
"Document",
"doc",
",",
"String",
"fieldName",
",",
"Object",
"internalValue",
")",
"{",
"doc",
".",
"add",
"(",
"createFieldWithoutNorms",
"(",
"fieldName",
",",
"internalValue",
".",
"toString",
"(",
")",
",",
"Prope... | Adds the name value to the document as the named field. The name
value is converted to an indexable string treating the internal value
as a qualified name and mapping the name space using the name space
mappings with which this class has been created.
@param doc The document to which to add the field
@param ... | [
"Adds",
"the",
"name",
"value",
"to",
"the",
"document",
"as",
"the",
"named",
"field",
".",
"The",
"name",
"value",
"is",
"converted",
"to",
"an",
"indexable",
"string",
"treating",
"the",
"internal",
"value",
"as",
"a",
"qualified",
"name",
"and",
"mappi... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java#L894-L897 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/AttributeCollector.java | AttributeCollector.buildAttrOb | public ElemAttrs buildAttrOb() {
"""
Method needed by event creating code, to build a non-transient
attribute container, to use with XMLEvent objects (specifically
implementation of StartElement event).
"""
int count = mAttrCount;
if (count == 0) {
return null;
}
/... | java | public ElemAttrs buildAttrOb()
{
int count = mAttrCount;
if (count == 0) {
return null;
}
// If we have actual attributes, let's first just create the
// raw array that has all attribute information:
String[] raw = new String[count << 2];
for (int ... | [
"public",
"ElemAttrs",
"buildAttrOb",
"(",
")",
"{",
"int",
"count",
"=",
"mAttrCount",
";",
"if",
"(",
"count",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"// If we have actual attributes, let's first just create the",
"// raw array that has all attribute informa... | Method needed by event creating code, to build a non-transient
attribute container, to use with XMLEvent objects (specifically
implementation of StartElement event). | [
"Method",
"needed",
"by",
"event",
"creating",
"code",
"to",
"build",
"a",
"non",
"-",
"transient",
"attribute",
"container",
"to",
"use",
"with",
"XMLEvent",
"objects",
"(",
"specifically",
"implementation",
"of",
"StartElement",
"event",
")",
"."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/AttributeCollector.java#L727-L760 |
arquillian/arquillian-algeron | common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java | GitOperations.addAndCommit | public RevCommit addAndCommit(Git git, String message) {
"""
Add all files and commit them with given message. This is equivalent as doing git add . git commit -m "message".
@param git
instance.
@param message
of the commit.
@return RevCommit of this commit.
"""
try {
git.add()
... | java | public RevCommit addAndCommit(Git git, String message) {
try {
git.add()
.addFilepattern(".")
.call();
return git.commit()
.setMessage(message)
.call();
} catch (GitAPIException e) {
throw new IllegalStat... | [
"public",
"RevCommit",
"addAndCommit",
"(",
"Git",
"git",
",",
"String",
"message",
")",
"{",
"try",
"{",
"git",
".",
"add",
"(",
")",
".",
"addFilepattern",
"(",
"\".\"",
")",
".",
"call",
"(",
")",
";",
"return",
"git",
".",
"commit",
"(",
")",
"... | Add all files and commit them with given message. This is equivalent as doing git add . git commit -m "message".
@param git
instance.
@param message
of the commit.
@return RevCommit of this commit. | [
"Add",
"all",
"files",
"and",
"commit",
"them",
"with",
"given",
"message",
".",
"This",
"is",
"equivalent",
"as",
"doing",
"git",
"add",
".",
"git",
"commit",
"-",
"m",
"message",
"."
] | train | https://github.com/arquillian/arquillian-algeron/blob/ec79372defdafe99ab2f7bb696f1c1eabdbbacb6/common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java#L208-L219 |
googleads/googleads-java-lib | extensions/adwords_rate_limiter/src/main/java/com/google/api/ads/adwords/extension/ratelimiter/AdWordsServicesWithRateLimiter.java | AdWordsServicesWithRateLimiter.getProxyObject | private <T> T getProxyObject(
T originalObject, AdWordsSession session, Class<T> cls, boolean isUtility) {
"""
Decide whether this RateLimiter extension is applicable to the original service / utility
object. If so, wrap it in a proxy object with rate-limit-aware invocation handle; if not, just
return the ... | java | private <T> T getProxyObject(
T originalObject, AdWordsSession session, Class<T> cls, boolean isUtility) {
// Find the retry strategy of this class type.
ApiRetryStrategy retryStrategy =
ApiRetryStrategyManager.getRetryStrategy(cls.getSimpleName(), isUtility);
// If no corresponding retry str... | [
"private",
"<",
"T",
">",
"T",
"getProxyObject",
"(",
"T",
"originalObject",
",",
"AdWordsSession",
"session",
",",
"Class",
"<",
"T",
">",
"cls",
",",
"boolean",
"isUtility",
")",
"{",
"// Find the retry strategy of this class type.",
"ApiRetryStrategy",
"retryStra... | Decide whether this RateLimiter extension is applicable to the original service / utility
object. If so, wrap it in a proxy object with rate-limit-aware invocation handle; if not, just
return the original object. | [
"Decide",
"whether",
"this",
"RateLimiter",
"extension",
"is",
"applicable",
"to",
"the",
"original",
"service",
"/",
"utility",
"object",
".",
"If",
"so",
"wrap",
"it",
"in",
"a",
"proxy",
"object",
"with",
"rate",
"-",
"limit",
"-",
"aware",
"invocation",
... | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/extensions/adwords_rate_limiter/src/main/java/com/google/api/ads/adwords/extension/ratelimiter/AdWordsServicesWithRateLimiter.java#L72-L86 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.invokeVirtualQuiet | public MethodHandle invokeVirtualQuiet(MethodHandles.Lookup lookup, String name) {
"""
Apply the chain of transforms and bind them to a virtual method specified
using the end signature plus the given class and name. The method will
be retrieved using the given Lookup and must match the end signature
exactly.
... | java | public MethodHandle invokeVirtualQuiet(MethodHandles.Lookup lookup, String name) {
try {
return invokeVirtual(lookup, name);
} catch (IllegalAccessException | NoSuchMethodException e) {
throw new InvalidTransformException(e);
}
} | [
"public",
"MethodHandle",
"invokeVirtualQuiet",
"(",
"MethodHandles",
".",
"Lookup",
"lookup",
",",
"String",
"name",
")",
"{",
"try",
"{",
"return",
"invokeVirtual",
"(",
"lookup",
",",
"name",
")",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"|",
"NoSu... | Apply the chain of transforms and bind them to a virtual method specified
using the end signature plus the given class and name. The method will
be retrieved using the given Lookup and must match the end signature
exactly.
If the final handle's type does not exactly match the initial type for
this Binder, an additiona... | [
"Apply",
"the",
"chain",
"of",
"transforms",
"and",
"bind",
"them",
"to",
"a",
"virtual",
"method",
"specified",
"using",
"the",
"end",
"signature",
"plus",
"the",
"given",
"class",
"and",
"name",
".",
"The",
"method",
"will",
"be",
"retrieved",
"using",
"... | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1274-L1280 |
josesamuel/remoter | remoter/src/main/java/remoter/compiler/builder/ParamBuilder.java | ParamBuilder.writeOutParamsToStub | public void writeOutParamsToStub(VariableElement param, ParamType paramType, String paramName, MethodSpec.Builder methodBuilder) {
"""
Called to generate code to write @{@link remoter.annotations.ParamOut} params for stub
"""
if (paramType != ParamType.IN) {
methodBuilder.addStatement("int ... | java | public void writeOutParamsToStub(VariableElement param, ParamType paramType, String paramName, MethodSpec.Builder methodBuilder) {
if (paramType != ParamType.IN) {
methodBuilder.addStatement("int " + paramName + "_length = data.readInt()");
methodBuilder.beginControlFlow("if (" + paramNa... | [
"public",
"void",
"writeOutParamsToStub",
"(",
"VariableElement",
"param",
",",
"ParamType",
"paramType",
",",
"String",
"paramName",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
")",
"{",
"if",
"(",
"paramType",
"!=",
"ParamType",
".",
"IN",
")",
"{",
... | Called to generate code to write @{@link remoter.annotations.ParamOut} params for stub | [
"Called",
"to",
"generate",
"code",
"to",
"write"
] | train | https://github.com/josesamuel/remoter/blob/007401868c319740d40134ebc07c3406988f9a86/remoter/src/main/java/remoter/compiler/builder/ParamBuilder.java#L48-L59 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java | HttpUtils.executeGet | public static HttpResponse executeGet(final String url,
final String basicAuthUsername,
final String basicAuthPassword,
final Map<String, Object> parameters) {
"""
Execute get http response... | java | public static HttpResponse executeGet(final String url,
final String basicAuthUsername,
final String basicAuthPassword,
final Map<String, Object> parameters) {
try {
return e... | [
"public",
"static",
"HttpResponse",
"executeGet",
"(",
"final",
"String",
"url",
",",
"final",
"String",
"basicAuthUsername",
",",
"final",
"String",
"basicAuthPassword",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"try",
"{... | Execute get http response.
@param url the url
@param basicAuthUsername the basic auth username
@param basicAuthPassword the basic auth password
@param parameters the parameters
@return the http response | [
"Execute",
"get",
"http",
"response",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java#L195-L205 |
line/armeria | core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedValueResolver.java | AnnotatedValueResolver.ofServiceMethod | static List<AnnotatedValueResolver> ofServiceMethod(Method method, Set<String> pathParams,
List<RequestObjectResolver> objectResolvers) {
"""
Returns a list of {@link AnnotatedValueResolver} which is constructed with the specified
{@link Method}, {@code path... | java | static List<AnnotatedValueResolver> ofServiceMethod(Method method, Set<String> pathParams,
List<RequestObjectResolver> objectResolvers) {
return of(method, pathParams, objectResolvers, true, true);
} | [
"static",
"List",
"<",
"AnnotatedValueResolver",
">",
"ofServiceMethod",
"(",
"Method",
"method",
",",
"Set",
"<",
"String",
">",
"pathParams",
",",
"List",
"<",
"RequestObjectResolver",
">",
"objectResolvers",
")",
"{",
"return",
"of",
"(",
"method",
",",
"pa... | Returns a list of {@link AnnotatedValueResolver} which is constructed with the specified
{@link Method}, {@code pathParams} and {@code objectResolvers}. | [
"Returns",
"a",
"list",
"of",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedValueResolver.java#L140-L143 |
MindscapeHQ/raygun4android | provider/src/main/java/com.mindscapehq.android.raygun4android/network/RaygunNetworkLogger.java | RaygunNetworkLogger.cancelNetworkCall | public static synchronized void cancelNetworkCall(String url, String requestMethod, long endTime, String exception) {
"""
When a network request is cancelled we stop tracking it and do not send the information through.
Future updates may include sending the cancelled request timing through with information showin... | java | public static synchronized void cancelNetworkCall(String url, String requestMethod, long endTime, String exception) {
if (url != null) {
String id = sanitiseURL(url);
if ((connections != null) && (connections.containsKey(id))) {
connections.remove(id);
}
}
} | [
"public",
"static",
"synchronized",
"void",
"cancelNetworkCall",
"(",
"String",
"url",
",",
"String",
"requestMethod",
",",
"long",
"endTime",
",",
"String",
"exception",
")",
"{",
"if",
"(",
"url",
"!=",
"null",
")",
"{",
"String",
"id",
"=",
"sanitiseURL",... | When a network request is cancelled we stop tracking it and do not send the information through.
Future updates may include sending the cancelled request timing through with information showing it was cancelled. | [
"When",
"a",
"network",
"request",
"is",
"cancelled",
"we",
"stop",
"tracking",
"it",
"and",
"do",
"not",
"send",
"the",
"information",
"through",
".",
"Future",
"updates",
"may",
"include",
"sending",
"the",
"cancelled",
"request",
"timing",
"through",
"with"... | train | https://github.com/MindscapeHQ/raygun4android/blob/227231f9b8aca1cafa5b6518a388d128e37d35fe/provider/src/main/java/com.mindscapehq.android.raygun4android/network/RaygunNetworkLogger.java#L61-L68 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/reporter/ConfiguredScheduledReporter.java | ConfiguredScheduledReporter.getMetricNamePrefix | protected String getMetricNamePrefix(Map<String, Object> tags) {
"""
Constructs the prefix of metric key to be emitted.
Enriches {@link ConfiguredScheduledReporter#metricContextName} with the current task id and fork id to
be able to identify the emitted metric by its origin
@param tags
@return Prefix of the... | java | protected String getMetricNamePrefix(Map<String, Object> tags){
String currentContextName = (String) tags.get(MetricContext.METRIC_CONTEXT_NAME_TAG_NAME);
if (metricContextName == null || (currentContextName.indexOf(metricContextName) > -1)) {
return currentContextName;
}
return JOINER.join(Strin... | [
"protected",
"String",
"getMetricNamePrefix",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"tags",
")",
"{",
"String",
"currentContextName",
"=",
"(",
"String",
")",
"tags",
".",
"get",
"(",
"MetricContext",
".",
"METRIC_CONTEXT_NAME_TAG_NAME",
")",
";",
"if... | Constructs the prefix of metric key to be emitted.
Enriches {@link ConfiguredScheduledReporter#metricContextName} with the current task id and fork id to
be able to identify the emitted metric by its origin
@param tags
@return Prefix of the metric key | [
"Constructs",
"the",
"prefix",
"of",
"metric",
"key",
"to",
"be",
"emitted",
".",
"Enriches",
"{",
"@link",
"ConfiguredScheduledReporter#metricContextName",
"}",
"with",
"the",
"current",
"task",
"id",
"and",
"fork",
"id",
"to",
"be",
"able",
"to",
"identify",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/reporter/ConfiguredScheduledReporter.java#L232-L240 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arrays/IntegerArrayQuickSort.java | IntegerArrayQuickSort.insertionSort | private static void insertionSort(int[] data, final int start, final int end, IntComparator comp) {
"""
Insertion sort, for short arrays.
@param data Data to sort
@param start First index
@param end Last index (exclusive!)
@param comp Comparator
"""
// Classic insertion sort.
for(int i = start + ... | java | private static void insertionSort(int[] data, final int start, final int end, IntComparator comp) {
// Classic insertion sort.
for(int i = start + 1; i < end; i++) {
final int cur = data[i];
int j = i - 1;
while(j >= start) {
final int pre = data[j];
if(comp.compare(cur, pre) >... | [
"private",
"static",
"void",
"insertionSort",
"(",
"int",
"[",
"]",
"data",
",",
"final",
"int",
"start",
",",
"final",
"int",
"end",
",",
"IntComparator",
"comp",
")",
"{",
"// Classic insertion sort.",
"for",
"(",
"int",
"i",
"=",
"start",
"+",
"1",
";... | Insertion sort, for short arrays.
@param data Data to sort
@param start First index
@param end Last index (exclusive!)
@param comp Comparator | [
"Insertion",
"sort",
"for",
"short",
"arrays",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arrays/IntegerArrayQuickSort.java#L193-L208 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/MessageAPI.java | MessageAPI.templateApi_add_template | public static ApiAddTemplateResult templateApi_add_template(String access_token, String template_id_short) {
"""
模板消息 获得模板ID
@param access_token access_token
@param template_id_short template_id_short
@return ApiAddTemplateResult
@since 2.6.1
"""
String json = String.format("{\"template_id_s... | java | public static ApiAddTemplateResult templateApi_add_template(String access_token, String template_id_short) {
String json = String.format("{\"template_id_short\":\"%s\"}", template_id_short);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.set... | [
"public",
"static",
"ApiAddTemplateResult",
"templateApi_add_template",
"(",
"String",
"access_token",
",",
"String",
"template_id_short",
")",
"{",
"String",
"json",
"=",
"String",
".",
"format",
"(",
"\"{\\\"template_id_short\\\":\\\"%s\\\"}\"",
",",
"template_id_short",
... | 模板消息 获得模板ID
@param access_token access_token
@param template_id_short template_id_short
@return ApiAddTemplateResult
@since 2.6.1 | [
"模板消息",
"获得模板ID"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/MessageAPI.java#L393-L402 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPChainer.java | AFPChainer.afpPairConn | public static boolean afpPairConn(int afp1, int afp2, FatCatParameters params, AFPChain afpChain) {
"""
Key function: calculate the connectivity of AFP pairs
no compatibility criteria is executed
note: afp1 is previous to afp2 in terms of the position
this module must be optimized
@param afp1
@param afp2
... | java | public static boolean afpPairConn(int afp1, int afp2, FatCatParameters params, AFPChain afpChain)
{
Double conn = afpChain.getConn();
Double dvar = afpChain.getDVar();
double misScore = params.getMisScore();
double maxPenalty = params.getMaxPenalty();
double disCut = params.getDisCut();
double gapExten... | [
"public",
"static",
"boolean",
"afpPairConn",
"(",
"int",
"afp1",
",",
"int",
"afp2",
",",
"FatCatParameters",
"params",
",",
"AFPChain",
"afpChain",
")",
"{",
"Double",
"conn",
"=",
"afpChain",
".",
"getConn",
"(",
")",
";",
"Double",
"dvar",
"=",
"afpCha... | Key function: calculate the connectivity of AFP pairs
no compatibility criteria is executed
note: afp1 is previous to afp2 in terms of the position
this module must be optimized
@param afp1
@param afp2
@return flag if they are connected | [
"Key",
"function",
":",
"calculate",
"the",
"connectivity",
"of",
"AFP",
"pairs",
"no",
"compatibility",
"criteria",
"is",
"executed",
"note",
":",
"afp1",
"is",
"previous",
"to",
"afp2",
"in",
"terms",
"of",
"the",
"position",
"this",
"module",
"must",
"be"... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPChainer.java#L308-L357 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageScaling.java | ImageScaling.scale | public static void scale(Bitmap src, Bitmap dest, int clearColor,
int x, int y, int sw, int sh,
int dx, int dy,
int dw, int dh) {
"""
Scaling region of bitmap to destination bitmap region
@param src source bitmap
@par... | java | public static void scale(Bitmap src, Bitmap dest, int clearColor,
int x, int y, int sw, int sh,
int dx, int dy,
int dw, int dh) {
clearBitmap(dest, clearColor);
Canvas canvas = new Canvas(dest);
Paint paint = ... | [
"public",
"static",
"void",
"scale",
"(",
"Bitmap",
"src",
",",
"Bitmap",
"dest",
",",
"int",
"clearColor",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"sw",
",",
"int",
"sh",
",",
"int",
"dx",
",",
"int",
"dy",
",",
"int",
"dw",
",",
"int",
... | Scaling region of bitmap to destination bitmap region
@param src source bitmap
@param dest destination bitmap
@param clearColor color for clearing dest before drawing
@param x source x
@param y source y
@param sw source width
@param sh source height
@param dx dest... | [
"Scaling",
"region",
"of",
"bitmap",
"to",
"destination",
"bitmap",
"region"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageScaling.java#L173-L183 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Setter.java | Setter.setProgressBar | public void setProgressBar(final ProgressBar progressBar,final int progress) {
"""
Sets the progress of a given {@link ProgressBar}. Examples are SeekBar and RatingBar.
@param progressBar the {@code ProgressBar}
@param progress the progress that the {@code ProgressBar} should be set to
"""
if(progressBar !... | java | public void setProgressBar(final ProgressBar progressBar,final int progress) {
if(progressBar != null){
Activity activity = activityUtils.getCurrentActivity(false);
if(activity != null){
activity.runOnUiThread(new Runnable()
{
public void run()
{
try{
progressBar.setProgress(progr... | [
"public",
"void",
"setProgressBar",
"(",
"final",
"ProgressBar",
"progressBar",
",",
"final",
"int",
"progress",
")",
"{",
"if",
"(",
"progressBar",
"!=",
"null",
")",
"{",
"Activity",
"activity",
"=",
"activityUtils",
".",
"getCurrentActivity",
"(",
"false",
... | Sets the progress of a given {@link ProgressBar}. Examples are SeekBar and RatingBar.
@param progressBar the {@code ProgressBar}
@param progress the progress that the {@code ProgressBar} should be set to | [
"Sets",
"the",
"progress",
"of",
"a",
"given",
"{"
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Setter.java#L105-L120 |
kennycason/kumo | kumo-core/src/main/java/com/kennycason/kumo/WordCloud.java | WordCloud.computeRadius | static int computeRadius(final Dimension dimension, final Point start) {
"""
compute the maximum radius for the placing spiral
@param dimension the size of the backgound
@param start the center of the spiral
@return the maximum usefull radius
"""
final int maxDistanceX = Math.max(start.x, dimensio... | java | static int computeRadius(final Dimension dimension, final Point start) {
final int maxDistanceX = Math.max(start.x, dimension.width - start.x) + 1;
final int maxDistanceY = Math.max(start.y, dimension.height - start.y) + 1;
// we use the pythagorean theorem to determinate the maximum ra... | [
"static",
"int",
"computeRadius",
"(",
"final",
"Dimension",
"dimension",
",",
"final",
"Point",
"start",
")",
"{",
"final",
"int",
"maxDistanceX",
"=",
"Math",
".",
"max",
"(",
"start",
".",
"x",
",",
"dimension",
".",
"width",
"-",
"start",
".",
"x",
... | compute the maximum radius for the placing spiral
@param dimension the size of the backgound
@param start the center of the spiral
@return the maximum usefull radius | [
"compute",
"the",
"maximum",
"radius",
"for",
"the",
"placing",
"spiral"
] | train | https://github.com/kennycason/kumo/blob/bc577f468f162dbaf61c327a2d4f1989c61c57a0/kumo-core/src/main/java/com/kennycason/kumo/WordCloud.java#L171-L177 |
casmi/casmi | src/main/java/casmi/graphics/material/Material.java | Material.setSpecular | public void setSpecular(float red, float green, float blue) {
"""
Sets the specular color of the materials used for shapes drawn to the screen.
@param red
The red color of the specular.
@param green
The green color of the specular.
@param blue
The blue color of the specular.
"""
specular[0] = r... | java | public void setSpecular(float red, float green, float blue){
specular[0] = red;
specular[1] = green;
specular[2] = blue;
Sp = true;
} | [
"public",
"void",
"setSpecular",
"(",
"float",
"red",
",",
"float",
"green",
",",
"float",
"blue",
")",
"{",
"specular",
"[",
"0",
"]",
"=",
"red",
";",
"specular",
"[",
"1",
"]",
"=",
"green",
";",
"specular",
"[",
"2",
"]",
"=",
"blue",
";",
"S... | Sets the specular color of the materials used for shapes drawn to the screen.
@param red
The red color of the specular.
@param green
The green color of the specular.
@param blue
The blue color of the specular. | [
"Sets",
"the",
"specular",
"color",
"of",
"the",
"materials",
"used",
"for",
"shapes",
"drawn",
"to",
"the",
"screen",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/material/Material.java#L168-L173 |
super-csv/super-csv | super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/AbstractJodaParsingProcessor.java | AbstractJodaParsingProcessor.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null or is not a String
"""
validateInputNotNull(value, context);
if (!(value instanceof String)) {
throw new SuperCsvCellProcessorException(String.class, value,... | java | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
if (!(value instanceof String)) {
throw new SuperCsvCellProcessorException(String.class, value,
context, this);
}
final String string = (String) value;
final T result;
try {
if (formatter ... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"validateInputNotNull",
"(",
"value",
",",
"context",
")",
";",
"if",
"(",
"!",
"(",
"value",
"instanceof",
"String",
")",
")",
"{",
"throw",
... | {@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null or is not a String | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/AbstractJodaParsingProcessor.java#L115-L136 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/WikiManager.java | WikiManager.getWikiPageDetailByProjectAndTitle | public WikiPageDetail getWikiPageDetailByProjectAndTitle(String projectKey, String pageTitle) throws RedmineException {
"""
@param projectKey the key of the project (like "TEST-12") we want the wiki page from
@param pageTitle The name of the page
@return the wiki page titled with the name passed as parameter... | java | public WikiPageDetail getWikiPageDetailByProjectAndTitle(String projectKey, String pageTitle) throws RedmineException {
String urlSafeString = WikiPageDetail.getUrlSafeString(pageTitle);
WikiPageDetail wikiPageDetail = transport.getChildEntry(Project.class, projectKey, WikiPageDetail.class, urlSafeStrin... | [
"public",
"WikiPageDetail",
"getWikiPageDetailByProjectAndTitle",
"(",
"String",
"projectKey",
",",
"String",
"pageTitle",
")",
"throws",
"RedmineException",
"{",
"String",
"urlSafeString",
"=",
"WikiPageDetail",
".",
"getUrlSafeString",
"(",
"pageTitle",
")",
";",
"Wik... | @param projectKey the key of the project (like "TEST-12") we want the wiki page from
@param pageTitle The name of the page
@return the wiki page titled with the name passed as parameter
@since Redmine 2.2 | [
"@param",
"projectKey",
"the",
"key",
"of",
"the",
"project",
"(",
"like",
"TEST",
"-",
"12",
")",
"we",
"want",
"the",
"wiki",
"page",
"from",
"@param",
"pageTitle",
"The",
"name",
"of",
"the",
"page"
] | train | https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/WikiManager.java#L56-L62 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java | RandomMatrices_DSCC.ensureNotSingular | public static void ensureNotSingular( DMatrixSparseCSC A , Random rand ) {
"""
Modies the matrix to make sure that at least one element in each column has a value
"""
// if( A.numRows < A.numCols ) {
// throw new IllegalArgumentException("Fewer equations than variables");
// }
... | java | public static void ensureNotSingular( DMatrixSparseCSC A , Random rand ) {
// if( A.numRows < A.numCols ) {
// throw new IllegalArgumentException("Fewer equations than variables");
// }
int []s = UtilEjml.shuffled(A.numRows,rand);
Arrays.sort(s);
int N = Math.min(A.num... | [
"public",
"static",
"void",
"ensureNotSingular",
"(",
"DMatrixSparseCSC",
"A",
",",
"Random",
"rand",
")",
"{",
"// if( A.numRows < A.numCols ) {",
"// throw new IllegalArgumentException(\"Fewer equations than variables\");",
"// }",
"int",
"[",
"]",
"s",... | Modies the matrix to make sure that at least one element in each column has a value | [
"Modies",
"the",
"matrix",
"to",
"make",
"sure",
"that",
"at",
"least",
"one",
"element",
"in",
"each",
"column",
"has",
"a",
"value"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java#L271-L283 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/util/XPathHelper.java | XPathHelper.peekDom | public Object peekDom(org.w3c.dom.Document doc, String xpathExpr) throws Exception {
"""
Retrieves the value of a document element or attribute as a String. If
multiple matches are found or the match has children, will return a List
<XPathHelper>.
@param xpath
the expression indicating the document location
... | java | public Object peekDom(org.w3c.dom.Document doc, String xpathExpr) throws Exception {
XPathFactory xPathfactory = XPathFactory.newInstance();
XPath xpath = xPathfactory.newXPath();
xpath.setNamespaceContext(new UniversalNamespaceCache(doc, false));
XPathExpression expr = xpath.compile(xpa... | [
"public",
"Object",
"peekDom",
"(",
"org",
".",
"w3c",
".",
"dom",
".",
"Document",
"doc",
",",
"String",
"xpathExpr",
")",
"throws",
"Exception",
"{",
"XPathFactory",
"xPathfactory",
"=",
"XPathFactory",
".",
"newInstance",
"(",
")",
";",
"XPath",
"xpath",
... | Retrieves the value of a document element or attribute as a String. If
multiple matches are found or the match has children, will return a List
<XPathHelper>.
@param xpath
the expression indicating the document location
@return a String, List<XPathHelper>, or null depending on how many
matches are found | [
"Retrieves",
"the",
"value",
"of",
"a",
"document",
"element",
"or",
"attribute",
"as",
"a",
"String",
".",
"If",
"multiple",
"matches",
"are",
"found",
"or",
"the",
"match",
"has",
"children",
"will",
"return",
"a",
"List",
"<XPathHelper",
">",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/util/XPathHelper.java#L110-L137 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/DeLiClu.java | DeLiClu.expandLeafNodes | private void expandLeafNodes(SpatialPrimitiveDistanceFunction<V> distFunction, DeLiCluNode node1, DeLiCluNode node2, DataStore<KNNList> knns) {
"""
Expands the specified leaf nodes.
@param distFunction the spatial distance function of this algorithm
@param node1 the first node
@param node2 the second node
@p... | java | private void expandLeafNodes(SpatialPrimitiveDistanceFunction<V> distFunction, DeLiCluNode node1, DeLiCluNode node2, DataStore<KNNList> knns) {
if(LOG.isDebuggingFinest()) {
LOG.debugFinest("ExpandLeafNodes: " + node1.getPageID() + " + " + node2.getPageID());
}
int numEntries_1 = node1.getNumEntries()... | [
"private",
"void",
"expandLeafNodes",
"(",
"SpatialPrimitiveDistanceFunction",
"<",
"V",
">",
"distFunction",
",",
"DeLiCluNode",
"node1",
",",
"DeLiCluNode",
"node2",
",",
"DataStore",
"<",
"KNNList",
">",
"knns",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebuggingFi... | Expands the specified leaf nodes.
@param distFunction the spatial distance function of this algorithm
@param node1 the first node
@param node2 the second node
@param knns the knn list | [
"Expands",
"the",
"specified",
"leaf",
"nodes",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/DeLiClu.java#L264-L289 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/StatementUtil.java | StatementUtil.prepareStatementForBatch | public static PreparedStatement prepareStatementForBatch(Connection conn, String sql, Iterable<Object[]> paramsBatch) throws SQLException {
"""
创建批量操作的{@link PreparedStatement}
@param conn 数据库连接
@param sql SQL语句,使用"?"做为占位符
@param paramsBatch "?"对应参数批次列表
@return {@link PreparedStatement}
@throws SQLException... | java | public static PreparedStatement prepareStatementForBatch(Connection conn, String sql, Iterable<Object[]> paramsBatch) throws SQLException {
Assert.notBlank(sql, "Sql String must be not blank!");
sql = sql.trim();
SqlLog.INSTASNCE.log(sql, paramsBatch);
PreparedStatement ps = conn.prepareStatement(sql);
... | [
"public",
"static",
"PreparedStatement",
"prepareStatementForBatch",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Iterable",
"<",
"Object",
"[",
"]",
">",
"paramsBatch",
")",
"throws",
"SQLException",
"{",
"Assert",
".",
"notBlank",
"(",
"sql",
",",
... | 创建批量操作的{@link PreparedStatement}
@param conn 数据库连接
@param sql SQL语句,使用"?"做为占位符
@param paramsBatch "?"对应参数批次列表
@return {@link PreparedStatement}
@throws SQLException SQL异常
@since 4.1.13 | [
"创建批量操作的",
"{",
"@link",
"PreparedStatement",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/StatementUtil.java#L177-L188 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/cpnl/CpnlElFunctions.java | CpnlElFunctions.mappedUrl | public static String mappedUrl(SlingHttpServletRequest request, String path) {
"""
Builds the URL for a repository path using the LinkUtil.getMappedURL() method.
@param request the current request (domain host hint)
@param path the repository path
@return the URL built in the context of the requested domai... | java | public static String mappedUrl(SlingHttpServletRequest request, String path) {
return LinkUtil.getMappedUrl(request, path);
} | [
"public",
"static",
"String",
"mappedUrl",
"(",
"SlingHttpServletRequest",
"request",
",",
"String",
"path",
")",
"{",
"return",
"LinkUtil",
".",
"getMappedUrl",
"(",
"request",
",",
"path",
")",
";",
"}"
] | Builds the URL for a repository path using the LinkUtil.getMappedURL() method.
@param request the current request (domain host hint)
@param path the repository path
@return the URL built in the context of the requested domain host | [
"Builds",
"the",
"URL",
"for",
"a",
"repository",
"path",
"using",
"the",
"LinkUtil",
".",
"getMappedURL",
"()",
"method",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/cpnl/CpnlElFunctions.java#L187-L189 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/type/DimensionFromConstraint.java | DimensionFromConstraint.dimensionFromConstraint | public static int dimensionFromConstraint(String constraint, String columnName) {
"""
Public for Unit test
@param constraint Constraint value ex: ST_COORDIM(the_geom) = 3
@param columnName Column name ex:the_geom
@return The dimension constraint [2-3]
"""
Matcher matcher = Z_CONSTRAINT_PATTERN.match... | java | public static int dimensionFromConstraint(String constraint, String columnName) {
Matcher matcher = Z_CONSTRAINT_PATTERN.matcher(constraint);
if(matcher.find()) {
String extractedColumnName = matcher.group(1).replace("\"","").replace("`", "");
if(extractedColumnName.equalsIgnoreC... | [
"public",
"static",
"int",
"dimensionFromConstraint",
"(",
"String",
"constraint",
",",
"String",
"columnName",
")",
"{",
"Matcher",
"matcher",
"=",
"Z_CONSTRAINT_PATTERN",
".",
"matcher",
"(",
"constraint",
")",
";",
"if",
"(",
"matcher",
".",
"find",
"(",
")... | Public for Unit test
@param constraint Constraint value ex: ST_COORDIM(the_geom) = 3
@param columnName Column name ex:the_geom
@return The dimension constraint [2-3] | [
"Public",
"for",
"Unit",
"test"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/type/DimensionFromConstraint.java#L59-L79 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/ChangeOnChangeHandler.java | ChangeOnChangeHandler.syncClonedListener | public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled) {
"""
Set this cloned listener to the same state at this listener.
@param field The field this new listener will be added to.
@param The new listener to sync to this.
@param Has the init method been called?
@return ... | java | public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled)
{
if (!bInitCalled)
((ChangeOnChangeHandler)listener).init(null, m_fldTarget, m_bSetModified);
return super.syncClonedListener(field, listener, true);
} | [
"public",
"boolean",
"syncClonedListener",
"(",
"BaseField",
"field",
",",
"FieldListener",
"listener",
",",
"boolean",
"bInitCalled",
")",
"{",
"if",
"(",
"!",
"bInitCalled",
")",
"(",
"(",
"ChangeOnChangeHandler",
")",
"listener",
")",
".",
"init",
"(",
"nul... | Set this cloned listener to the same state at this listener.
@param field The field this new listener will be added to.
@param The new listener to sync to this.
@param Has the init method been called?
@return True if I called init. | [
"Set",
"this",
"cloned",
"listener",
"to",
"the",
"same",
"state",
"at",
"this",
"listener",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/ChangeOnChangeHandler.java#L95-L100 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_PUT | public void billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_PUT(String billingAccount, String serviceName, Long dialplanId, Long extensionId, OvhOvhPabxDialplanExtension body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/ovhPabx/{servic... | java | public void billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_PUT(String billingAccount, String serviceName, Long dialplanId, Long extensionId, OvhOvhPabxDialplanExtension body) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}/exte... | [
"public",
"void",
"billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"dialplanId",
",",
"Long",
"extensionId",
",",
"OvhOvhPabxDialplanExtension",
"body",
")",
"throws",... | Alter this object properties
REST: PUT /telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}/extension/{extensionId}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param dialplanId [required]
@param extensio... | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7051-L7055 |
eyp/serfj | src/main/java/net/sf/serfj/UrlInspector.java | UrlInspector.getUrlInfo | public UrlInfo getUrlInfo(String url, HttpMethod requestMethod) {
"""
Gets the information which comes implicit in the URL, that is, the
identifiers, resources and the REST action.
<p/>
Examples of several URL formats:
<p/>
/orders /orders/1 /orders/new /orders/1/edit /orders/1/some-action
/orders/1/items /o... | java | public UrlInfo getUrlInfo(String url, HttpMethod requestMethod) {
LOGGER.debug("*** Retreiving information from the URL [{}] with method [{}] ***", url, requestMethod);
UrlInfo info = new UrlInfo(url, requestMethod);
// Split URL by slash
String[] splits = url.split("/");
String resource = null;
Strin... | [
"public",
"UrlInfo",
"getUrlInfo",
"(",
"String",
"url",
",",
"HttpMethod",
"requestMethod",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"*** Retreiving information from the URL [{}] with method [{}] ***\"",
",",
"url",
",",
"requestMethod",
")",
";",
"UrlInfo",
"info",
... | Gets the information which comes implicit in the URL, that is, the
identifiers, resources and the REST action.
<p/>
Examples of several URL formats:
<p/>
/orders /orders/1 /orders/new /orders/1/edit /orders/1/some-action
/orders/1/items /orders/1/items/some-action /orders/1/items/new
/orders/1/items/2 /orders/1/items/2... | [
"Gets",
"the",
"information",
"which",
"comes",
"implicit",
"in",
"the",
"URL",
"that",
"is",
"the",
"identifiers",
"resources",
"and",
"the",
"REST",
"action",
".",
"<p",
"/",
">",
"Examples",
"of",
"several",
"URL",
"formats",
":",
"<p",
"/",
">",
"/",... | train | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/UrlInspector.java#L68-L104 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java | DateUtil.offsetDate | @Deprecated
public static DateTime offsetDate(Date date, DateField dateField, int offset) {
"""
获取指定日期偏移指定时间后的时间
@param date 基准日期
@param dateField 偏移的粒度大小(小时、天、月等){@link DateField}
@param offset 偏移量,正数为向后偏移,负数为向前偏移
@return 偏移后的日期
@deprecated please use {@link DateUtil#offset(Date, DateField, int)}
"""... | java | @Deprecated
public static DateTime offsetDate(Date date, DateField dateField, int offset) {
return offset(date, dateField, offset);
} | [
"@",
"Deprecated",
"public",
"static",
"DateTime",
"offsetDate",
"(",
"Date",
"date",
",",
"DateField",
"dateField",
",",
"int",
"offset",
")",
"{",
"return",
"offset",
"(",
"date",
",",
"dateField",
",",
"offset",
")",
";",
"}"
] | 获取指定日期偏移指定时间后的时间
@param date 基准日期
@param dateField 偏移的粒度大小(小时、天、月等){@link DateField}
@param offset 偏移量,正数为向后偏移,负数为向前偏移
@return 偏移后的日期
@deprecated please use {@link DateUtil#offset(Date, DateField, int)} | [
"获取指定日期偏移指定时间后的时间"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L1214-L1217 |
jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.computeElementSize | public static int computeElementSize(final WireFormat.FieldType type, final int number, final Object value) {
"""
Compute the number of bytes that would be needed to encode a single tag/value pair of arbitrary type.
@param type The field's type.
@param number The field's number.
@param value Object representi... | java | public static int computeElementSize(final WireFormat.FieldType type, final int number, final Object value) {
int tagSize = CodedOutputStream.computeTagSize(number);
if (type == WireFormat.FieldType.GROUP) {
// Only count the end group tag for proto2 messages as for proto1 the end
... | [
"public",
"static",
"int",
"computeElementSize",
"(",
"final",
"WireFormat",
".",
"FieldType",
"type",
",",
"final",
"int",
"number",
",",
"final",
"Object",
"value",
")",
"{",
"int",
"tagSize",
"=",
"CodedOutputStream",
".",
"computeTagSize",
"(",
"number",
"... | Compute the number of bytes that would be needed to encode a single tag/value pair of arbitrary type.
@param type The field's type.
@param number The field's number.
@param value Object representing the field's value. Must be of the exact type which would be returned by
{@link Message#getField(Descriptors.FieldDescrip... | [
"Compute",
"the",
"number",
"of",
"bytes",
"that",
"would",
"be",
"needed",
"to",
"encode",
"a",
"single",
"tag",
"/",
"value",
"pair",
"of",
"arbitrary",
"type",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L118-L126 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java | Window.writeActiveWindowToMapset | public static void writeActiveWindowToMapset( String mapsetPath, Window window ) throws IOException {
"""
Write active region window to the mapset
@param mapsetPath the path to the mapset folder
@param the active Window object
@throws IOException
"""
writeWindowFile(mapsetPath + File.separator + G... | java | public static void writeActiveWindowToMapset( String mapsetPath, Window window ) throws IOException {
writeWindowFile(mapsetPath + File.separator + GrassLegacyConstans.WIND, window);
} | [
"public",
"static",
"void",
"writeActiveWindowToMapset",
"(",
"String",
"mapsetPath",
",",
"Window",
"window",
")",
"throws",
"IOException",
"{",
"writeWindowFile",
"(",
"mapsetPath",
"+",
"File",
".",
"separator",
"+",
"GrassLegacyConstans",
".",
"WIND",
",",
"wi... | Write active region window to the mapset
@param mapsetPath the path to the mapset folder
@param the active Window object
@throws IOException | [
"Write",
"active",
"region",
"window",
"to",
"the",
"mapset"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java#L480-L482 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/transcoder/TranscoderUtils.java | TranscoderUtils.byteBufToByteArray | public static ByteBufToArray byteBufToByteArray(ByteBuf input) {
"""
Converts a {@link ByteBuf} to a byte[] in the most straightforward manner available.
@param input the ByteBuf to convert.
@return a {@link ByteBufToArray} containing the byte[] array, as well as the offset and length to use (in case
the actual... | java | public static ByteBufToArray byteBufToByteArray(ByteBuf input) {
byte[] inputBytes;
int offset = 0;
int length = input.readableBytes();
if (input.hasArray()) {
inputBytes = input.array();
offset = input.arrayOffset() + input.readerIndex();
} else {
... | [
"public",
"static",
"ByteBufToArray",
"byteBufToByteArray",
"(",
"ByteBuf",
"input",
")",
"{",
"byte",
"[",
"]",
"inputBytes",
";",
"int",
"offset",
"=",
"0",
";",
"int",
"length",
"=",
"input",
".",
"readableBytes",
"(",
")",
";",
"if",
"(",
"input",
".... | Converts a {@link ByteBuf} to a byte[] in the most straightforward manner available.
@param input the ByteBuf to convert.
@return a {@link ByteBufToArray} containing the byte[] array, as well as the offset and length to use (in case
the actual array is longer than the data the ByteBuf represents for instance). | [
"Converts",
"a",
"{"
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/transcoder/TranscoderUtils.java#L279-L291 |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/MethodCompiler.java | MethodCompiler.getField | public void getField(Class<?> cls, String name) throws IOException {
"""
Get field from class
<p>Stack: ..., => ..., value
@param cls
@param name
@throws IOException
"""
getField(El.getField(cls, name));
} | java | public void getField(Class<?> cls, String name) throws IOException
{
getField(El.getField(cls, name));
} | [
"public",
"void",
"getField",
"(",
"Class",
"<",
"?",
">",
"cls",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"getField",
"(",
"El",
".",
"getField",
"(",
"cls",
",",
"name",
")",
")",
";",
"}"
] | Get field from class
<p>Stack: ..., => ..., value
@param cls
@param name
@throws IOException | [
"Get",
"field",
"from",
"class",
"<p",
">",
"Stack",
":",
"...",
"=",
">",
";",
"...",
"value"
] | train | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/MethodCompiler.java#L917-L920 |
wnameless/rubycollect4j | src/main/java/net/sf/rubycollect4j/util/ByteUtils.java | ByteUtils.fromBinaryString | public static byte[] fromBinaryString(String binaryStr) {
"""
Converts a binary string into byte array.
@param binaryStr
a binary string
@return byte array
@throws IllegalArgumentException
if binary string is invalid
"""
if (!binaryStr.matches("^[01]*$"))
throw new IllegalArgumentException("In... | java | public static byte[] fromBinaryString(String binaryStr) {
if (!binaryStr.matches("^[01]*$"))
throw new IllegalArgumentException("Invalid binary string");
if (binaryStr.isEmpty()) return new byte[0];
int complementary = binaryStr.length() % 8;
if (complementary != 0)
binaryStr += Ruby.Array.... | [
"public",
"static",
"byte",
"[",
"]",
"fromBinaryString",
"(",
"String",
"binaryStr",
")",
"{",
"if",
"(",
"!",
"binaryStr",
".",
"matches",
"(",
"\"^[01]*$\"",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid binary string\"",
")",
";",
"... | Converts a binary string into byte array.
@param binaryStr
a binary string
@return byte array
@throws IllegalArgumentException
if binary string is invalid | [
"Converts",
"a",
"binary",
"string",
"into",
"byte",
"array",
"."
] | train | https://github.com/wnameless/rubycollect4j/blob/b8b8d8eccaca2254a3d09b91745882fb7a0d5add/src/main/java/net/sf/rubycollect4j/util/ByteUtils.java#L518-L528 |
JodaOrg/joda-time | src/main/java/org/joda/time/LocalDate.java | LocalDate.withLocalMillis | LocalDate withLocalMillis(long newMillis) {
"""
Returns a copy of this date with different local millis.
<p>
The returned object will be a new instance of the same type.
Only the millis will change, the chronology is kept.
The returned object will be either be a new instance or <code>this</code>.
@param new... | java | LocalDate withLocalMillis(long newMillis) {
newMillis = iChronology.dayOfMonth().roundFloor(newMillis);
return (newMillis == getLocalMillis() ? this : new LocalDate(newMillis, getChronology()));
} | [
"LocalDate",
"withLocalMillis",
"(",
"long",
"newMillis",
")",
"{",
"newMillis",
"=",
"iChronology",
".",
"dayOfMonth",
"(",
")",
".",
"roundFloor",
"(",
"newMillis",
")",
";",
"return",
"(",
"newMillis",
"==",
"getLocalMillis",
"(",
")",
"?",
"this",
":",
... | Returns a copy of this date with different local millis.
<p>
The returned object will be a new instance of the same type.
Only the millis will change, the chronology is kept.
The returned object will be either be a new instance or <code>this</code>.
@param newMillis the new millis, from 1970-01-01T00:00:00
@return a ... | [
"Returns",
"a",
"copy",
"of",
"this",
"date",
"with",
"different",
"local",
"millis",
".",
"<p",
">",
"The",
"returned",
"object",
"will",
"be",
"a",
"new",
"instance",
"of",
"the",
"same",
"type",
".",
"Only",
"the",
"millis",
"will",
"change",
"the",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalDate.java#L1053-L1056 |
alkacon/opencms-core | src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBProjectId.java | CmsUpdateDBProjectId.addUUIDColumnToTable | protected void addUUIDColumnToTable(CmsSetupDb dbCon, String tablename, String column) throws SQLException {
"""
Adds the new column for the uuids to a table.<p>
@param dbCon the db connection interface
@param tablename the table to add the column to
@param column the new colum to add
@throws SQLException ... | java | protected void addUUIDColumnToTable(CmsSetupDb dbCon, String tablename, String column) throws SQLException {
System.out.println(new Exception().getStackTrace()[0].toString());
if (!dbCon.hasTableOrColumn(tablename, column)) {
String query = readQuery(QUERY_ADD_TEMP_UUID_COLUMN); // Get the ... | [
"protected",
"void",
"addUUIDColumnToTable",
"(",
"CmsSetupDb",
"dbCon",
",",
"String",
"tablename",
",",
"String",
"column",
")",
"throws",
"SQLException",
"{",
"System",
".",
"out",
".",
"println",
"(",
"new",
"Exception",
"(",
")",
".",
"getStackTrace",
"("... | Adds the new column for the uuids to a table.<p>
@param dbCon the db connection interface
@param tablename the table to add the column to
@param column the new colum to add
@throws SQLException if something goes wrong | [
"Adds",
"the",
"new",
"column",
"for",
"the",
"uuids",
"to",
"a",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBProjectId.java#L219-L235 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.setFieldValue | public static void setFieldValue(Object object, Class<?> clazz, String fieldName, Object value) {
"""
Set instance field declared into superclass. Try to set field value throwing exception if field is not declared
into superclass; if field is static object instance should be null.
@param object instance to set... | java | public static void setFieldValue(Object object, Class<?> clazz, String fieldName, Object value)
{
Field field = getField(clazz, fieldName);
if(object == null ^ Modifier.isStatic(field.getModifiers())) {
throw new BugError("Cannot access static field |%s| from instance |%s|.", fieldName, clazz);
... | [
"public",
"static",
"void",
"setFieldValue",
"(",
"Object",
"object",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"fieldName",
",",
"Object",
"value",
")",
"{",
"Field",
"field",
"=",
"getField",
"(",
"clazz",
",",
"fieldName",
")",
";",
"if",
... | Set instance field declared into superclass. Try to set field value throwing exception if field is not declared
into superclass; if field is static object instance should be null.
@param object instance to set field value to or null if field is static,
@param clazz instance superclass where field is declared,
@param f... | [
"Set",
"instance",
"field",
"declared",
"into",
"superclass",
".",
"Try",
"to",
"set",
"field",
"value",
"throwing",
"exception",
"if",
"field",
"is",
"not",
"declared",
"into",
"superclass",
";",
"if",
"field",
"is",
"static",
"object",
"instance",
"should",
... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L888-L895 |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.checkedUpdate | protected void checkedUpdate (final String query, final int count)
throws PersistenceException {
"""
Executes the supplied update query in this repository, throwing an exception if the
modification count is not equal to the specified count.
"""
executeUpdate(new Operation<Object>() {
... | java | protected void checkedUpdate (final String query, final int count)
throws PersistenceException
{
executeUpdate(new Operation<Object>() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
... | [
"protected",
"void",
"checkedUpdate",
"(",
"final",
"String",
"query",
",",
"final",
"int",
"count",
")",
"throws",
"PersistenceException",
"{",
"executeUpdate",
"(",
"new",
"Operation",
"<",
"Object",
">",
"(",
")",
"{",
"public",
"Object",
"invoke",
"(",
"... | Executes the supplied update query in this repository, throwing an exception if the
modification count is not equal to the specified count. | [
"Executes",
"the",
"supplied",
"update",
"query",
"in",
"this",
"repository",
"throwing",
"an",
"exception",
"if",
"the",
"modification",
"count",
"is",
"not",
"equal",
"to",
"the",
"specified",
"count",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L273-L290 |
jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/api/PrintedContent.java | PrintedContent.getWriter | private PrintWriter getWriter(OutputStream os) throws IOException {
"""
When anonymization is enabled, we create an {@link com.cloudbees.jenkins.support.filter.FilteredWriter} directly from
the underlying {@link FilteredOutputStream} that prevents us from encoding and
then immediately decoding characters written... | java | private PrintWriter getWriter(OutputStream os) throws IOException {
if (os instanceof WrapperOutputStream) {
OutputStream out = ((WrapperOutputStream) os).unwrapRecursively();
if (out instanceof FilteredOutputStream) {
FilteredOutputStream filteredStream = (FilteredOutput... | [
"private",
"PrintWriter",
"getWriter",
"(",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"if",
"(",
"os",
"instanceof",
"WrapperOutputStream",
")",
"{",
"OutputStream",
"out",
"=",
"(",
"(",
"WrapperOutputStream",
")",
"os",
")",
".",
"unwrapRecursiv... | When anonymization is enabled, we create an {@link com.cloudbees.jenkins.support.filter.FilteredWriter} directly from
the underlying {@link FilteredOutputStream} that prevents us from encoding and
then immediately decoding characters written to the returned {@link java.io.PrintStream}
when filtering. | [
"When",
"anonymization",
"is",
"enabled",
"we",
"create",
"an",
"{"
] | train | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/api/PrintedContent.java#L68-L77 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java | QrCodePositionPatternDetector.positionSquareIntensityCheck | static boolean positionSquareIntensityCheck(float values[] , float threshold ) {
"""
Checks to see if the array of sampled intensity values follows the expected pattern for a position pattern.
X.XXX.X where x = black and . = white.
"""
if( values[0] > threshold || values[1] < threshold )
return false;
... | java | static boolean positionSquareIntensityCheck(float values[] , float threshold ) {
if( values[0] > threshold || values[1] < threshold )
return false;
if( values[2] > threshold || values[3] > threshold || values[4] > threshold )
return false;
if( values[5] < threshold || values[6] > threshold )
return fals... | [
"static",
"boolean",
"positionSquareIntensityCheck",
"(",
"float",
"values",
"[",
"]",
",",
"float",
"threshold",
")",
"{",
"if",
"(",
"values",
"[",
"0",
"]",
">",
"threshold",
"||",
"values",
"[",
"1",
"]",
"<",
"threshold",
")",
"return",
"false",
";"... | Checks to see if the array of sampled intensity values follows the expected pattern for a position pattern.
X.XXX.X where x = black and . = white. | [
"Checks",
"to",
"see",
"if",
"the",
"array",
"of",
"sampled",
"intensity",
"values",
"follows",
"the",
"expected",
"pattern",
"for",
"a",
"position",
"pattern",
".",
"X",
".",
"XXX",
".",
"X",
"where",
"x",
"=",
"black",
"and",
".",
"=",
"white",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodePositionPatternDetector.java#L422-L430 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsHibernateUtil.java | GrailsHibernateUtil.getAssociationProxy | public static HibernateProxy getAssociationProxy(Object obj, String associationName) {
"""
Returns the proxy for a given association or null if it is not proxied
@param obj The object
@param associationName The named assoication
@return A proxy
"""
return proxyHandler.getAssociationProxy(obj, asso... | java | public static HibernateProxy getAssociationProxy(Object obj, String associationName) {
return proxyHandler.getAssociationProxy(obj, associationName);
} | [
"public",
"static",
"HibernateProxy",
"getAssociationProxy",
"(",
"Object",
"obj",
",",
"String",
"associationName",
")",
"{",
"return",
"proxyHandler",
".",
"getAssociationProxy",
"(",
"obj",
",",
"associationName",
")",
";",
"}"
] | Returns the proxy for a given association or null if it is not proxied
@param obj The object
@param associationName The named assoication
@return A proxy | [
"Returns",
"the",
"proxy",
"for",
"a",
"given",
"association",
"or",
"null",
"if",
"it",
"is",
"not",
"proxied"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsHibernateUtil.java#L389-L391 |
twilio/twilio-java | src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/assignedaddon/AssignedAddOnExtensionReader.java | AssignedAddOnExtensionReader.firstPage | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<AssignedAddOnExtension> firstPage(final TwilioRestClient client) {
"""
Make the request to the Twilio API to perform the read.
@param client TwilioRestClient with which to make the request
@return AssignedAddOnExtension ResourceSet
""... | java | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<AssignedAddOnExtension> firstPage(final TwilioRestClient client) {
this.pathAccountSid = this.pathAccountSid == null ? client.getAccountSid() : this.pathAccountSid;
Request request = new Request(
HttpMethod.GET,
... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:linelength\"",
")",
"public",
"Page",
"<",
"AssignedAddOnExtension",
">",
"firstPage",
"(",
"final",
"TwilioRestClient",
"client",
")",
"{",
"this",
".",
"pathAccountSid",
"=",
"this",
".",
"pathAccountSid... | Make the request to the Twilio API to perform the read.
@param client TwilioRestClient with which to make the request
@return AssignedAddOnExtension ResourceSet | [
"Make",
"the",
"request",
"to",
"the",
"Twilio",
"API",
"to",
"perform",
"the",
"read",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/assignedaddon/AssignedAddOnExtensionReader.java#L80-L93 |
ltsopensource/light-task-scheduler | lts-core/src/main/java/com/github/ltsopensource/core/commons/utils/WebUtils.java | WebUtils.doPost | public static String doPost(String url, Map<String, String> params, String charset, int connectTimeout, int readTimeout) throws IOException {
"""
执行HTTP POST请求。
@param url 请求地址
@param params 请求参数
@param charset 字符集,如UTF-8, GBK, GB2312
@return 响应字符串
"""
return doPost(url, params, charset, con... | java | public static String doPost(String url, Map<String, String> params, String charset, int connectTimeout, int readTimeout) throws IOException {
return doPost(url, params, charset, connectTimeout, readTimeout, null);
} | [
"public",
"static",
"String",
"doPost",
"(",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"String",
"charset",
",",
"int",
"connectTimeout",
",",
"int",
"readTimeout",
")",
"throws",
"IOException",
"{",
"return",
"doPost",
... | 执行HTTP POST请求。
@param url 请求地址
@param params 请求参数
@param charset 字符集,如UTF-8, GBK, GB2312
@return 响应字符串 | [
"执行HTTP",
"POST请求。"
] | train | https://github.com/ltsopensource/light-task-scheduler/blob/64d3aa000ff5022be5e94f511b58f405e5f4c8eb/lts-core/src/main/java/com/github/ltsopensource/core/commons/utils/WebUtils.java#L63-L65 |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java | RestTemplateBuilder.basicAuthentication | public RestTemplateBuilder basicAuthentication(String username, String password) {
"""
Add HTTP basic authentication to requests. See
{@link BasicAuthenticationInterceptor} for details.
@param username the user name
@param password the password
@return a new builder instance
@since 2.1.0
"""
return new ... | java | public RestTemplateBuilder basicAuthentication(String username, String password) {
return new RestTemplateBuilder(this.detectRequestFactory, this.rootUri,
this.messageConverters, this.requestFactorySupplier,
this.uriTemplateHandler, this.errorHandler,
new BasicAuthenticationInterceptor(username, password)... | [
"public",
"RestTemplateBuilder",
"basicAuthentication",
"(",
"String",
"username",
",",
"String",
"password",
")",
"{",
"return",
"new",
"RestTemplateBuilder",
"(",
"this",
".",
"detectRequestFactory",
",",
"this",
".",
"rootUri",
",",
"this",
".",
"messageConverter... | Add HTTP basic authentication to requests. See
{@link BasicAuthenticationInterceptor} for details.
@param username the user name
@param password the password
@return a new builder instance
@since 2.1.0 | [
"Add",
"HTTP",
"basic",
"authentication",
"to",
"requests",
".",
"See",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java#L381-L388 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/LineString.java | LineString.fromLngLats | public static LineString fromLngLats(@NonNull MultiPoint multiPoint, @Nullable BoundingBox bbox) {
"""
Create a new instance of this class by defining a {@link MultiPoint} object and passing. The
multipoint object should comply with the GeoJson specifications described in the documentation.
@param multiPoint w... | java | public static LineString fromLngLats(@NonNull MultiPoint multiPoint, @Nullable BoundingBox bbox) {
return new LineString(TYPE, bbox, multiPoint.coordinates());
} | [
"public",
"static",
"LineString",
"fromLngLats",
"(",
"@",
"NonNull",
"MultiPoint",
"multiPoint",
",",
"@",
"Nullable",
"BoundingBox",
"bbox",
")",
"{",
"return",
"new",
"LineString",
"(",
"TYPE",
",",
"bbox",
",",
"multiPoint",
".",
"coordinates",
"(",
")",
... | Create a new instance of this class by defining a {@link MultiPoint} object and passing. The
multipoint object should comply with the GeoJson specifications described in the documentation.
@param multiPoint which will make up the LineString geometry
@param bbox optionally include a bbox definition as a double ar... | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"defining",
"a",
"{",
"@link",
"MultiPoint",
"}",
"object",
"and",
"passing",
".",
"The",
"multipoint",
"object",
"should",
"comply",
"with",
"the",
"GeoJson",
"specifications",
"described",
"in",
... | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/LineString.java#L141-L143 |
junit-team/junit4 | src/main/java/org/junit/runner/Description.java | Description.createSuiteDescription | public static Description createSuiteDescription(String name, Serializable uniqueId, Annotation... annotations) {
"""
Create a <code>Description</code> named <code>name</code>.
Generally, you will add children to this <code>Description</code>.
@param name the name of the <code>Description</code>
@param unique... | java | public static Description createSuiteDescription(String name, Serializable uniqueId, Annotation... annotations) {
return new Description(null, name, uniqueId, annotations);
} | [
"public",
"static",
"Description",
"createSuiteDescription",
"(",
"String",
"name",
",",
"Serializable",
"uniqueId",
",",
"Annotation",
"...",
"annotations",
")",
"{",
"return",
"new",
"Description",
"(",
"null",
",",
"name",
",",
"uniqueId",
",",
"annotations",
... | Create a <code>Description</code> named <code>name</code>.
Generally, you will add children to this <code>Description</code>.
@param name the name of the <code>Description</code>
@param uniqueId an arbitrary object used to define uniqueness (in {@link #equals(Object)}
@param annotations meta-data about the test, for d... | [
"Create",
"a",
"<code",
">",
"Description<",
"/",
"code",
">",
"named",
"<code",
">",
"name<",
"/",
"code",
">",
".",
"Generally",
"you",
"will",
"add",
"children",
"to",
"this",
"<code",
">",
"Description<",
"/",
"code",
">",
"."
] | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runner/Description.java#L57-L59 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/MinimizeEnergyPrune.java | MinimizeEnergyPrune.computeSegmentEnergy | protected double computeSegmentEnergy(GrowQueue_I32 corners, int cornerA, int cornerB) {
"""
Computes the energy for a segment defined by the two corner indexes
"""
int indexA = corners.get(cornerA);
int indexB = corners.get(cornerB);
if( indexA == indexB ) {
return 100000.0;
}
Point2D_I32 a = c... | java | protected double computeSegmentEnergy(GrowQueue_I32 corners, int cornerA, int cornerB) {
int indexA = corners.get(cornerA);
int indexB = corners.get(cornerB);
if( indexA == indexB ) {
return 100000.0;
}
Point2D_I32 a = contour.get(indexA);
Point2D_I32 b = contour.get(indexB);
line.p.x = a.x;
line.... | [
"protected",
"double",
"computeSegmentEnergy",
"(",
"GrowQueue_I32",
"corners",
",",
"int",
"cornerA",
",",
"int",
"cornerB",
")",
"{",
"int",
"indexA",
"=",
"corners",
".",
"get",
"(",
"cornerA",
")",
";",
"int",
"indexB",
"=",
"corners",
".",
"get",
"(",... | Computes the energy for a segment defined by the two corner indexes | [
"Computes",
"the",
"energy",
"for",
"a",
"segment",
"defined",
"by",
"the",
"two",
"corner",
"indexes"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/MinimizeEnergyPrune.java#L210-L236 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/LocalVariableAnnotation.java | LocalVariableAnnotation.getParameterLocalVariableAnnotation | public static LocalVariableAnnotation getParameterLocalVariableAnnotation(Method method, int local) {
"""
Get a local variable annotation describing a parameter.
@param method
a Method
@param local
the local variable containing the parameter
@return LocalVariableAnnotation describing the parameter
"""
... | java | public static LocalVariableAnnotation getParameterLocalVariableAnnotation(Method method, int local) {
LocalVariableAnnotation lva = getLocalVariableAnnotation(method, local, 0, 0);
if (lva.isNamed()) {
lva.setDescription(LocalVariableAnnotation.PARAMETER_NAMED_ROLE);
} else {
... | [
"public",
"static",
"LocalVariableAnnotation",
"getParameterLocalVariableAnnotation",
"(",
"Method",
"method",
",",
"int",
"local",
")",
"{",
"LocalVariableAnnotation",
"lva",
"=",
"getLocalVariableAnnotation",
"(",
"method",
",",
"local",
",",
"0",
",",
"0",
")",
"... | Get a local variable annotation describing a parameter.
@param method
a Method
@param local
the local variable containing the parameter
@return LocalVariableAnnotation describing the parameter | [
"Get",
"a",
"local",
"variable",
"annotation",
"describing",
"a",
"parameter",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/LocalVariableAnnotation.java#L179-L187 |
fernandospr/javapns-jdk16 | src/main/java/javapns/Push.java | Push.payloads | public static PushedNotifications payloads(Object keystore, String password, boolean production, Object payloadDevicePairs) throws CommunicationException, KeystoreException {
"""
Push a different preformatted payload for each device.
@param keystore a keystore containing your private key and the certificate sig... | java | public static PushedNotifications payloads(Object keystore, String password, boolean production, Object payloadDevicePairs) throws CommunicationException, KeystoreException {
return sendPayloads(keystore, password, production, payloadDevicePairs);
} | [
"public",
"static",
"PushedNotifications",
"payloads",
"(",
"Object",
"keystore",
",",
"String",
"password",
",",
"boolean",
"production",
",",
"Object",
"payloadDevicePairs",
")",
"throws",
"CommunicationException",
",",
"KeystoreException",
"{",
"return",
"sendPayload... | Push a different preformatted payload for each device.
@param keystore a keystore containing your private key and the certificate signed by Apple ({@link java.io.File}, {@link java.io.InputStream}, byte[], {@link java.security.KeyStore} or {@link java.lang.String} for a file path)
@param password the keystore's passwo... | [
"Push",
"a",
"different",
"preformatted",
"payload",
"for",
"each",
"device",
"."
] | train | https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/Push.java#L250-L252 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/execution/QueryIdGenerator.java | QueryIdGenerator.createNextQueryId | public synchronized QueryId createNextQueryId() {
"""
Generate next queryId using the following format:
<tt>YYYYMMdd_HHmmss_index_coordId</tt>
<p/>
Index rolls at the start of every day or when it reaches 99,999, and the
coordId is a randomly generated when this instance is created.
"""
// only gen... | java | public synchronized QueryId createNextQueryId()
{
// only generate 100,000 ids per day
if (counter > 99_999) {
// wait for the second to rollover
while (MILLISECONDS.toSeconds(nowInMillis()) == lastTimeInSeconds) {
Uninterruptibles.sleepUninterruptibly(1, Time... | [
"public",
"synchronized",
"QueryId",
"createNextQueryId",
"(",
")",
"{",
"// only generate 100,000 ids per day",
"if",
"(",
"counter",
">",
"99_999",
")",
"{",
"// wait for the second to rollover",
"while",
"(",
"MILLISECONDS",
".",
"toSeconds",
"(",
"nowInMillis",
"(",... | Generate next queryId using the following format:
<tt>YYYYMMdd_HHmmss_index_coordId</tt>
<p/>
Index rolls at the start of every day or when it reaches 99,999, and the
coordId is a randomly generated when this instance is created. | [
"Generate",
"next",
"queryId",
"using",
"the",
"following",
"format",
":",
"<tt",
">",
"YYYYMMdd_HHmmss_index_coordId<",
"/",
"tt",
">",
"<p",
"/",
">",
"Index",
"rolls",
"at",
"the",
"start",
"of",
"every",
"day",
"or",
"when",
"it",
"reaches",
"99",
"999... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/execution/QueryIdGenerator.java#L81-L107 |
apache/reef | lang/java/reef-bridge-proto-java/src/main/java/org/apache/reef/bridge/driver/common/grpc/GRPCUtils.java | GRPCUtils.toContextInfo | public static ContextInfo toContextInfo(final ContextBase context, final ExceptionInfo error) {
"""
Create a context info from a context object with an error.
@param context object
@param error info
@return context info
"""
final ContextInfo.Builder builder = ContextInfo.newBuilder()
.setContext... | java | public static ContextInfo toContextInfo(final ContextBase context, final ExceptionInfo error) {
final ContextInfo.Builder builder = ContextInfo.newBuilder()
.setContextId(context.getId())
.setEvaluatorId(context.getEvaluatorId())
.setParentId(context.getParentId().orElse(""))
.setEva... | [
"public",
"static",
"ContextInfo",
"toContextInfo",
"(",
"final",
"ContextBase",
"context",
",",
"final",
"ExceptionInfo",
"error",
")",
"{",
"final",
"ContextInfo",
".",
"Builder",
"builder",
"=",
"ContextInfo",
".",
"newBuilder",
"(",
")",
".",
"setContextId",
... | Create a context info from a context object with an error.
@param context object
@param error info
@return context info | [
"Create",
"a",
"context",
"info",
"from",
"a",
"context",
"object",
"with",
"an",
"error",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-bridge-proto-java/src/main/java/org/apache/reef/bridge/driver/common/grpc/GRPCUtils.java#L116-L127 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/category/CmsDataValue.java | CmsDataValue.matchesFilter | public boolean matchesFilter(String filter, int priValue, int secValue) {
"""
Returns if the category matches the given filter.<p>
@param filter the filter to match
@param priValue the first search value
@param secValue the second search value
@return <code>true</code> if the gallery matches the given filt... | java | public boolean matchesFilter(String filter, int priValue, int secValue) {
filter = filter.toLowerCase();
return m_parameters[priValue].toLowerCase().contains(filter)
|| m_parameters[secValue].toLowerCase().contains(filter);
} | [
"public",
"boolean",
"matchesFilter",
"(",
"String",
"filter",
",",
"int",
"priValue",
",",
"int",
"secValue",
")",
"{",
"filter",
"=",
"filter",
".",
"toLowerCase",
"(",
")",
";",
"return",
"m_parameters",
"[",
"priValue",
"]",
".",
"toLowerCase",
"(",
")... | Returns if the category matches the given filter.<p>
@param filter the filter to match
@param priValue the first search value
@param secValue the second search value
@return <code>true</code> if the gallery matches the given filter.<p> | [
"Returns",
"if",
"the",
"category",
"matches",
"the",
"given",
"filter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/category/CmsDataValue.java#L258-L263 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/nature/FindBugsNature.java | FindBugsNature.setFindBugsCommand | private void setFindBugsCommand(IProjectDescription description, ICommand newCommand) throws CoreException {
"""
Update the FindBugs command in the build spec (replace existing one if
present, add one first if none).
"""
ICommand[] oldCommands = description.getBuildSpec();
ICommand oldFindBugs... | java | private void setFindBugsCommand(IProjectDescription description, ICommand newCommand) throws CoreException {
ICommand[] oldCommands = description.getBuildSpec();
ICommand oldFindBugsCommand = getFindBugsCommand(description);
ICommand[] newCommands;
if (oldFindBugsCommand == null) {
... | [
"private",
"void",
"setFindBugsCommand",
"(",
"IProjectDescription",
"description",
",",
"ICommand",
"newCommand",
")",
"throws",
"CoreException",
"{",
"ICommand",
"[",
"]",
"oldCommands",
"=",
"description",
".",
"getBuildSpec",
"(",
")",
";",
"ICommand",
"oldFindB... | Update the FindBugs command in the build spec (replace existing one if
present, add one first if none). | [
"Update",
"the",
"FindBugs",
"command",
"in",
"the",
"build",
"spec",
"(",
"replace",
"existing",
"one",
"if",
"present",
"add",
"one",
"first",
"if",
"none",
")",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/nature/FindBugsNature.java#L126-L147 |
baratine/baratine | web/src/main/java/com/caucho/v5/jni/JniSocketImpl.java | JniSocketImpl.acceptInitialRead | @Override
public int acceptInitialRead(byte []buffer, int offset, int length) {
"""
Initialize new connection from the socket.
@param buf the initial buffer
@param offset the initial buffer offset
@param length the initial buffer length
@return int as if by read
"""
synchronized (_readLock) {
... | java | @Override
public int acceptInitialRead(byte []buffer, int offset, int length)
{
synchronized (_readLock) {
// initialize fields from the _fd
int result = nativeAcceptInit(_socketFd, _localAddrBuffer, _remoteAddrBuffer,
buffer, offset, length);
return result... | [
"@",
"Override",
"public",
"int",
"acceptInitialRead",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"synchronized",
"(",
"_readLock",
")",
"{",
"// initialize fields from the _fd",
"int",
"result",
"=",
"nativeAcceptInit... | Initialize new connection from the socket.
@param buf the initial buffer
@param offset the initial buffer offset
@param length the initial buffer length
@return int as if by read | [
"Initialize",
"new",
"connection",
"from",
"the",
"socket",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/jni/JniSocketImpl.java#L245-L255 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/util/TreeUtil.java | TreeUtil.expandChildren | private static void expandChildren(BaseComponent parent, int depth) {
"""
Expand / collapse tree children to specified depth.
@param parent Tree children whose tree items are to be expanded / collapsed.
@param depth Expand tree items to this depth. Tree items below this depth are collapsed.
"""
if ... | java | private static void expandChildren(BaseComponent parent, int depth) {
if (parent == null || depth <= 0) {
return;
}
depth--;
for (Object object : parent.getChildren()) {
Treenode item = (Treenode) object;
item.setCollapsed(depth <= 0);
ex... | [
"private",
"static",
"void",
"expandChildren",
"(",
"BaseComponent",
"parent",
",",
"int",
"depth",
")",
"{",
"if",
"(",
"parent",
"==",
"null",
"||",
"depth",
"<=",
"0",
")",
"{",
"return",
";",
"}",
"depth",
"--",
";",
"for",
"(",
"Object",
"object",... | Expand / collapse tree children to specified depth.
@param parent Tree children whose tree items are to be expanded / collapsed.
@param depth Expand tree items to this depth. Tree items below this depth are collapsed. | [
"Expand",
"/",
"collapse",
"tree",
"children",
"to",
"specified",
"depth",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/util/TreeUtil.java#L280-L292 |
ReactiveX/RxJavaFX | src/main/java/io/reactivex/rxjavafx/transformers/FxFlowableTransformers.java | FxFlowableTransformers.doOnNextCount | public static <T> FlowableTransformer<T,T> doOnNextCount(Consumer<Integer> onNext) {
"""
Performs an action on onNext with the provided emission count
@param onNext
@param <T>
"""
return obs -> obs.lift(new FlowableEmissionCounter<>(new CountObserver(onNext,null,null)));
} | java | public static <T> FlowableTransformer<T,T> doOnNextCount(Consumer<Integer> onNext) {
return obs -> obs.lift(new FlowableEmissionCounter<>(new CountObserver(onNext,null,null)));
} | [
"public",
"static",
"<",
"T",
">",
"FlowableTransformer",
"<",
"T",
",",
"T",
">",
"doOnNextCount",
"(",
"Consumer",
"<",
"Integer",
">",
"onNext",
")",
"{",
"return",
"obs",
"->",
"obs",
".",
"lift",
"(",
"new",
"FlowableEmissionCounter",
"<>",
"(",
"ne... | Performs an action on onNext with the provided emission count
@param onNext
@param <T> | [
"Performs",
"an",
"action",
"on",
"onNext",
"with",
"the",
"provided",
"emission",
"count"
] | train | https://github.com/ReactiveX/RxJavaFX/blob/8f44d4cc1caba9a8919f01cb1897aaea5514c7e5/src/main/java/io/reactivex/rxjavafx/transformers/FxFlowableTransformers.java#L114-L116 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.