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 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deleteCustomEntityRole | public OperationStatus deleteCustomEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId) {
"""
Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role Id.
@throws IllegalArgumentException thrown if p... | java | public OperationStatus deleteCustomEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId) {
return deleteCustomEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"deleteCustomEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"deleteCustomEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"entityI... | Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role Id.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws RuntimeE... | [
"Delete",
"an",
"entity",
"role",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L13868-L13870 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/Db.java | Db.findFirst | public static Record findFirst(String sql, Object... paras) {
"""
Find first record. I recommend add "limit 1" in your sql.
@param sql an SQL statement that may contain one or more '?' IN parameter placeholders
@param paras the parameters of sql
@return the Record object
"""
return MAIN.findFirst(sql, pa... | java | public static Record findFirst(String sql, Object... paras) {
return MAIN.findFirst(sql, paras);
} | [
"public",
"static",
"Record",
"findFirst",
"(",
"String",
"sql",
",",
"Object",
"...",
"paras",
")",
"{",
"return",
"MAIN",
".",
"findFirst",
"(",
"sql",
",",
"paras",
")",
";",
"}"
] | Find first record. I recommend add "limit 1" in your sql.
@param sql an SQL statement that may contain one or more '?' IN parameter placeholders
@param paras the parameters of sql
@return the Record object | [
"Find",
"first",
"record",
".",
"I",
"recommend",
"add",
"limit",
"1",
"in",
"your",
"sql",
"."
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Db.java#L292-L294 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.replaceAll | public static String replaceAll(final CharSequence self, final CharSequence regex, final CharSequence replacement) {
"""
Replaces each substring of this CharSequence that matches the given
regular expression with the given replacement.
@param self a CharSequence
@param regex the capturing regex
... | java | public static String replaceAll(final CharSequence self, final CharSequence regex, final CharSequence replacement) {
return self.toString().replaceAll(regex.toString(), replacement.toString());
} | [
"public",
"static",
"String",
"replaceAll",
"(",
"final",
"CharSequence",
"self",
",",
"final",
"CharSequence",
"regex",
",",
"final",
"CharSequence",
"replacement",
")",
"{",
"return",
"self",
".",
"toString",
"(",
")",
".",
"replaceAll",
"(",
"regex",
".",
... | Replaces each substring of this CharSequence that matches the given
regular expression with the given replacement.
@param self a CharSequence
@param regex the capturing regex
@param replacement the string to be substituted for each match
@return the toString() of the CharSequence with content replaced
@th... | [
"Replaces",
"each",
"substring",
"of",
"this",
"CharSequence",
"that",
"matches",
"the",
"given",
"regular",
"expression",
"with",
"the",
"given",
"replacement",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L2468-L2470 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.getMetadataWithChildrenC | public <C> DbxEntry./*@Nullable*/WithChildrenC<C> getMetadataWithChildrenC(String path, boolean includeMediaInfo, final Collector<DbxEntry, ? extends C> collector)
throws DbxException {
"""
Same as {@link #getMetadataWithChildren} except instead of always returning a list of
{@link DbxEntry} objects, you ... | java | public <C> DbxEntry./*@Nullable*/WithChildrenC<C> getMetadataWithChildrenC(String path, boolean includeMediaInfo, final Collector<DbxEntry, ? extends C> collector)
throws DbxException
{
return getMetadataWithChildrenBase(path, includeMediaInfo, new DbxEntry.WithChildrenC.ReaderMaybeDeleted<C>(collec... | [
"public",
"<",
"C",
">",
"DbxEntry",
".",
"/*@Nullable*/",
"WithChildrenC",
"<",
"C",
">",
"getMetadataWithChildrenC",
"(",
"String",
"path",
",",
"boolean",
"includeMediaInfo",
",",
"final",
"Collector",
"<",
"DbxEntry",
",",
"?",
"extends",
"C",
">",
"collec... | Same as {@link #getMetadataWithChildren} except instead of always returning a list of
{@link DbxEntry} objects, you specify a {@link Collector} that processes the {@link DbxEntry}
objects one by one and aggregates them however you want.
<p>
This allows your to process the {@link DbxEntry} values as they arrive, instea... | [
"Same",
"as",
"{",
"@link",
"#getMetadataWithChildren",
"}",
"except",
"instead",
"of",
"always",
"returning",
"a",
"list",
"of",
"{",
"@link",
"DbxEntry",
"}",
"objects",
"you",
"specify",
"a",
"{",
"@link",
"Collector",
"}",
"that",
"processes",
"the",
"{"... | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L204-L208 |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/TransposeDataCollection.java | TransposeDataCollection.put | public final FlatDataCollection put(Object key, FlatDataCollection value) {
"""
Adds a particular key-value into the internal map. It returns the previous
value which was associated with that key.
@param key
@param value
@return
"""
return internalData.put(key, value);
} | java | public final FlatDataCollection put(Object key, FlatDataCollection value) {
return internalData.put(key, value);
} | [
"public",
"final",
"FlatDataCollection",
"put",
"(",
"Object",
"key",
",",
"FlatDataCollection",
"value",
")",
"{",
"return",
"internalData",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Adds a particular key-value into the internal map. It returns the previous
value which was associated with that key.
@param key
@param value
@return | [
"Adds",
"a",
"particular",
"key",
"-",
"value",
"into",
"the",
"internal",
"map",
".",
"It",
"returns",
"the",
"previous",
"value",
"which",
"was",
"associated",
"with",
"that",
"key",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/TransposeDataCollection.java#L79-L81 |
jbundle/jbundle | thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHtmlView.java | JHtmlView.linkActivated | public void linkActivated(URL url, BaseApplet applet, int iOptions) {
"""
Follows the reference in an
link. The given url is the requested reference.
By default this calls <a href="#setPage">setPage</a>,
and if an exception is thrown the original previous
document is restored and a beep sounded. If an
attem... | java | public void linkActivated(URL url, BaseApplet applet, int iOptions)
{
m_editorPane.linkActivated(url, applet, iOptions);
} | [
"public",
"void",
"linkActivated",
"(",
"URL",
"url",
",",
"BaseApplet",
"applet",
",",
"int",
"iOptions",
")",
"{",
"m_editorPane",
".",
"linkActivated",
"(",
"url",
",",
"applet",
",",
"iOptions",
")",
";",
"}"
] | Follows the reference in an
link. The given url is the requested reference.
By default this calls <a href="#setPage">setPage</a>,
and if an exception is thrown the original previous
document is restored and a beep sounded. If an
attempt was made to follow a link, but it represented
a malformed url, this method will b... | [
"Follows",
"the",
"reference",
"in",
"an",
"link",
".",
"The",
"given",
"url",
"is",
"the",
"requested",
"reference",
".",
"By",
"default",
"this",
"calls",
"<a",
"href",
"=",
"#setPage",
">",
"setPage<",
"/",
"a",
">",
"and",
"if",
"an",
"exception",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHtmlView.java#L225-L228 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/tenancy/configuration/DurationHelper.java | DurationHelper.getDurationByTimeValues | public static Duration getDurationByTimeValues(final long hours, final long minutes, final long seconds) {
"""
converts values of time constants to a Duration object..
@param hours
count of hours
@param minutes
count of minutes
@param seconds
count of seconds
@return duration
"""
return Durati... | java | public static Duration getDurationByTimeValues(final long hours, final long minutes, final long seconds) {
return Duration.ofHours(hours).plusMinutes(minutes).plusSeconds(seconds);
} | [
"public",
"static",
"Duration",
"getDurationByTimeValues",
"(",
"final",
"long",
"hours",
",",
"final",
"long",
"minutes",
",",
"final",
"long",
"seconds",
")",
"{",
"return",
"Duration",
".",
"ofHours",
"(",
"hours",
")",
".",
"plusMinutes",
"(",
"minutes",
... | converts values of time constants to a Duration object..
@param hours
count of hours
@param minutes
count of minutes
@param seconds
count of seconds
@return duration | [
"converts",
"values",
"of",
"time",
"constants",
"to",
"a",
"Duration",
"object",
".."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/tenancy/configuration/DurationHelper.java#L118-L120 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java | JBossASClient.findNodeInList | public ModelNode findNodeInList(Address addr, String haystack, String needle) throws Exception {
"""
This tries to find specific node within a list of nodes. Given an address and a named node
at that address (the "haystack"), it is assumed that haystack is actually a list of other
nodes. This method looks in the... | java | public ModelNode findNodeInList(Address addr, String haystack, String needle) throws Exception {
final ModelNode queryNode = createRequest(READ_RESOURCE, addr);
final ModelNode results = execute(queryNode);
if (isSuccess(results)) {
final ModelNode haystackNode = getResults(results).... | [
"public",
"ModelNode",
"findNodeInList",
"(",
"Address",
"addr",
",",
"String",
"haystack",
",",
"String",
"needle",
")",
"throws",
"Exception",
"{",
"final",
"ModelNode",
"queryNode",
"=",
"createRequest",
"(",
"READ_RESOURCE",
",",
"addr",
")",
";",
"final",
... | This tries to find specific node within a list of nodes. Given an address and a named node
at that address (the "haystack"), it is assumed that haystack is actually a list of other
nodes. This method looks in the haystack and tries to find the named needle. If it finds it,
that list item is returned. If it does not fin... | [
"This",
"tries",
"to",
"find",
"specific",
"node",
"within",
"a",
"list",
"of",
"nodes",
".",
"Given",
"an",
"address",
"and",
"a",
"named",
"node",
"at",
"that",
"address",
"(",
"the",
"haystack",
")",
"it",
"is",
"assumed",
"that",
"haystack",
"is",
... | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java#L417-L434 |
jaxio/javaee-lab | javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java | GenericRepository.getVersionAttribute | protected SingularAttribute<? super E, ?> getVersionAttribute(EntityType<E> entityType) {
"""
/*
_HACK_ too bad that JPA does not provide this entityType.getVersion();
<p>
http://stackoverflow.com/questions/13265094/generic-way-to-get-jpa-entity-version
"""
for (SingularAttribute<? super E, ?> sa : ... | java | protected SingularAttribute<? super E, ?> getVersionAttribute(EntityType<E> entityType) {
for (SingularAttribute<? super E, ?> sa : entityType.getSingularAttributes()) {
if (sa.isVersion()) {
return sa;
}
}
return null;
} | [
"protected",
"SingularAttribute",
"<",
"?",
"super",
"E",
",",
"?",
">",
"getVersionAttribute",
"(",
"EntityType",
"<",
"E",
">",
"entityType",
")",
"{",
"for",
"(",
"SingularAttribute",
"<",
"?",
"super",
"E",
",",
"?",
">",
"sa",
":",
"entityType",
"."... | /*
_HACK_ too bad that JPA does not provide this entityType.getVersion();
<p>
http://stackoverflow.com/questions/13265094/generic-way-to-get-jpa-entity-version | [
"/",
"*",
"_HACK_",
"too",
"bad",
"that",
"JPA",
"does",
"not",
"provide",
"this",
"entityType",
".",
"getVersion",
"()",
";",
"<p",
">",
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"13265094",
"/",
"generic",
"-",
"way",
"-"... | train | https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java#L679-L686 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/web/util/UriComponentsBuilder.java | UriComponentsBuilder.queryParam | public UriComponentsBuilder queryParam(String name, Object... values) {
"""
Append the given query parameter to the existing query parameters. The
given name or any of the values may contain URI template variables. If no
values are given, the resulting URI will contain the query parameter name
only (i.e. {@code... | java | public UriComponentsBuilder queryParam(String name, Object... values) {
Assert.notNull(name, "'name' must not be null");
if (!ObjectUtils.isEmpty(values)) {
for (Object value : values) {
String valueAsString = (value != null ? value.toString() : null);
this.queryParams.add(name, valueAsString);
}
}
... | [
"public",
"UriComponentsBuilder",
"queryParam",
"(",
"String",
"name",
",",
"Object",
"...",
"values",
")",
"{",
"Assert",
".",
"notNull",
"(",
"name",
",",
"\"'name' must not be null\"",
")",
";",
"if",
"(",
"!",
"ObjectUtils",
".",
"isEmpty",
"(",
"values",
... | Append the given query parameter to the existing query parameters. The
given name or any of the values may contain URI template variables. If no
values are given, the resulting URI will contain the query parameter name
only (i.e. {@code ?foo} instead of {@code ?foo=bar}.
@param name the query parameter name
@param valu... | [
"Append",
"the",
"given",
"query",
"parameter",
"to",
"the",
"existing",
"query",
"parameters",
".",
"The",
"given",
"name",
"or",
"any",
"of",
"the",
"values",
"may",
"contain",
"URI",
"template",
"variables",
".",
"If",
"no",
"values",
"are",
"given",
"t... | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/web/util/UriComponentsBuilder.java#L570-L583 |
javalite/activeweb | javalite-async/src/main/java/org/javalite/async/Async.java | Async.getBatchReceiver | public BatchReceiver getBatchReceiver(String queueName, long timeout) {
"""
Generate a {@link BatchReceiver} to receive and process stored messages.
This method ALWAYS works in the context of a transaction.
@param queueName name of queue
@param timeout timeout to wait.
@return instance of {@link BatchReceiv... | java | public BatchReceiver getBatchReceiver(String queueName, long timeout){
try {
return new BatchReceiver((Queue) jmsServer.lookup(QUEUE_NAMESPACE + queueName), timeout, consumerConnection);
} catch (Exception e) {
throw new AsyncException(e);
}
} | [
"public",
"BatchReceiver",
"getBatchReceiver",
"(",
"String",
"queueName",
",",
"long",
"timeout",
")",
"{",
"try",
"{",
"return",
"new",
"BatchReceiver",
"(",
"(",
"Queue",
")",
"jmsServer",
".",
"lookup",
"(",
"QUEUE_NAMESPACE",
"+",
"queueName",
")",
",",
... | Generate a {@link BatchReceiver} to receive and process stored messages.
This method ALWAYS works in the context of a transaction.
@param queueName name of queue
@param timeout timeout to wait.
@return instance of {@link BatchReceiver}. | [
"Generate",
"a",
"{",
"@link",
"BatchReceiver",
"}",
"to",
"receive",
"and",
"process",
"stored",
"messages",
".",
"This",
"method",
"ALWAYS",
"works",
"in",
"the",
"context",
"of",
"a",
"transaction",
"."
] | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/javalite-async/src/main/java/org/javalite/async/Async.java#L528-L534 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java | Planar.get32u8 | public int get32u8( int x , int y ) {
"""
Returns an integer formed from 4 bands. band[0]<<24 | band[1] << 16 | band[2]<<8 | band[3]. Assumes
arrays are U8 type.
@param x column
@param y row
@return 32 bit integer
"""
int i = startIndex + y*stride+x;
return ((((GrayU8)bands[0]).data[i]&0xFF) << 24) |... | java | public int get32u8( int x , int y ) {
int i = startIndex + y*stride+x;
return ((((GrayU8)bands[0]).data[i]&0xFF) << 24) |
((((GrayU8)bands[1]).data[i]&0xFF) << 16) |
((((GrayU8)bands[2]).data[i]&0xFF) << 8) |
(((GrayU8)bands[3]).data[i]&0xFF);
} | [
"public",
"int",
"get32u8",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"i",
"=",
"startIndex",
"+",
"y",
"*",
"stride",
"+",
"x",
";",
"return",
"(",
"(",
"(",
"(",
"GrayU8",
")",
"bands",
"[",
"0",
"]",
")",
".",
"data",
"[",
"i",
... | Returns an integer formed from 4 bands. band[0]<<24 | band[1] << 16 | band[2]<<8 | band[3]. Assumes
arrays are U8 type.
@param x column
@param y row
@return 32 bit integer | [
"Returns",
"an",
"integer",
"formed",
"from",
"4",
"bands",
".",
"band",
"[",
"0",
"]",
"<<24",
"|",
"band",
"[",
"1",
"]",
"<<",
"16",
"|",
"band",
"[",
"2",
"]",
"<<8",
"|",
"band",
"[",
"3",
"]",
".",
"Assumes",
"arrays",
"are",
"U8",
"type"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/image/Planar.java#L322-L328 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.setDefault | public static synchronized void setDefault(Category category, ULocale newLocale) {
"""
Sets the default <code>ULocale</code> for the specified <code>Category</code>.
This also sets the default <code>Locale</code> for the specified <code>Category</code>
of the JVM. If the caller does not have write permission to ... | java | public static synchronized void setDefault(Category category, ULocale newLocale) {
Locale newJavaDefault = newLocale.toLocale();
int idx = category.ordinal();
defaultCategoryULocales[idx] = newLocale;
defaultCategoryLocales[idx] = newJavaDefault;
JDKLocaleHelper.setDefault(catego... | [
"public",
"static",
"synchronized",
"void",
"setDefault",
"(",
"Category",
"category",
",",
"ULocale",
"newLocale",
")",
"{",
"Locale",
"newJavaDefault",
"=",
"newLocale",
".",
"toLocale",
"(",
")",
";",
"int",
"idx",
"=",
"category",
".",
"ordinal",
"(",
")... | Sets the default <code>ULocale</code> for the specified <code>Category</code>.
This also sets the default <code>Locale</code> for the specified <code>Category</code>
of the JVM. If the caller does not have write permission to the
user.language property, a security exception will be thrown,
and the default ULocale for t... | [
"Sets",
"the",
"default",
"<code",
">",
"ULocale<",
"/",
"code",
">",
"for",
"the",
"specified",
"<code",
">",
"Category<",
"/",
"code",
">",
".",
"This",
"also",
"sets",
"the",
"default",
"<code",
">",
"Locale<",
"/",
"code",
">",
"for",
"the",
"speci... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L716-L722 |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneBlock.java | SceneBlock.blockKey | protected final int blockKey (int tx, int ty) {
"""
Computes the key for the block that holds the specified tile.
"""
int bx = MathUtil.floorDiv(tx, _bounds.width);
int by = MathUtil.floorDiv(ty, _bounds.height);
return MisoScenePanel.compose(bx, by);
} | java | protected final int blockKey (int tx, int ty)
{
int bx = MathUtil.floorDiv(tx, _bounds.width);
int by = MathUtil.floorDiv(ty, _bounds.height);
return MisoScenePanel.compose(bx, by);
} | [
"protected",
"final",
"int",
"blockKey",
"(",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"int",
"bx",
"=",
"MathUtil",
".",
"floorDiv",
"(",
"tx",
",",
"_bounds",
".",
"width",
")",
";",
"int",
"by",
"=",
"MathUtil",
".",
"floorDiv",
"(",
"ty",
",",
... | Computes the key for the block that holds the specified tile. | [
"Computes",
"the",
"key",
"for",
"the",
"block",
"that",
"holds",
"the",
"specified",
"tile",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlock.java#L547-L552 |
OpenBEL/openbel-framework | org.openbel.framework.common/src/main/java/org/openbel/framework/common/BELUtilities.java | BELUtilities.computeHashSHA256 | public static String computeHashSHA256(final InputStream input)
throws IOException {
"""
Computes a SHA-256 hash of data from the {@link InputStream input}.
@param input the data {@link InputStream input stream}, which cannot be
{@code null}
@return the {@link String SHA-256 hash}
@throws IOExcep... | java | public static String computeHashSHA256(final InputStream input)
throws IOException {
if (input == null) {
throw new InvalidArgument("input", input);
}
MessageDigest sha256;
try {
sha256 = MessageDigest.getInstance("SHA-256");
} catch (NoSuchAl... | [
"public",
"static",
"String",
"computeHashSHA256",
"(",
"final",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidArgument",
"(",
"\"input\"",
",",
"input",
")",
";",
"}",
"Message... | Computes a SHA-256 hash of data from the {@link InputStream input}.
@param input the data {@link InputStream input stream}, which cannot be
{@code null}
@return the {@link String SHA-256 hash}
@throws IOException Thrown if an IO error occurred reading from the
{@link InputStream input}
@throws InvalidArgument Thrown i... | [
"Computes",
"a",
"SHA",
"-",
"256",
"hash",
"of",
"data",
"from",
"the",
"{",
"@link",
"InputStream",
"input",
"}",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/BELUtilities.java#L208-L233 |
google/identity-toolkit-java-client | src/main/java/com/google/identitytoolkit/GitkitClient.java | GitkitClient.getOobResponse | public OobResponse getOobResponse(HttpServletRequest req)
throws GitkitServerException {
"""
Gets out-of-band response. Used by oob endpoint for ResetPassword and ChangeEmail operation.
The web site needs to send user an email containing the oobUrl in the response. The user needs
to click the oobUrl to fin... | java | public OobResponse getOobResponse(HttpServletRequest req)
throws GitkitServerException {
String gitkitToken = lookupCookie(req, cookieName);
return getOobResponse(req, gitkitToken);
} | [
"public",
"OobResponse",
"getOobResponse",
"(",
"HttpServletRequest",
"req",
")",
"throws",
"GitkitServerException",
"{",
"String",
"gitkitToken",
"=",
"lookupCookie",
"(",
"req",
",",
"cookieName",
")",
";",
"return",
"getOobResponse",
"(",
"req",
",",
"gitkitToken... | Gets out-of-band response. Used by oob endpoint for ResetPassword and ChangeEmail operation.
The web site needs to send user an email containing the oobUrl in the response. The user needs
to click the oobUrl to finish the operation.
@param req http request for the oob endpoint
@return the oob response.
@throws GitkitS... | [
"Gets",
"out",
"-",
"of",
"-",
"band",
"response",
".",
"Used",
"by",
"oob",
"endpoint",
"for",
"ResetPassword",
"and",
"ChangeEmail",
"operation",
".",
"The",
"web",
"site",
"needs",
"to",
"send",
"user",
"an",
"email",
"containing",
"the",
"oobUrl",
"in"... | train | https://github.com/google/identity-toolkit-java-client/blob/61dda1aabbd541ad5e431e840fd266bfca5f8a4a/src/main/java/com/google/identitytoolkit/GitkitClient.java#L444-L448 |
nextreports/nextreports-engine | src/ro/nextreports/engine/exporter/XlsxExporter.java | XlsxExporter.updateSubreportBandElementStyle | private XSSFCellStyle updateSubreportBandElementStyle(XSSFCellStyle cellStyle, BandElement bandElement, Object value, int gridRow, int gridColumn, int colSpan) {
"""
If a border style is set on a ReportBandElement we must apply it to all subreport cells
"""
if (subreportCellStyle == null) {
return c... | java | private XSSFCellStyle updateSubreportBandElementStyle(XSSFCellStyle cellStyle, BandElement bandElement, Object value, int gridRow, int gridColumn, int colSpan) {
if (subreportCellStyle == null) {
return cellStyle;
}
if (gridColumn == 0) {
cellStyle.setBorderLeft(sub... | [
"private",
"XSSFCellStyle",
"updateSubreportBandElementStyle",
"(",
"XSSFCellStyle",
"cellStyle",
",",
"BandElement",
"bandElement",
",",
"Object",
"value",
",",
"int",
"gridRow",
",",
"int",
"gridColumn",
",",
"int",
"colSpan",
")",
"{",
"if",
"(",
"subreportCellSt... | If a border style is set on a ReportBandElement we must apply it to all subreport cells | [
"If",
"a",
"border",
"style",
"is",
"set",
"on",
"a",
"ReportBandElement",
"we",
"must",
"apply",
"it",
"to",
"all",
"subreport",
"cells"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/exporter/XlsxExporter.java#L470-L492 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.rangeLimit | private int rangeLimit(int size, int min, int max) {
"""
Take the user input size variable and make sure it is inside
the given range of min and max. If it is outside the range,
then set the value to the closest limit.
@param size
@param min
@param max
@return int
"""
if (size < min) {
... | java | private int rangeLimit(int size, int min, int max) {
if (size < min) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Config: " + size + " too small");
}
return min;
} else if (size > max) {
if (TraceCompon... | [
"private",
"int",
"rangeLimit",
"(",
"int",
"size",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"if",
"(",
"size",
"<",
"min",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")... | Take the user input size variable and make sure it is inside
the given range of min and max. If it is outside the range,
then set the value to the closest limit.
@param size
@param min
@param max
@return int | [
"Take",
"the",
"user",
"input",
"size",
"variable",
"and",
"make",
"sure",
"it",
"is",
"inside",
"the",
"given",
"range",
"of",
"min",
"and",
"max",
".",
"If",
"it",
"is",
"outside",
"the",
"range",
"then",
"set",
"the",
"value",
"to",
"the",
"closest"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L1487-L1500 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/TouchManager.java | TouchManager.makeTouchable | public void makeTouchable(GVRSceneObject sceneObject, OnTouch handler) {
"""
Makes the scene object touchable and associates the {@link OnTouch handler} with it.
The TouchManager will not hold strong references to sceneObject and handler.
@param sceneObject
@param handler
"""
if (handler != null) ... | java | public void makeTouchable(GVRSceneObject sceneObject, OnTouch handler) {
if (handler != null) {
if (sceneObject.getRenderData() != null) {
if (!touchHandlers.containsKey(sceneObject)) {
makePickable(sceneObject);
touchHandlers.put(sceneObject, ... | [
"public",
"void",
"makeTouchable",
"(",
"GVRSceneObject",
"sceneObject",
",",
"OnTouch",
"handler",
")",
"{",
"if",
"(",
"handler",
"!=",
"null",
")",
"{",
"if",
"(",
"sceneObject",
".",
"getRenderData",
"(",
")",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
... | Makes the scene object touchable and associates the {@link OnTouch handler} with it.
The TouchManager will not hold strong references to sceneObject and handler.
@param sceneObject
@param handler | [
"Makes",
"the",
"scene",
"object",
"touchable",
"and",
"associates",
"the",
"{",
"@link",
"OnTouch",
"handler",
"}",
"with",
"it",
".",
"The",
"TouchManager",
"will",
"not",
"hold",
"strong",
"references",
"to",
"sceneObject",
"and",
"handler",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/TouchManager.java#L73-L86 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/math/RoundHelper.java | RoundHelper.getRoundedEvenExp | public static double getRoundedEvenExp (final double dValue, @Nonnegative final int nScale) {
"""
Round using the {@link RoundingMode#HALF_EVEN} mode and exponential
representation
@param dValue
The value to be rounded
@param nScale
The precision scale
@return the rounded value
"""
return getRounde... | java | public static double getRoundedEvenExp (final double dValue, @Nonnegative final int nScale)
{
return getRounded (dValue, nScale, RoundingMode.HALF_EVEN, EDecimalType.EXP);
} | [
"public",
"static",
"double",
"getRoundedEvenExp",
"(",
"final",
"double",
"dValue",
",",
"@",
"Nonnegative",
"final",
"int",
"nScale",
")",
"{",
"return",
"getRounded",
"(",
"dValue",
",",
"nScale",
",",
"RoundingMode",
".",
"HALF_EVEN",
",",
"EDecimalType",
... | Round using the {@link RoundingMode#HALF_EVEN} mode and exponential
representation
@param dValue
The value to be rounded
@param nScale
The precision scale
@return the rounded value | [
"Round",
"using",
"the",
"{",
"@link",
"RoundingMode#HALF_EVEN",
"}",
"mode",
"and",
"exponential",
"representation"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/math/RoundHelper.java#L144-L147 |
deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/recordreader/BaseImageRecordReader.java | BaseImageRecordReader.initialize | public void initialize(Configuration conf, InputSplit split, ImageTransform imageTransform)
throws IOException, InterruptedException {
"""
Called once at initialization.
@param conf a configuration for initialization
@param split the split that defines the range of records to rea... | java | public void initialize(Configuration conf, InputSplit split, ImageTransform imageTransform)
throws IOException, InterruptedException {
this.imageLoader = null;
this.imageTransform = imageTransform;
initialize(conf, split);
} | [
"public",
"void",
"initialize",
"(",
"Configuration",
"conf",
",",
"InputSplit",
"split",
",",
"ImageTransform",
"imageTransform",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"this",
".",
"imageLoader",
"=",
"null",
";",
"this",
".",
"imageTran... | Called once at initialization.
@param conf a configuration for initialization
@param split the split that defines the range of records to read
@param imageTransform the image transform to use to transform images while loading them
@throws java.io.IOException
@throws InterruptedException | [
"Called",
"once",
"at",
"initialization",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/recordreader/BaseImageRecordReader.java#L211-L216 |
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/reflect/ClassReflectionIndex.java | ClassReflectionIndex.getMethod | public Method getMethod(String returnType, String name, String... paramTypeNames) {
"""
Get a method declared on this object.
@param returnType the method return type name
@param name the name of the method
@param paramTypeNames the parameter type names of the method
@return the method, or {@co... | java | public Method getMethod(String returnType, String name, String... paramTypeNames) {
final Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(name);
if (nameMap == null) {
return null;
}
final Map<String, Method> paramsMap = nameMap.get(createParamNameList... | [
"public",
"Method",
"getMethod",
"(",
"String",
"returnType",
",",
"String",
"name",
",",
"String",
"...",
"paramTypeNames",
")",
"{",
"final",
"Map",
"<",
"ParamNameList",
",",
"Map",
"<",
"String",
",",
"Method",
">",
">",
"nameMap",
"=",
"methodsByTypeNam... | Get a method declared on this object.
@param returnType the method return type name
@param name the name of the method
@param paramTypeNames the parameter type names of the method
@return the method, or {@code null} if no method of that description exists | [
"Get",
"a",
"method",
"declared",
"on",
"this",
"object",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/reflect/ClassReflectionIndex.java#L235-L245 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/ShareResourcesImpl.java | ShareResourcesImpl.deleteShare | public void deleteShare(long objectId, String shareId) throws SmartsheetException {
"""
Delete a share.
It mirrors to the following Smartsheet REST API method:
DELETE /workspaces/{workspaceId}/shares/{shareId}
DELETE /sheets/{sheetId}/shares/{shareId}
DELETE /sights/{sheetId}/shares/{shareId}
DELETE /report... | java | public void deleteShare(long objectId, String shareId) throws SmartsheetException {
this.deleteResource(getMasterResourceType() + "/" + objectId + "/shares/" + shareId, Share.class);
} | [
"public",
"void",
"deleteShare",
"(",
"long",
"objectId",
",",
"String",
"shareId",
")",
"throws",
"SmartsheetException",
"{",
"this",
".",
"deleteResource",
"(",
"getMasterResourceType",
"(",
")",
"+",
"\"/\"",
"+",
"objectId",
"+",
"\"/shares/\"",
"+",
"shareI... | Delete a share.
It mirrors to the following Smartsheet REST API method:
DELETE /workspaces/{workspaceId}/shares/{shareId}
DELETE /sheets/{sheetId}/shares/{shareId}
DELETE /sights/{sheetId}/shares/{shareId}
DELETE /reports/{reportId}/shares/{shareId}
Exceptions:
InvalidRequestException : if there is any problem with t... | [
"Delete",
"a",
"share",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/ShareResourcesImpl.java#L199-L201 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspScopedVarBodyTagSuport.java | CmsJspScopedVarBodyTagSuport.storeAttribute | protected void storeAttribute(String name, Object obj) {
"""
Stores the provided Object as attribute with the provided name in the JSP page context.<p>
The value of {@link #getScope()} is used to determine how the Object is stored.<p>
@param name the name of the attribute to store the Object in
@param obj t... | java | protected void storeAttribute(String name, Object obj) {
pageContext.setAttribute(name, obj, getScopeInt());
} | [
"protected",
"void",
"storeAttribute",
"(",
"String",
"name",
",",
"Object",
"obj",
")",
"{",
"pageContext",
".",
"setAttribute",
"(",
"name",
",",
"obj",
",",
"getScopeInt",
"(",
")",
")",
";",
"}"
] | Stores the provided Object as attribute with the provided name in the JSP page context.<p>
The value of {@link #getScope()} is used to determine how the Object is stored.<p>
@param name the name of the attribute to store the Object in
@param obj the Object to store in the JSP page context | [
"Stores",
"the",
"provided",
"Object",
"as",
"attribute",
"with",
"the",
"provided",
"name",
"in",
"the",
"JSP",
"page",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspScopedVarBodyTagSuport.java#L211-L214 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java | DataNode.instantiateDataNode | public static DataNode instantiateDataNode(String args[],
Configuration conf) throws IOException {
"""
Instantiate a single datanode object. This must be run by invoking
{@link DataNode#runDatanodeDaemon(DataNode)} subsequently.
"""
if (conf == null)
conf = new ... | java | public static DataNode instantiateDataNode(String args[],
Configuration conf) throws IOException {
if (conf == null)
conf = new Configuration();
if (!parseArguments(args, conf)) {
printUsage();
return null;
}
if (conf.get("dfs.network.script") != n... | [
"public",
"static",
"DataNode",
"instantiateDataNode",
"(",
"String",
"args",
"[",
"]",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"if",
"(",
"conf",
"==",
"null",
")",
"conf",
"=",
"new",
"Configuration",
"(",
")",
";",
"if",
"(",
... | Instantiate a single datanode object. This must be run by invoking
{@link DataNode#runDatanodeDaemon(DataNode)} subsequently. | [
"Instantiate",
"a",
"single",
"datanode",
"object",
".",
"This",
"must",
"be",
"run",
"by",
"invoking",
"{"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java#L2347-L2364 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/Branch.java | Branch.getCreditHistory | public void getCreditHistory(final String bucket, final String afterId, final int length,
@NonNull final CreditHistoryOrder order, BranchListResponseListener callback) {
"""
<p>Gets the credit history of the specified bucket and triggers a callback to handle the
response.</p>
@... | java | public void getCreditHistory(final String bucket, final String afterId, final int length,
@NonNull final CreditHistoryOrder order, BranchListResponseListener callback) {
ServerRequest req = new ServerRequestGetRewardHistory(context_, bucket, afterId, length, order, callback);
... | [
"public",
"void",
"getCreditHistory",
"(",
"final",
"String",
"bucket",
",",
"final",
"String",
"afterId",
",",
"final",
"int",
"length",
",",
"@",
"NonNull",
"final",
"CreditHistoryOrder",
"order",
",",
"BranchListResponseListener",
"callback",
")",
"{",
"ServerR... | <p>Gets the credit history of the specified bucket and triggers a callback to handle the
response.</p>
@param bucket A {@link String} value containing the name of the referral bucket that the
code will belong to.
@param afterId A {@link String} value containing the ID of the history record to begin after.
This allo... | [
"<p",
">",
"Gets",
"the",
"credit",
"history",
"of",
"the",
"specified",
"bucket",
"and",
"triggers",
"a",
"callback",
"to",
"handle",
"the",
"response",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/Branch.java#L1994-L2000 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterServiceImpl.java | ClusterServiceImpl.shouldAcceptMastership | private boolean shouldAcceptMastership(MemberMap memberMap, MemberImpl candidate) {
"""
mastership is accepted when all members before the candidate is suspected
"""
assert lock.isHeldByCurrentThread() : "Called without holding cluster service lock!";
for (MemberImpl member : memberMap.headMemb... | java | private boolean shouldAcceptMastership(MemberMap memberMap, MemberImpl candidate) {
assert lock.isHeldByCurrentThread() : "Called without holding cluster service lock!";
for (MemberImpl member : memberMap.headMemberSet(candidate, false)) {
if (!membershipManager.isMemberSuspected(member.getA... | [
"private",
"boolean",
"shouldAcceptMastership",
"(",
"MemberMap",
"memberMap",
",",
"MemberImpl",
"candidate",
")",
"{",
"assert",
"lock",
".",
"isHeldByCurrentThread",
"(",
")",
":",
"\"Called without holding cluster service lock!\"",
";",
"for",
"(",
"MemberImpl",
"me... | mastership is accepted when all members before the candidate is suspected | [
"mastership",
"is",
"accepted",
"when",
"all",
"members",
"before",
"the",
"candidate",
"is",
"suspected"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterServiceImpl.java#L285-L298 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/base/Json.java | Json.resource_to_string | public String resource_to_string(base_resource resources[], options option) {
"""
Converts NetScaler SDX resources to Json string.
@param resources API resources.
@param option options class object.
@return returns a String
"""
String objecttype = resources[0].get_object_type();
String request = "{";
... | java | public String resource_to_string(base_resource resources[], options option)
{
String objecttype = resources[0].get_object_type();
String request = "{";
if (option != null && option.get_action() != null)
request = request + "\"params\": {\"action\": \"" + option.get_action() + "\"},";
request = req... | [
"public",
"String",
"resource_to_string",
"(",
"base_resource",
"resources",
"[",
"]",
",",
"options",
"option",
")",
"{",
"String",
"objecttype",
"=",
"resources",
"[",
"0",
"]",
".",
"get_object_type",
"(",
")",
";",
"String",
"request",
"=",
"\"{\"",
";",... | Converts NetScaler SDX resources to Json string.
@param resources API resources.
@param option options class object.
@return returns a String | [
"Converts",
"NetScaler",
"SDX",
"resources",
"to",
"Json",
"string",
"."
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/base/Json.java#L80-L96 |
netty/netty | common/src/main/java/io/netty/util/internal/ThreadExecutorMap.java | ThreadExecutorMap.apply | public static Executor apply(final Executor executor, final EventExecutor eventExecutor) {
"""
Decorate the given {@link Executor} and ensure {@link #currentExecutor()} will return {@code eventExecutor}
when called from within the {@link Runnable} during execution.
"""
ObjectUtil.checkNotNull(executor... | java | public static Executor apply(final Executor executor, final EventExecutor eventExecutor) {
ObjectUtil.checkNotNull(executor, "executor");
ObjectUtil.checkNotNull(eventExecutor, "eventExecutor");
return new Executor() {
@Override
public void execute(final Runnable command)... | [
"public",
"static",
"Executor",
"apply",
"(",
"final",
"Executor",
"executor",
",",
"final",
"EventExecutor",
"eventExecutor",
")",
"{",
"ObjectUtil",
".",
"checkNotNull",
"(",
"executor",
",",
"\"executor\"",
")",
";",
"ObjectUtil",
".",
"checkNotNull",
"(",
"e... | Decorate the given {@link Executor} and ensure {@link #currentExecutor()} will return {@code eventExecutor}
when called from within the {@link Runnable} during execution. | [
"Decorate",
"the",
"given",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/ThreadExecutorMap.java#L51-L60 |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java | ClusteringKeyMapper.sortFields | public SortField[] sortFields() {
"""
Returns a Lucene {@link SortField} array for sorting documents/rows according to the column family name.
@return A Lucene {@link SortField} array for sorting documents/rows according to the column family name.
"""
return new SortField[]{new SortField(FIELD_NAME,... | java | public SortField[] sortFields() {
return new SortField[]{new SortField(FIELD_NAME, new FieldComparatorSource() {
@Override
public FieldComparator<?> newComparator(String field,
int hits,
... | [
"public",
"SortField",
"[",
"]",
"sortFields",
"(",
")",
"{",
"return",
"new",
"SortField",
"[",
"]",
"{",
"new",
"SortField",
"(",
"FIELD_NAME",
",",
"new",
"FieldComparatorSource",
"(",
")",
"{",
"@",
"Override",
"public",
"FieldComparator",
"<",
"?",
">... | Returns a Lucene {@link SortField} array for sorting documents/rows according to the column family name.
@return A Lucene {@link SortField} array for sorting documents/rows according to the column family name. | [
"Returns",
"a",
"Lucene",
"{",
"@link",
"SortField",
"}",
"array",
"for",
"sorting",
"documents",
"/",
"rows",
"according",
"to",
"the",
"column",
"family",
"name",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java#L326-L336 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/reflect/RecursiveObjectReader.java | RecursiveObjectReader.hasProperty | public static boolean hasProperty(Object obj, String name) {
"""
Checks recursively if object or its subobjects has a property with specified
name.
The object can be a user defined object, map or array. The property name
correspondently must be object property, map key or array index.
@param obj an object... | java | public static boolean hasProperty(Object obj, String name) {
if (obj == null || name == null)
return false;
String[] names = name.split("\\.");
if (names == null || names.length == 0)
return false;
return performHasProperty(obj, names, 0);
} | [
"public",
"static",
"boolean",
"hasProperty",
"(",
"Object",
"obj",
",",
"String",
"name",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
"||",
"name",
"==",
"null",
")",
"return",
"false",
";",
"String",
"[",
"]",
"names",
"=",
"name",
".",
"split",
"(",... | Checks recursively if object or its subobjects has a property with specified
name.
The object can be a user defined object, map or array. The property name
correspondently must be object property, map key or array index.
@param obj an object to introspect.
@param name a name of the property to check.
@return true if... | [
"Checks",
"recursively",
"if",
"object",
"or",
"its",
"subobjects",
"has",
"a",
"property",
"with",
"specified",
"name",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/reflect/RecursiveObjectReader.java#L41-L50 |
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecProcessor.java | ModuleSpecProcessor.addAllDependenciesAndPermissions | private void addAllDependenciesAndPermissions(final ModuleSpecification moduleSpecification, final AdditionalModuleSpecification module) {
"""
Gives any additional modules the same dependencies and permissions as the primary module.
<p/>
This makes sure they can access all API classes etc.
@param moduleSpecif... | java | private void addAllDependenciesAndPermissions(final ModuleSpecification moduleSpecification, final AdditionalModuleSpecification module) {
module.addSystemDependencies(moduleSpecification.getSystemDependencies());
module.addLocalDependencies(moduleSpecification.getLocalDependencies());
for(Modul... | [
"private",
"void",
"addAllDependenciesAndPermissions",
"(",
"final",
"ModuleSpecification",
"moduleSpecification",
",",
"final",
"AdditionalModuleSpecification",
"module",
")",
"{",
"module",
".",
"addSystemDependencies",
"(",
"moduleSpecification",
".",
"getSystemDependencies"... | Gives any additional modules the same dependencies and permissions as the primary module.
<p/>
This makes sure they can access all API classes etc.
@param moduleSpecification The primary module spec
@param module The additional module | [
"Gives",
"any",
"additional",
"modules",
"the",
"same",
"dependencies",
"and",
"permissions",
"as",
"the",
"primary",
"module",
".",
"<p",
"/",
">",
"This",
"makes",
"sure",
"they",
"can",
"access",
"all",
"API",
"classes",
"etc",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecProcessor.java#L161-L172 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyConfigurable.java | BlockPlacementPolicyConfigurable.inWindow | private boolean inWindow(DatanodeDescriptor first, DatanodeDescriptor testing) {
"""
Verifies if testing node is within right windows of first node
@param first first node being considered
@param testing node we are testing to check if it is within window or not
@return We return true if it is successful, and n... | java | private boolean inWindow(DatanodeDescriptor first, DatanodeDescriptor testing) {
readLock();
try {
RackRingInfo rackInfo = racksMap.get(first.getNetworkLocation());
assert (rackInfo != null);
Integer machineId = rackInfo.findNode(first);
assert (machineId != null);
final int rac... | [
"private",
"boolean",
"inWindow",
"(",
"DatanodeDescriptor",
"first",
",",
"DatanodeDescriptor",
"testing",
")",
"{",
"readLock",
"(",
")",
";",
"try",
"{",
"RackRingInfo",
"rackInfo",
"=",
"racksMap",
".",
"get",
"(",
"first",
".",
"getNetworkLocation",
"(",
... | Verifies if testing node is within right windows of first node
@param first first node being considered
@param testing node we are testing to check if it is within window or not
@return We return true if it is successful, and not otherwise | [
"Verifies",
"if",
"testing",
"node",
"is",
"within",
"right",
"windows",
"of",
"first",
"node"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyConfigurable.java#L448-L489 |
negusoft/holoaccent | HoloAccent/src/com/negusoft/holoaccent/util/BitmapUtils.java | BitmapUtils.createTintTransformationMap | public static Bitmap createTintTransformationMap(Bitmap bitmap, int tintColor) {
"""
Create a bitmap that contains the transformation to make to create the final
bitmap with a new tint color. You can then call processTintTransformationMap()
to get a bitmap with the desired tint.
@param bitmap The original bitma... | java | public static Bitmap createTintTransformationMap(Bitmap bitmap, int tintColor) {
// tint color
int[] t = new int[] {
Color.red(tintColor),
Color.green(tintColor),
Color.blue(tintColor) };
int width = bitmap.getWidth();
int height = bitmap.getHeight();
int[] pixels = new int[width * height];
b... | [
"public",
"static",
"Bitmap",
"createTintTransformationMap",
"(",
"Bitmap",
"bitmap",
",",
"int",
"tintColor",
")",
"{",
"// tint color",
"int",
"[",
"]",
"t",
"=",
"new",
"int",
"[",
"]",
"{",
"Color",
".",
"red",
"(",
"tintColor",
")",
",",
"Color",
".... | Create a bitmap that contains the transformation to make to create the final
bitmap with a new tint color. You can then call processTintTransformationMap()
to get a bitmap with the desired tint.
@param bitmap The original bitmap.
@param tintColor Tint color in the original bitmap.
@return A transformation map to be use... | [
"Create",
"a",
"bitmap",
"that",
"contains",
"the",
"transformation",
"to",
"make",
"to",
"create",
"the",
"final",
"bitmap",
"with",
"a",
"new",
"tint",
"color",
".",
"You",
"can",
"then",
"call",
"processTintTransformationMap",
"()",
"to",
"get",
"a",
"bit... | train | https://github.com/negusoft/holoaccent/blob/7121a02dde94834e770cb81174d0bdc596323324/HoloAccent/src/com/negusoft/holoaccent/util/BitmapUtils.java#L124-L152 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/ec2/provision/HostProvisioner.java | HostProvisioner.uploadForDeployment | public void uploadForDeployment(String from, String to) throws Exception {
"""
Creates the directory for the file if necessary
and uploads the file
@param from the directory to upload from
@param to the destination directory on the remote server
@throws Exception
"""
File fromFile = new File(from);... | java | public void uploadForDeployment(String from, String to) throws Exception {
File fromFile = new File(from);
if (!to.isEmpty() && fromFile.isDirectory())
mkDir(to);
else
upload(from, to);
} | [
"public",
"void",
"uploadForDeployment",
"(",
"String",
"from",
",",
"String",
"to",
")",
"throws",
"Exception",
"{",
"File",
"fromFile",
"=",
"new",
"File",
"(",
"from",
")",
";",
"if",
"(",
"!",
"to",
".",
"isEmpty",
"(",
")",
"&&",
"fromFile",
".",
... | Creates the directory for the file if necessary
and uploads the file
@param from the directory to upload from
@param to the destination directory on the remote server
@throws Exception | [
"Creates",
"the",
"directory",
"for",
"the",
"file",
"if",
"necessary",
"and",
"uploads",
"the",
"file"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/ec2/provision/HostProvisioner.java#L150-L158 |
javagl/Common | src/main/java/de/javagl/common/xml/XmlUtils.java | XmlUtils.getFirstChild | public static Node getFirstChild(Node node, String childNodeName) {
"""
Returns the first child of the given node with the given name (ignoring
upper/lower case), or <code>null</code> if no such child is found.
@param node The node
@param childNodeName The child node name
@return The child with the given nam... | java | public static Node getFirstChild(Node node, String childNodeName)
{
NodeList childNodes = node.getChildNodes();
for (int i=0; i<childNodes.getLength(); i++)
{
Node child = childNodes.item(i);
String childName = child.getNodeName();
if (childName.equ... | [
"public",
"static",
"Node",
"getFirstChild",
"(",
"Node",
"node",
",",
"String",
"childNodeName",
")",
"{",
"NodeList",
"childNodes",
"=",
"node",
".",
"getChildNodes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"childNodes",
".",
... | Returns the first child of the given node with the given name (ignoring
upper/lower case), or <code>null</code> if no such child is found.
@param node The node
@param childNodeName The child node name
@return The child with the given name, or <code>null</code> | [
"Returns",
"the",
"first",
"child",
"of",
"the",
"given",
"node",
"with",
"the",
"given",
"name",
"(",
"ignoring",
"upper",
"/",
"lower",
"case",
")",
"or",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"no",
"such",
"child",
"is",
"found",
"."
] | train | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/xml/XmlUtils.java#L388-L401 |
dyu/protostuff-1.0.x | protostuff-core/src/main/java/com/dyuproject/protostuff/ProtostuffIOUtil.java | ProtostuffIOUtil.writeListTo | public static <T> int writeListTo(final OutputStream out, final List<T> messages,
final Schema<T> schema, final LinkedBuffer buffer) throws IOException {
"""
Serializes the {@code messages} (delimited) into an {@link OutputStream}
using the given schema.
@return the bytes written
"""
... | java | public static <T> int writeListTo(final OutputStream out, final List<T> messages,
final Schema<T> schema, final LinkedBuffer buffer) throws IOException
{
if(buffer.start != buffer.offset)
throw new IllegalArgumentException("Buffer previously used and had not been reset.");
... | [
"public",
"static",
"<",
"T",
">",
"int",
"writeListTo",
"(",
"final",
"OutputStream",
"out",
",",
"final",
"List",
"<",
"T",
">",
"messages",
",",
"final",
"Schema",
"<",
"T",
">",
"schema",
",",
"final",
"LinkedBuffer",
"buffer",
")",
"throws",
"IOExce... | Serializes the {@code messages} (delimited) into an {@link OutputStream}
using the given schema.
@return the bytes written | [
"Serializes",
"the",
"{",
"@code",
"messages",
"}",
"(",
"delimited",
")",
"into",
"an",
"{",
"@link",
"OutputStream",
"}",
"using",
"the",
"given",
"schema",
"."
] | train | https://github.com/dyu/protostuff-1.0.x/blob/d7c964ec20da3fe44699d86ee95c2677ddffde96/protostuff-core/src/main/java/com/dyuproject/protostuff/ProtostuffIOUtil.java#L277-L300 |
Activiti/Activiti | activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/VariableScopeImpl.java | VariableScopeImpl.setVariableLocal | public Object setVariableLocal(String variableName, Object value, boolean fetchAllVariables) {
"""
The default {@link #setVariableLocal(String, Object)} fetches all variables (for historical and backwards compatible reasons) while setting the variables.
Setting the fetchAllVariables parameter to true is the def... | java | public Object setVariableLocal(String variableName, Object value, boolean fetchAllVariables) {
return setVariableLocal(variableName, value, getSourceActivityExecution(), fetchAllVariables);
} | [
"public",
"Object",
"setVariableLocal",
"(",
"String",
"variableName",
",",
"Object",
"value",
",",
"boolean",
"fetchAllVariables",
")",
"{",
"return",
"setVariableLocal",
"(",
"variableName",
",",
"value",
",",
"getSourceActivityExecution",
"(",
")",
",",
"fetchAll... | The default {@link #setVariableLocal(String, Object)} fetches all variables (for historical and backwards compatible reasons) while setting the variables.
Setting the fetchAllVariables parameter to true is the default behaviour (ie fetching all variables) Setting the fetchAllVariables parameter to false does not do th... | [
"The",
"default",
"{",
"@link",
"#setVariableLocal",
"(",
"String",
"Object",
")",
"}",
"fetches",
"all",
"variables",
"(",
"for",
"historical",
"and",
"backwards",
"compatible",
"reasons",
")",
"while",
"setting",
"the",
"variables",
"."
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/VariableScopeImpl.java#L724-L726 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java | CPSpecificationOptionPersistenceImpl.removeByUUID_G | @Override
public CPSpecificationOption removeByUUID_G(String uuid, long groupId)
throws NoSuchCPSpecificationOptionException {
"""
Removes the cp specification option where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp specification opti... | java | @Override
public CPSpecificationOption removeByUUID_G(String uuid, long groupId)
throws NoSuchCPSpecificationOptionException {
CPSpecificationOption cpSpecificationOption = findByUUID_G(uuid, groupId);
return remove(cpSpecificationOption);
} | [
"@",
"Override",
"public",
"CPSpecificationOption",
"removeByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPSpecificationOptionException",
"{",
"CPSpecificationOption",
"cpSpecificationOption",
"=",
"findByUUID_G",
"(",
"uuid",
",",
"group... | Removes the cp specification option where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp specification option that was removed | [
"Removes",
"the",
"cp",
"specification",
"option",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java#L817-L823 |
scireum/s3ninja | src/main/java/ninja/S3Dispatcher.java | S3Dispatcher.copyObject | private void copyObject(WebContext ctx, Bucket bucket, String id, String copy) throws IOException {
"""
Handles GET /bucket/id with an <tt>x-amz-copy-source</tt> header.
@param ctx the context describing the current request
@param bucket the bucket containing the object to use as destination
@param id ... | java | private void copyObject(WebContext ctx, Bucket bucket, String id, String copy) throws IOException {
StoredObject object = bucket.getObject(id);
if (!copy.contains(PATH_DELIMITER)) {
signalObjectError(ctx, HttpResponseStatus.BAD_REQUEST, "Source must contain '/'");
return;
... | [
"private",
"void",
"copyObject",
"(",
"WebContext",
"ctx",
",",
"Bucket",
"bucket",
",",
"String",
"id",
",",
"String",
"copy",
")",
"throws",
"IOException",
"{",
"StoredObject",
"object",
"=",
"bucket",
".",
"getObject",
"(",
"id",
")",
";",
"if",
"(",
... | Handles GET /bucket/id with an <tt>x-amz-copy-source</tt> header.
@param ctx the context describing the current request
@param bucket the bucket containing the object to use as destination
@param id name of the object to use as destination | [
"Handles",
"GET",
"/",
"bucket",
"/",
"id",
"with",
"an",
"<tt",
">",
"x",
"-",
"amz",
"-",
"copy",
"-",
"source<",
"/",
"tt",
">",
"header",
"."
] | train | https://github.com/scireum/s3ninja/blob/445eec55c91780267a7f987818b3fedecae009c5/src/main/java/ninja/S3Dispatcher.java#L543-L578 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java | InternalService.deleteConversation | public void deleteConversation(@NonNull final String conversationId, final String eTag, @Nullable Callback<ComapiResult<Void>> callback) {
"""
Returns observable to create a conversation.
@param conversationId ID of a conversation to delete.
@param eTag ETag for server to check if local version of th... | java | public void deleteConversation(@NonNull final String conversationId, final String eTag, @Nullable Callback<ComapiResult<Void>> callback) {
adapter.adapt(deleteConversation(conversationId, eTag), callback);
} | [
"public",
"void",
"deleteConversation",
"(",
"@",
"NonNull",
"final",
"String",
"conversationId",
",",
"final",
"String",
"eTag",
",",
"@",
"Nullable",
"Callback",
"<",
"ComapiResult",
"<",
"Void",
">",
">",
"callback",
")",
"{",
"adapter",
".",
"adapt",
"("... | Returns observable to create a conversation.
@param conversationId ID of a conversation to delete.
@param eTag ETag for server to check if local version of the data is the same as the one the server side.
@param callback Callback to deliver new session instance. | [
"Returns",
"observable",
"to",
"create",
"a",
"conversation",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L464-L466 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/security/impl/BasicEvaluationCtx.java | BasicEvaluationCtx.checkContext | private Attribute checkContext(URI type, URI id, URI issuer,
URI category, int designatorType) {
"""
Private helper that checks the request context for an attribute, or else returns
null
"""
if (!STRING_ATTRIBUTE_TYPE_URI.equals(type)) return null;
Strin... | java | private Attribute checkContext(URI type, URI id, URI issuer,
URI category, int designatorType) {
if (!STRING_ATTRIBUTE_TYPE_URI.equals(type)) return null;
String [] values = null;
switch(designatorType){
case AttributeDesignator.SUBJECT_TARGET:... | [
"private",
"Attribute",
"checkContext",
"(",
"URI",
"type",
",",
"URI",
"id",
",",
"URI",
"issuer",
",",
"URI",
"category",
",",
"int",
"designatorType",
")",
"{",
"if",
"(",
"!",
"STRING_ATTRIBUTE_TYPE_URI",
".",
"equals",
"(",
"type",
")",
")",
"return",... | Private helper that checks the request context for an attribute, or else returns
null | [
"Private",
"helper",
"that",
"checks",
"the",
"request",
"context",
"for",
"an",
"attribute",
"or",
"else",
"returns",
"null"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/security/impl/BasicEvaluationCtx.java#L706-L739 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/state/ConstructState.java | ConstructState.addConstructState | public void addConstructState(Constructs construct, ConstructState constructState, Optional<String> infix) {
"""
Merge a {@link ConstructState} for a child construct into this {@link ConstructState}.
<p>
Non-override property names will be mutated as follows: key -> construct.name() + infix + key
</p>
@par... | java | public void addConstructState(Constructs construct, ConstructState constructState, Optional<String> infix) {
addOverwriteProperties(constructState.getOverwritePropertiesMap());
constructState.removeProp(OVERWRITE_PROPS_KEY);
for (String key : constructState.getPropertyNames()) {
setProp(construct.nam... | [
"public",
"void",
"addConstructState",
"(",
"Constructs",
"construct",
",",
"ConstructState",
"constructState",
",",
"Optional",
"<",
"String",
">",
"infix",
")",
"{",
"addOverwriteProperties",
"(",
"constructState",
".",
"getOverwritePropertiesMap",
"(",
")",
")",
... | Merge a {@link ConstructState} for a child construct into this {@link ConstructState}.
<p>
Non-override property names will be mutated as follows: key -> construct.name() + infix + key
</p>
@param construct type of the child construct.
@param constructState {@link ConstructState} to merge.
@param infix infix added to... | [
"Merge",
"a",
"{",
"@link",
"ConstructState",
"}",
"for",
"a",
"child",
"construct",
"into",
"this",
"{",
"@link",
"ConstructState",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/state/ConstructState.java#L105-L114 |
Alluxio/alluxio | core/common/src/main/java/alluxio/cli/CommandUtils.java | CommandUtils.checkNumOfArgsEquals | public static void checkNumOfArgsEquals(Command cmd, CommandLine cl, int n) throws
InvalidArgumentException {
"""
Checks the number of non-option arguments equals n for command.
@param cmd command instance
@param cl parsed commandline arguments
@param n an integer
@throws InvalidArgumentException if th... | java | public static void checkNumOfArgsEquals(Command cmd, CommandLine cl, int n) throws
InvalidArgumentException {
if (cl.getArgs().length != n) {
throw new InvalidArgumentException(ExceptionMessage.INVALID_ARGS_NUM
.getMessage(cmd.getCommandName(), n, cl.getArgs().length));
}
} | [
"public",
"static",
"void",
"checkNumOfArgsEquals",
"(",
"Command",
"cmd",
",",
"CommandLine",
"cl",
",",
"int",
"n",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"cl",
".",
"getArgs",
"(",
")",
".",
"length",
"!=",
"n",
")",
"{",
"throw",
... | Checks the number of non-option arguments equals n for command.
@param cmd command instance
@param cl parsed commandline arguments
@param n an integer
@throws InvalidArgumentException if the number does not equal n | [
"Checks",
"the",
"number",
"of",
"non",
"-",
"option",
"arguments",
"equals",
"n",
"for",
"command",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/cli/CommandUtils.java#L68-L74 |
ModeShape/modeshape | modeshape-schematic/src/main/java/org/modeshape/schematic/DocumentFactory.java | DocumentFactory.newArray | public static EditableArray newArray( Collection<?> values ) {
"""
Create a new editable array that can be used as a new array value in other documents.
@param values the initial values for the array
@return the editable array; never null
"""
BasicArray array = new BasicArray(values.size());
... | java | public static EditableArray newArray( Collection<?> values ) {
BasicArray array = new BasicArray(values.size());
array.addAllValues(values);
return new ArrayEditor(array, DEFAULT_FACTORY);
} | [
"public",
"static",
"EditableArray",
"newArray",
"(",
"Collection",
"<",
"?",
">",
"values",
")",
"{",
"BasicArray",
"array",
"=",
"new",
"BasicArray",
"(",
"values",
".",
"size",
"(",
")",
")",
";",
"array",
".",
"addAllValues",
"(",
"values",
")",
";",... | Create a new editable array that can be used as a new array value in other documents.
@param values the initial values for the array
@return the editable array; never null | [
"Create",
"a",
"new",
"editable",
"array",
"that",
"can",
"be",
"used",
"as",
"a",
"new",
"array",
"value",
"in",
"other",
"documents",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-schematic/src/main/java/org/modeshape/schematic/DocumentFactory.java#L171-L175 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java | FactoryPointTracker.combined_ST_SURF_KLT | public static <I extends ImageGray<I>, D extends ImageGray<D>>
PointTracker<I> combined_ST_SURF_KLT(ConfigGeneralDetector configExtract,
PkltConfig kltConfig,
int reactivateThreshold,
ConfigSurfDescribe.Stability configDescribe,
ConfigSlidingIntegral configOrientation,
... | java | public static <I extends ImageGray<I>, D extends ImageGray<D>>
PointTracker<I> combined_ST_SURF_KLT(ConfigGeneralDetector configExtract,
PkltConfig kltConfig,
int reactivateThreshold,
ConfigSurfDescribe.Stability configDescribe,
ConfigSlidingIntegral configOrientation,
... | [
"public",
"static",
"<",
"I",
"extends",
"ImageGray",
"<",
"I",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"PointTracker",
"<",
"I",
">",
"combined_ST_SURF_KLT",
"(",
"ConfigGeneralDetector",
"configExtract",
",",
"PkltConfig",
"kltConfig",
","... | Creates a tracker which detects Shi-Tomasi corner features, describes them with SURF, and
nominally tracks them using KLT.
@see ShiTomasiCornerIntensity
@see DescribePointSurf
@see boofcv.abst.feature.tracker.DdaManagerDetectDescribePoint
@param configExtract Configuration for extracting features
@param kltConfig Con... | [
"Creates",
"a",
"tracker",
"which",
"detects",
"Shi",
"-",
"Tomasi",
"corner",
"features",
"describes",
"them",
"with",
"SURF",
"and",
"nominally",
"tracks",
"them",
"using",
"KLT",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/feature/tracker/FactoryPointTracker.java#L422-L455 |
b3log/latke | latke-core/src/main/java/org/b3log/latke/repository/jdbc/util/JdbcUtil.java | JdbcUtil.queryJsonObject | public static JSONObject queryJsonObject(final String sql, final List<Object> paramList, final Connection connection,
final String tableName, final boolean isDebug) throws SQLException, JSONException, RepositoryException {
"""
queryJsonObject.
@param sql sql
... | java | public static JSONObject queryJsonObject(final String sql, final List<Object> paramList, final Connection connection,
final String tableName, final boolean isDebug) throws SQLException, JSONException, RepositoryException {
return queryJson(sql, paramList, connection,... | [
"public",
"static",
"JSONObject",
"queryJsonObject",
"(",
"final",
"String",
"sql",
",",
"final",
"List",
"<",
"Object",
">",
"paramList",
",",
"final",
"Connection",
"connection",
",",
"final",
"String",
"tableName",
",",
"final",
"boolean",
"isDebug",
")",
"... | queryJsonObject.
@param sql sql
@param paramList paramList
@param connection connection
@param tableName tableName
@param isDebug the specified debug flag
@return JSONObject only one record.
@throws SQLException SQLException
@throws JSONException JSONException
@throws RepositoryException repos... | [
"queryJsonObject",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/repository/jdbc/util/JdbcUtil.java#L110-L113 |
febit/wit | wit-core/src/main/java/org/febit/wit_shaded/asm/ClassWriter.java | ClassWriter.newLong | private Item newLong(final long value) {
"""
Adds a long to the constant pool of the class being build. Does nothing if the constant pool already contains a
similar item.
@param value the long value.
@return a new or already existing long item.
"""
Item result = get(key.set(LONG, value));
... | java | private Item newLong(final long value) {
Item result = get(key.set(LONG, value));
if (result == null) {
pool.putByte(LONG).putLong(value);
result = new Item(poolIndex, key);
put(result);
poolIndex += 2;
}
return result;
} | [
"private",
"Item",
"newLong",
"(",
"final",
"long",
"value",
")",
"{",
"Item",
"result",
"=",
"get",
"(",
"key",
".",
"set",
"(",
"LONG",
",",
"value",
")",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"pool",
".",
"putByte",
"(",
"LONG... | Adds a long to the constant pool of the class being build. Does nothing if the constant pool already contains a
similar item.
@param value the long value.
@return a new or already existing long item. | [
"Adds",
"a",
"long",
"to",
"the",
"constant",
"pool",
"of",
"the",
"class",
"being",
"build",
".",
"Does",
"nothing",
"if",
"the",
"constant",
"pool",
"already",
"contains",
"a",
"similar",
"item",
"."
] | train | https://github.com/febit/wit/blob/89ee29efbc5633b79c30c3c7b953c9f4130575af/wit-core/src/main/java/org/febit/wit_shaded/asm/ClassWriter.java#L648-L657 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/flow/FlowPath.java | FlowPath.planRewind | public void planRewind(@NonNull String frameName, boolean reallyPlan) {
"""
This method announces future rewind of graph execution to specified position
@param frameName
"""
frames.get(frameName).setRewindPlanned(reallyPlan);
} | java | public void planRewind(@NonNull String frameName, boolean reallyPlan) {
frames.get(frameName).setRewindPlanned(reallyPlan);
} | [
"public",
"void",
"planRewind",
"(",
"@",
"NonNull",
"String",
"frameName",
",",
"boolean",
"reallyPlan",
")",
"{",
"frames",
".",
"get",
"(",
"frameName",
")",
".",
"setRewindPlanned",
"(",
"reallyPlan",
")",
";",
"}"
] | This method announces future rewind of graph execution to specified position
@param frameName | [
"This",
"method",
"announces",
"future",
"rewind",
"of",
"graph",
"execution",
"to",
"specified",
"position"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/flow/FlowPath.java#L177-L179 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/idemix/RevocationAuthority.java | RevocationAuthority.createCRI | public static Idemix.CredentialRevocationInformation createCRI(PrivateKey key, BIG[] unrevokedHandles, int epoch, RevocationAlgorithm alg) throws CryptoException {
"""
Creates a Credential Revocation Information object
@param key Private key
@param unrevokedHandles Array of unrevoked revocation ha... | java | public static Idemix.CredentialRevocationInformation createCRI(PrivateKey key, BIG[] unrevokedHandles, int epoch, RevocationAlgorithm alg) throws CryptoException {
Idemix.CredentialRevocationInformation.Builder builder = Idemix.CredentialRevocationInformation.newBuilder();
builder.setRevocationAlg(alg.o... | [
"public",
"static",
"Idemix",
".",
"CredentialRevocationInformation",
"createCRI",
"(",
"PrivateKey",
"key",
",",
"BIG",
"[",
"]",
"unrevokedHandles",
",",
"int",
"epoch",
",",
"RevocationAlgorithm",
"alg",
")",
"throws",
"CryptoException",
"{",
"Idemix",
".",
"Cr... | Creates a Credential Revocation Information object
@param key Private key
@param unrevokedHandles Array of unrevoked revocation handles
@param epoch The counter (representing a time window) in which this CRI is valid
@param alg Revocation algorithm
@return CredentialRevocationInfor... | [
"Creates",
"a",
"Credential",
"Revocation",
"Information",
"object"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/idemix/RevocationAuthority.java#L87-L123 |
alkacon/opencms-core | src/org/opencms/loader/CmsTemplateContextManager.java | CmsTemplateContextManager.shouldShowType | public boolean shouldShowType(String contextKey, String typeName) {
"""
Helper method to check whether a given type should not be shown in a context.<p>
@param contextKey the key of the template context
@param typeName the type name
@return true if the context does not prohibit showing the type
"""
... | java | public boolean shouldShowType(String contextKey, String typeName) {
Map<String, CmsDefaultSet<String>> allowedContextMap = safeGetAllowedContextMap();
CmsDefaultSet<String> allowedContexts = allowedContextMap.get(typeName);
if (allowedContexts == null) {
return true;
}... | [
"public",
"boolean",
"shouldShowType",
"(",
"String",
"contextKey",
",",
"String",
"typeName",
")",
"{",
"Map",
"<",
"String",
",",
"CmsDefaultSet",
"<",
"String",
">",
">",
"allowedContextMap",
"=",
"safeGetAllowedContextMap",
"(",
")",
";",
"CmsDefaultSet",
"<... | Helper method to check whether a given type should not be shown in a context.<p>
@param contextKey the key of the template context
@param typeName the type name
@return true if the context does not prohibit showing the type | [
"Helper",
"method",
"to",
"check",
"whether",
"a",
"given",
"type",
"should",
"not",
"be",
"shown",
"in",
"a",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsTemplateContextManager.java#L355-L363 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java | TldTemplateMatching.computeNccDescriptor | public void computeNccDescriptor( NccFeature f , float x0 , float y0 , float x1 , float y1 ) {
"""
Computes the NCC descriptor by sample points at evenly spaced distances inside the rectangle
"""
double mean = 0;
float widthStep = (x1-x0)/15.0f;
float heightStep = (y1-y0)/15.0f;
// compute the mean va... | java | public void computeNccDescriptor( NccFeature f , float x0 , float y0 , float x1 , float y1 ) {
double mean = 0;
float widthStep = (x1-x0)/15.0f;
float heightStep = (y1-y0)/15.0f;
// compute the mean value
int index = 0;
for( int y = 0; y < 15; y++ ) {
float sampleY = y0 + y*heightStep;
for( int x = 0... | [
"public",
"void",
"computeNccDescriptor",
"(",
"NccFeature",
"f",
",",
"float",
"x0",
",",
"float",
"y0",
",",
"float",
"x1",
",",
"float",
"y1",
")",
"{",
"double",
"mean",
"=",
"0",
";",
"float",
"widthStep",
"=",
"(",
"x1",
"-",
"x0",
")",
"/",
... | Computes the NCC descriptor by sample points at evenly spaced distances inside the rectangle | [
"Computes",
"the",
"NCC",
"descriptor",
"by",
"sample",
"points",
"at",
"evenly",
"spaced",
"distances",
"inside",
"the",
"rectangle"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTemplateMatching.java#L129-L156 |
vatbub/common | internet/src/main/java/com/github/vatbub/common/internet/Internet.java | Internet.sendEventToIFTTTMakerChannel | public static String sendEventToIFTTTMakerChannel(String IFTTTMakerChannelApiKey, String eventName, String details1)
throws IOException {
"""
Sends an event to the IFTTT Maker Channel. See
<a href="https://maker.ifttt.com/use/">https://maker.ifttt.com/use/</a>
for more information.
@param IFTTTMak... | java | public static String sendEventToIFTTTMakerChannel(String IFTTTMakerChannelApiKey, String eventName, String details1)
throws IOException {
return sendEventToIFTTTMakerChannel(IFTTTMakerChannelApiKey, eventName, details1, "");
} | [
"public",
"static",
"String",
"sendEventToIFTTTMakerChannel",
"(",
"String",
"IFTTTMakerChannelApiKey",
",",
"String",
"eventName",
",",
"String",
"details1",
")",
"throws",
"IOException",
"{",
"return",
"sendEventToIFTTTMakerChannel",
"(",
"IFTTTMakerChannelApiKey",
",",
... | Sends an event to the IFTTT Maker Channel. See
<a href="https://maker.ifttt.com/use/">https://maker.ifttt.com/use/</a>
for more information.
@param IFTTTMakerChannelApiKey Your Maker API Key. Get your one on
<a href="https://ifttt.com/maker">https://ifttt.com/maker</a>
@param eventName The name of the ev... | [
"Sends",
"an",
"event",
"to",
"the",
"IFTTT",
"Maker",
"Channel",
".",
"See",
"<a",
"href",
"=",
"https",
":",
"//",
"maker",
".",
"ifttt",
".",
"com",
"/",
"use",
"/",
">",
"https",
":",
"//",
"maker",
".",
"ifttt",
".",
"com",
"/",
"use",
"/",
... | train | https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/internet/src/main/java/com/github/vatbub/common/internet/Internet.java#L88-L91 |
BoltsFramework/Bolts-Android | bolts-tasks/src/main/java/bolts/Task.java | Task.continueWithTask | public <TContinuationResult> Task<TContinuationResult> continueWithTask(
Continuation<TResult, Task<TContinuationResult>> continuation) {
"""
Adds an asynchronous continuation to this task, returning a new task that completes after the
task returned by the continuation has completed.
"""
return cont... | java | public <TContinuationResult> Task<TContinuationResult> continueWithTask(
Continuation<TResult, Task<TContinuationResult>> continuation) {
return continueWithTask(continuation, IMMEDIATE_EXECUTOR, null);
} | [
"public",
"<",
"TContinuationResult",
">",
"Task",
"<",
"TContinuationResult",
">",
"continueWithTask",
"(",
"Continuation",
"<",
"TResult",
",",
"Task",
"<",
"TContinuationResult",
">",
">",
"continuation",
")",
"{",
"return",
"continueWithTask",
"(",
"continuation... | Adds an asynchronous continuation to this task, returning a new task that completes after the
task returned by the continuation has completed. | [
"Adds",
"an",
"asynchronous",
"continuation",
"to",
"this",
"task",
"returning",
"a",
"new",
"task",
"that",
"completes",
"after",
"the",
"task",
"returned",
"by",
"the",
"continuation",
"has",
"completed",
"."
] | train | https://github.com/BoltsFramework/Bolts-Android/blob/54e9cb8bdd4950aa4d418dcbc0ea65414762aef5/bolts-tasks/src/main/java/bolts/Task.java#L721-L724 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/key/writer/EncryptedPrivateKeyWriter.java | EncryptedPrivateKeyWriter.encryptPrivateKeyWithPassword | public static byte[] encryptPrivateKeyWithPassword(final PrivateKey privateKey,
final String password) throws NoSuchAlgorithmException, InvalidKeySpecException,
NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException,
IllegalBlockSizeException, BadPaddingException, InvalidParameterSpecExce... | java | public static byte[] encryptPrivateKeyWithPassword(final PrivateKey privateKey,
final String password) throws NoSuchAlgorithmException, InvalidKeySpecException,
NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException,
IllegalBlockSizeException, BadPaddingException, InvalidParameterSpecExce... | [
"public",
"static",
"byte",
"[",
"]",
"encryptPrivateKeyWithPassword",
"(",
"final",
"PrivateKey",
"privateKey",
",",
"final",
"String",
"password",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
",",
"NoSuchPaddingException",
",",
"InvalidKeyE... | Encrypt the given {@link PrivateKey} with the given password and return the resulted byte
array.
@param privateKey
the private key to encrypt
@param password
the password
@return the byte[]
@throws NoSuchAlgorithmException
is thrown if instantiation of the SecretKeyFactory object fails.
@throws InvalidKeySpecException... | [
"Encrypt",
"the",
"given",
"{",
"@link",
"PrivateKey",
"}",
"with",
"the",
"given",
"password",
"and",
"return",
"the",
"resulted",
"byte",
"array",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/key/writer/EncryptedPrivateKeyWriter.java#L92-L122 |
threerings/nenya | tools/src/main/java/com/threerings/media/tile/tools/MapFileTileSetIDBroker.java | MapFileTileSetIDBroker.writeMapFile | public static void writeMapFile (BufferedWriter bout, HashMap<String, Integer> map)
throws IOException {
"""
Writes out a mapping from strings to integers in a manner that can
be read back in via {@link #readMapFile}.
"""
String[] lines = new String[map.size()];
Iterator<String> iter =... | java | public static void writeMapFile (BufferedWriter bout, HashMap<String, Integer> map)
throws IOException
{
String[] lines = new String[map.size()];
Iterator<String> iter = map.keySet().iterator();
for (int ii = 0; iter.hasNext(); ii++) {
String key = iter.next();
... | [
"public",
"static",
"void",
"writeMapFile",
"(",
"BufferedWriter",
"bout",
",",
"HashMap",
"<",
"String",
",",
"Integer",
">",
"map",
")",
"throws",
"IOException",
"{",
"String",
"[",
"]",
"lines",
"=",
"new",
"String",
"[",
"map",
".",
"size",
"(",
")",... | Writes out a mapping from strings to integers in a manner that can
be read back in via {@link #readMapFile}. | [
"Writes",
"out",
"a",
"mapping",
"from",
"strings",
"to",
"integers",
"in",
"a",
"manner",
"that",
"can",
"be",
"read",
"back",
"in",
"via",
"{"
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/media/tile/tools/MapFileTileSetIDBroker.java#L162-L178 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java | ODataRendererUtils.checkNotNull | public static <T> T checkNotNull(T reference, String message, Object... args) {
"""
Check if the reference is not null.
This differs from Guava that throws Illegal Argument Exception + message.
@param reference reference
@param message error message
@param args arguments
@param <T> type
@retur... | java | public static <T> T checkNotNull(T reference, String message, Object... args) {
if (reference == null) {
throw new IllegalArgumentException(String.format(message, args));
}
return reference;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"checkNotNull",
"(",
"T",
"reference",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"reference",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".... | Check if the reference is not null.
This differs from Guava that throws Illegal Argument Exception + message.
@param reference reference
@param message error message
@param args arguments
@param <T> type
@return reference or exception | [
"Check",
"if",
"the",
"reference",
"is",
"not",
"null",
".",
"This",
"differs",
"from",
"Guava",
"that",
"throws",
"Illegal",
"Argument",
"Exception",
"+",
"message",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java#L122-L127 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheOnDisk.java | CacheOnDisk.updateExpirationTime | public int updateExpirationTime(Object id, long oldExpirationTime, int size, long newExpirationTime, long newValidatorExpirationTime) {
"""
This method is used to update expiration times in GC and disk emtry header
"""
int returnCode = this.htod.updateExpirationTime(id, oldExpirationTime, size, newExpi... | java | public int updateExpirationTime(Object id, long oldExpirationTime, int size, long newExpirationTime, long newValidatorExpirationTime) {
int returnCode = this.htod.updateExpirationTime(id, oldExpirationTime, size, newExpirationTime, newValidatorExpirationTime);
if (returnCode == HTODDynacache.DISK_EXCEPT... | [
"public",
"int",
"updateExpirationTime",
"(",
"Object",
"id",
",",
"long",
"oldExpirationTime",
",",
"int",
"size",
",",
"long",
"newExpirationTime",
",",
"long",
"newValidatorExpirationTime",
")",
"{",
"int",
"returnCode",
"=",
"this",
".",
"htod",
".",
"update... | This method is used to update expiration times in GC and disk emtry header | [
"This",
"method",
"is",
"used",
"to",
"update",
"expiration",
"times",
"in",
"GC",
"and",
"disk",
"emtry",
"header"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheOnDisk.java#L1742-L1748 |
Wikidata/Wikidata-Toolkit | wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/implementation/ItemIdValueImpl.java | ItemIdValueImpl.fromIri | static ItemIdValueImpl fromIri(String iri) {
"""
Parses an item IRI
@param iri
the item IRI like http://www.wikidata.org/entity/Q42
@throws IllegalArgumentException
if the IRI is invalid or does not ends with an item id
"""
int separator = iri.lastIndexOf('/') + 1;
try {
return new ItemIdValueImpl... | java | static ItemIdValueImpl fromIri(String iri) {
int separator = iri.lastIndexOf('/') + 1;
try {
return new ItemIdValueImpl(iri.substring(separator), iri.substring(0, separator));
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Invalid Wikibase entity IRI: " + iri, e);
}
} | [
"static",
"ItemIdValueImpl",
"fromIri",
"(",
"String",
"iri",
")",
"{",
"int",
"separator",
"=",
"iri",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
"+",
"1",
";",
"try",
"{",
"return",
"new",
"ItemIdValueImpl",
"(",
"iri",
".",
"substring",
"(",
"separator",... | Parses an item IRI
@param iri
the item IRI like http://www.wikidata.org/entity/Q42
@throws IllegalArgumentException
if the IRI is invalid or does not ends with an item id | [
"Parses",
"an",
"item",
"IRI"
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/implementation/ItemIdValueImpl.java#L67-L74 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBApplicationMetaData.java | EJBApplicationMetaData.addSingleton | public void addSingleton(BeanMetaData bmd, boolean startup, Set<String> dependsOnLinks) {
"""
Adds a singleton bean belonging to this application.
@param bmd
the bean metadata
@param startup
true if this is a startup singleton bean
@param dependsOnLinks
list of dependency EJB links
"""
if (Trac... | java | public void addSingleton(BeanMetaData bmd, boolean startup, Set<String> dependsOnLinks) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "addSingleton: " + bmd.j2eeName + " (startup=" + startup + ", dependsOn=" + (dependsOnLinks != null) + ")");
if (startup) {... | [
"public",
"void",
"addSingleton",
"(",
"BeanMetaData",
"bmd",
",",
"boolean",
"startup",
",",
"Set",
"<",
"String",
">",
"dependsOnLinks",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")... | Adds a singleton bean belonging to this application.
@param bmd
the bean metadata
@param startup
true if this is a startup singleton bean
@param dependsOnLinks
list of dependency EJB links | [
"Adds",
"a",
"singleton",
"bean",
"belonging",
"to",
"this",
"application",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBApplicationMetaData.java#L408-L425 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java | StreamSegmentReadIndex.getReadAlignedLength | private int getReadAlignedLength(long offset, int readLength) {
"""
Returns an adjusted read length based on the given input, making sure the end of the Read Request is aligned with
a multiple of STORAGE_READ_MAX_LEN.
@param offset The read offset.
@param readLength The requested read length.
@return The... | java | private int getReadAlignedLength(long offset, int readLength) {
// Calculate how many bytes over the last alignment marker the offset is.
int lengthSinceLastMultiple = (int) (offset % this.config.getStorageReadAlignment());
// Even though we were asked to read a number of bytes, in some cases w... | [
"private",
"int",
"getReadAlignedLength",
"(",
"long",
"offset",
",",
"int",
"readLength",
")",
"{",
"// Calculate how many bytes over the last alignment marker the offset is.",
"int",
"lengthSinceLastMultiple",
"=",
"(",
"int",
")",
"(",
"offset",
"%",
"this",
".",
"co... | Returns an adjusted read length based on the given input, making sure the end of the Read Request is aligned with
a multiple of STORAGE_READ_MAX_LEN.
@param offset The read offset.
@param readLength The requested read length.
@return The adjusted (aligned) read length. | [
"Returns",
"an",
"adjusted",
"read",
"length",
"based",
"on",
"the",
"given",
"input",
"making",
"sure",
"the",
"end",
"of",
"the",
"Read",
"Request",
"is",
"aligned",
"with",
"a",
"multiple",
"of",
"STORAGE_READ_MAX_LEN",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L1027-L1034 |
mfornos/humanize | humanize-slim/src/main/java/humanize/Humanize.java | Humanize.naturalDay | @Expose
public static String naturalDay(Date then, Locale locale) {
"""
Same as {@link #naturalDay(Date)} with the given locale.
@param then
The date
@param locale
Target locale
@return String with 'today', 'tomorrow' or 'yesterday' compared to
current day. Otherwise, returns a string formatted accordi... | java | @Expose
public static String naturalDay(Date then, Locale locale)
{
return naturalDay(DateFormat.SHORT, then, locale);
} | [
"@",
"Expose",
"public",
"static",
"String",
"naturalDay",
"(",
"Date",
"then",
",",
"Locale",
"locale",
")",
"{",
"return",
"naturalDay",
"(",
"DateFormat",
".",
"SHORT",
",",
"then",
",",
"locale",
")",
";",
"}"
] | Same as {@link #naturalDay(Date)} with the given locale.
@param then
The date
@param locale
Target locale
@return String with 'today', 'tomorrow' or 'yesterday' compared to
current day. Otherwise, returns a string formatted according to a
locale sensitive DateFormat. | [
"Same",
"as",
"{",
"@link",
"#naturalDay",
"(",
"Date",
")",
"}",
"with",
"the",
"given",
"locale",
"."
] | train | https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-slim/src/main/java/humanize/Humanize.java#L1473-L1477 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/comparator/ComparatorChain.java | ComparatorChain.compare | @Override
public int compare(final E o1, final E o2) throws UnsupportedOperationException {
"""
执行比较<br>
按照比较器链的顺序分别比较,如果比较出相等则转向下一个比较器,否则直接返回
@param o1 第一个对象
@param o2 第二个对象
@return -1, 0, or 1
@throws UnsupportedOperationException 如果比较器链为空,无法完成比较
"""
if (lock == false) {
checkChainIntegrity()... | java | @Override
public int compare(final E o1, final E o2) throws UnsupportedOperationException {
if (lock == false) {
checkChainIntegrity();
lock = true;
}
final Iterator<Comparator<E>> comparators = chain.iterator();
Comparator<? super E> comparator;
int retval;
for (int comparatorIndex = 0;... | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"final",
"E",
"o1",
",",
"final",
"E",
"o2",
")",
"throws",
"UnsupportedOperationException",
"{",
"if",
"(",
"lock",
"==",
"false",
")",
"{",
"checkChainIntegrity",
"(",
")",
";",
"lock",
"=",
"true",
";"... | 执行比较<br>
按照比较器链的顺序分别比较,如果比较出相等则转向下一个比较器,否则直接返回
@param o1 第一个对象
@param o2 第二个对象
@return -1, 0, or 1
@throws UnsupportedOperationException 如果比较器链为空,无法完成比较 | [
"执行比较<br",
">",
"按照比较器链的顺序分别比较,如果比较出相等则转向下一个比较器,否则直接返回"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/comparator/ComparatorChain.java#L203-L227 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/LocalMapStatsProvider.java | LocalMapStatsProvider.finalizeFreshIndexStats | private static void finalizeFreshIndexStats(Map<String, OnDemandIndexStats> freshStats) {
"""
Finalizes the aggregation of the freshly obtained on-demand index
statistics by computing the final average values which are accumulated
as total sums in {@link #aggregateFreshIndexStats}.
@param freshStats the fresh... | java | private static void finalizeFreshIndexStats(Map<String, OnDemandIndexStats> freshStats) {
if (freshStats == null) {
return;
}
for (OnDemandIndexStats freshIndexStats : freshStats.values()) {
long totalHitCount = freshIndexStats.getTotalHitCount();
if (totalHi... | [
"private",
"static",
"void",
"finalizeFreshIndexStats",
"(",
"Map",
"<",
"String",
",",
"OnDemandIndexStats",
">",
"freshStats",
")",
"{",
"if",
"(",
"freshStats",
"==",
"null",
")",
"{",
"return",
";",
"}",
"for",
"(",
"OnDemandIndexStats",
"freshIndexStats",
... | Finalizes the aggregation of the freshly obtained on-demand index
statistics by computing the final average values which are accumulated
as total sums in {@link #aggregateFreshIndexStats}.
@param freshStats the fresh stats to finalize, can be {@code null} if no
stats was produced during the aggregation. | [
"Finalizes",
"the",
"aggregation",
"of",
"the",
"freshly",
"obtained",
"on",
"-",
"demand",
"index",
"statistics",
"by",
"computing",
"the",
"final",
"average",
"values",
"which",
"are",
"accumulated",
"as",
"total",
"sums",
"in",
"{",
"@link",
"#aggregateFreshI... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/LocalMapStatsProvider.java#L413-L427 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java | DocFile.copyFile | public void copyFile(DocFile fromFile) throws DocFileIOException {
"""
Copy the contents of another file directly to this file.
@param fromFile the file to be copied
@throws DocFileIOException if there is a problem file copying the file
"""
try (OutputStream output = openOutputStream()) {
... | java | public void copyFile(DocFile fromFile) throws DocFileIOException {
try (OutputStream output = openOutputStream()) {
try (InputStream input = fromFile.openInputStream()) {
byte[] bytearr = new byte[1024];
int len;
while ((len = read(fromFile, input, byt... | [
"public",
"void",
"copyFile",
"(",
"DocFile",
"fromFile",
")",
"throws",
"DocFileIOException",
"{",
"try",
"(",
"OutputStream",
"output",
"=",
"openOutputStream",
"(",
")",
")",
"{",
"try",
"(",
"InputStream",
"input",
"=",
"fromFile",
".",
"openInputStream",
... | Copy the contents of another file directly to this file.
@param fromFile the file to be copied
@throws DocFileIOException if there is a problem file copying the file | [
"Copy",
"the",
"contents",
"of",
"another",
"file",
"directly",
"to",
"this",
"file",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java#L142-L156 |
stapler/stapler | core/src/main/java/org/kohsuke/stapler/Stapler.java | Stapler.invoke | public void invoke(HttpServletRequest req, HttpServletResponse rsp, Object root, String url) throws IOException, ServletException {
"""
Performs stapler processing on the given root object and request URL.
"""
RequestImpl sreq = new RequestImpl(this, req, new ArrayList<AncestorImpl>(), new TokenList(ur... | java | public void invoke(HttpServletRequest req, HttpServletResponse rsp, Object root, String url) throws IOException, ServletException {
RequestImpl sreq = new RequestImpl(this, req, new ArrayList<AncestorImpl>(), new TokenList(url));
RequestImpl oreq = CURRENT_REQUEST.get();
CURRENT_REQUEST.set(sreq... | [
"public",
"void",
"invoke",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"rsp",
",",
"Object",
"root",
",",
"String",
"url",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"RequestImpl",
"sreq",
"=",
"new",
"RequestImpl",
"(",
"this... | Performs stapler processing on the given root object and request URL. | [
"Performs",
"stapler",
"processing",
"on",
"the",
"given",
"root",
"object",
"and",
"request",
"URL",
"."
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/core/src/main/java/org/kohsuke/stapler/Stapler.java#L666-L681 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzleResultSet.java | DrizzleResultSet.getTime | public Time getTime(final int columnIndex, final Calendar cal) throws SQLException {
"""
Retrieves the value of the designated column in the current row of this <code>ResultSet</code> object as a
<code>java.sql.Time</code> object in the Java programming language. This method uses the given calendar to
construct ... | java | public Time getTime(final int columnIndex, final Calendar cal) throws SQLException {
return getValueObject(columnIndex).getTime(cal);
} | [
"public",
"Time",
"getTime",
"(",
"final",
"int",
"columnIndex",
",",
"final",
"Calendar",
"cal",
")",
"throws",
"SQLException",
"{",
"return",
"getValueObject",
"(",
"columnIndex",
")",
".",
"getTime",
"(",
"cal",
")",
";",
"}"
] | Retrieves the value of the designated column in the current row of this <code>ResultSet</code> object as a
<code>java.sql.Time</code> object in the Java programming language. This method uses the given calendar to
construct an appropriate millisecond value for the time if the underlying database does not store timezone... | [
"Retrieves",
"the",
"value",
"of",
"the",
"designated",
"column",
"in",
"the",
"current",
"row",
"of",
"this",
"<code",
">",
"ResultSet<",
"/",
"code",
">",
"object",
"as",
"a",
"<code",
">",
"java",
".",
"sql",
".",
"Time<",
"/",
"code",
">",
"object"... | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleResultSet.java#L2123-L2125 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/compiler/FaceletsCompilerSupport.java | FaceletsCompilerSupport.loadDecorators | public void loadDecorators(FacesContext context, Compiler compiler) {
"""
Load the various decorators for Facelets.
@param context
the current FacesContext
@param compiler
the page compiler
"""
String param = WebConfigParamUtils.getStringInitParameter(context.getExternalContext(), PARAMS_DECORATO... | java | public void loadDecorators(FacesContext context, Compiler compiler)
{
String param = WebConfigParamUtils.getStringInitParameter(context.getExternalContext(), PARAMS_DECORATORS);
if (param != null)
{
for (String decorator : param.split(";"))
{
try
... | [
"public",
"void",
"loadDecorators",
"(",
"FacesContext",
"context",
",",
"Compiler",
"compiler",
")",
"{",
"String",
"param",
"=",
"WebConfigParamUtils",
".",
"getStringInitParameter",
"(",
"context",
".",
"getExternalContext",
"(",
")",
",",
"PARAMS_DECORATORS",
")... | Load the various decorators for Facelets.
@param context
the current FacesContext
@param compiler
the page compiler | [
"Load",
"the",
"various",
"decorators",
"for",
"Facelets",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/compiler/FaceletsCompilerSupport.java#L173-L194 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/util/SecretDetector.java | SecretDetector.getAWSSecretPos | private static List<SecretRange> getAWSSecretPos(String text) {
"""
Find all the positions of aws key id and aws secret key.
The time complexity is O(n)
@param text the sql text which may contain aws key
@return Return a list of begin/end positions of aws key id and
aws secret key.
"""
// log before ... | java | private static List<SecretRange> getAWSSecretPos(String text)
{
// log before and after in case this is causing StackOverflowError
LOGGER.debug("pre-regex getAWSSecretPos");
Matcher matcher = AWS_KEY_PATTERN.matcher(text);
ArrayList<SecretRange> awsSecretRanges = new ArrayList<>();
while (match... | [
"private",
"static",
"List",
"<",
"SecretRange",
">",
"getAWSSecretPos",
"(",
"String",
"text",
")",
"{",
"// log before and after in case this is causing StackOverflowError",
"LOGGER",
".",
"debug",
"(",
"\"pre-regex getAWSSecretPos\"",
")",
";",
"Matcher",
"matcher",
"=... | Find all the positions of aws key id and aws secret key.
The time complexity is O(n)
@param text the sql text which may contain aws key
@return Return a list of begin/end positions of aws key id and
aws secret key. | [
"Find",
"all",
"the",
"positions",
"of",
"aws",
"key",
"id",
"and",
"aws",
"secret",
"key",
".",
"The",
"time",
"complexity",
"is",
"O",
"(",
"n",
")"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/util/SecretDetector.java#L55-L91 |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/DitaWriterFilter.java | DitaWriterFilter.getAttributeValue | private String getAttributeValue(final String elemQName, final QName attQName, final String value) {
"""
Get attribute value or default if attribute is not defined
@param elemQName element QName
@param attQName attribute QName
@param value attribute value
@return attribute value or default
"""
if... | java | private String getAttributeValue(final String elemQName, final QName attQName, final String value) {
if (StringUtils.isEmptyString(value) && !defaultValueMap.isEmpty()) {
final Map<String, String> defaultMap = defaultValueMap.get(attQName);
if (defaultMap != null) {
final... | [
"private",
"String",
"getAttributeValue",
"(",
"final",
"String",
"elemQName",
",",
"final",
"QName",
"attQName",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmptyString",
"(",
"value",
")",
"&&",
"!",
"defaultValueMap",
".",
... | Get attribute value or default if attribute is not defined
@param elemQName element QName
@param attQName attribute QName
@param value attribute value
@return attribute value or default | [
"Get",
"attribute",
"value",
"or",
"default",
"if",
"attribute",
"is",
"not",
"defined"
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/DitaWriterFilter.java#L180-L191 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/cemi/CEMILDataEx.java | CEMILDataEx.getAdditionalInfo | public synchronized List getAdditionalInfo() {
"""
Returns all additional information currently set.
<p>
@return a List with {@link AddInfo} objects
"""
final List l = new ArrayList();
for (int i = 0; i < addInfo.length; ++i)
if (addInfo[i] != null)
l.add(new AddInfo(i, (byte[]) addInfo[i].c... | java | public synchronized List getAdditionalInfo()
{
final List l = new ArrayList();
for (int i = 0; i < addInfo.length; ++i)
if (addInfo[i] != null)
l.add(new AddInfo(i, (byte[]) addInfo[i].clone()));
return l;
} | [
"public",
"synchronized",
"List",
"getAdditionalInfo",
"(",
")",
"{",
"final",
"List",
"l",
"=",
"new",
"ArrayList",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"addInfo",
".",
"length",
";",
"++",
"i",
")",
"if",
"(",
"addInfo"... | Returns all additional information currently set.
<p>
@return a List with {@link AddInfo} objects | [
"Returns",
"all",
"additional",
"information",
"currently",
"set",
".",
"<p",
">"
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/cemi/CEMILDataEx.java#L342-L349 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cdndedicated/src/main/java/net/minidev/ovh/api/ApiOvhCdndedicated.java | ApiOvhCdndedicated.pops_name_GET | public OvhPop pops_name_GET(String name) throws IOException {
"""
Get this object properties
REST: GET /cdn/dedicated/pops/{name}
@param name [required] Name of the pop
"""
String qPath = "/cdn/dedicated/pops/{name}";
StringBuilder sb = path(qPath, name);
String resp = execN(qPath, "GET", sb.toString... | java | public OvhPop pops_name_GET(String name) throws IOException {
String qPath = "/cdn/dedicated/pops/{name}";
StringBuilder sb = path(qPath, name);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPop.class);
} | [
"public",
"OvhPop",
"pops_name_GET",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cdn/dedicated/pops/{name}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"name",
")",
";",
"String",
"resp",
"=",
"execN... | Get this object properties
REST: GET /cdn/dedicated/pops/{name}
@param name [required] Name of the pop | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cdndedicated/src/main/java/net/minidev/ovh/api/ApiOvhCdndedicated.java#L56-L61 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/jsonrpc/JsonRpcUtils.java | JsonRpcUtils.callHttpGet | public static RequestResponse callHttpGet(String url, Map<String, Object> headers,
Map<String, Object> urlParams) {
"""
Perform a HTTP GET request.
@param url
@param headers
@param urlParams
@return
"""
return callHttpGet(httpJsonRpcClient, url, headers, urlParams);
} | java | public static RequestResponse callHttpGet(String url, Map<String, Object> headers,
Map<String, Object> urlParams) {
return callHttpGet(httpJsonRpcClient, url, headers, urlParams);
} | [
"public",
"static",
"RequestResponse",
"callHttpGet",
"(",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"urlParams",
")",
"{",
"return",
"callHttpGet",
"(",
"httpJsonRpcClient",
","... | Perform a HTTP GET request.
@param url
@param headers
@param urlParams
@return | [
"Perform",
"a",
"HTTP",
"GET",
"request",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/jsonrpc/JsonRpcUtils.java#L90-L93 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/GV/generators/PainGeneratorFactory.java | PainGeneratorFactory.get | public static PainGeneratorIf get(AbstractHBCIJob job, SepaVersion version) throws ClassNotFoundException,
InstantiationException, IllegalAccessException {
"""
Gibt den passenden SEPA Generator für die angegebene PAIN-Version.
@param job der zu erzeugende Job.
@param version die PAIN-Version.
@ret... | java | public static PainGeneratorIf get(AbstractHBCIJob job, SepaVersion version) throws ClassNotFoundException,
InstantiationException, IllegalAccessException {
String jobname = ((AbstractSEPAGV) job).getPainJobName(); // referenzierter pain-Geschäftsvorfall
return get(jobname, version);
} | [
"public",
"static",
"PainGeneratorIf",
"get",
"(",
"AbstractHBCIJob",
"job",
",",
"SepaVersion",
"version",
")",
"throws",
"ClassNotFoundException",
",",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"String",
"jobname",
"=",
"(",
"(",
"AbstractSEPAGV",
... | Gibt den passenden SEPA Generator für die angegebene PAIN-Version.
@param job der zu erzeugende Job.
@param version die PAIN-Version.
@return ISEPAGenerator
@throws IllegalAccessException
@throws InstantiationException
@throws ClassNotFoundException | [
"Gibt",
"den",
"passenden",
"SEPA",
"Generator",
"für",
"die",
"angegebene",
"PAIN",
"-",
"Version",
"."
] | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/generators/PainGeneratorFactory.java#L31-L35 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEConfigurationSequence.java | CmsADEConfigurationSequence.getParent | public Optional<CmsADEConfigurationSequence> getParent() {
"""
Returns a sequence which only differs from this instance in that its index is one less.<p>
However, if the index of this instance is already 0, Optional.absent will be returned.
@return the parent sequence, or Optional.absent if we are already at... | java | public Optional<CmsADEConfigurationSequence> getParent() {
if (m_configIndex <= 0) {
return Optional.absent();
}
return Optional.fromNullable(new CmsADEConfigurationSequence(m_configDatas, m_configIndex - 1));
} | [
"public",
"Optional",
"<",
"CmsADEConfigurationSequence",
">",
"getParent",
"(",
")",
"{",
"if",
"(",
"m_configIndex",
"<=",
"0",
")",
"{",
"return",
"Optional",
".",
"absent",
"(",
")",
";",
"}",
"return",
"Optional",
".",
"fromNullable",
"(",
"new",
"Cms... | Returns a sequence which only differs from this instance in that its index is one less.<p>
However, if the index of this instance is already 0, Optional.absent will be returned.
@return the parent sequence, or Optional.absent if we are already at the start of the sequence | [
"Returns",
"a",
"sequence",
"which",
"only",
"differs",
"from",
"this",
"instance",
"in",
"that",
"its",
"index",
"is",
"one",
"less",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEConfigurationSequence.java#L89-L95 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicated_server_serviceName_ipMigration_duration_GET | public OvhOrder dedicated_server_serviceName_ipMigration_duration_GET(String serviceName, String duration, String ip, String token) throws IOException {
"""
Get prices and contracts information
REST: GET /order/dedicated/server/{serviceName}/ipMigration/{duration}
@param ip [required] The IP to move to this se... | java | public OvhOrder dedicated_server_serviceName_ipMigration_duration_GET(String serviceName, String duration, String ip, String token) throws IOException {
String qPath = "/order/dedicated/server/{serviceName}/ipMigration/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "ip", ip);
quer... | [
"public",
"OvhOrder",
"dedicated_server_serviceName_ipMigration_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"String",
"ip",
",",
"String",
"token",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/dedicated/server/{serv... | Get prices and contracts information
REST: GET /order/dedicated/server/{serviceName}/ipMigration/{duration}
@param ip [required] The IP to move to this server
@param token [required] IP migration token
@param serviceName [required] The internal name of your dedicated server
@param duration [required] Duration | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2572-L2579 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionPoliciesInner.java | BackupLongTermRetentionPoliciesInner.createOrUpdate | public BackupLongTermRetentionPolicyInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, BackupLongTermRetentionPolicyInner parameters) {
"""
Creates or updates a database backup long term retention policy.
@param resourceGroupName The name of the resource group that contains t... | java | public BackupLongTermRetentionPolicyInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, BackupLongTermRetentionPolicyInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().last().body();
} | [
"public",
"BackupLongTermRetentionPolicyInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"BackupLongTermRetentionPolicyInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",... | Creates or updates a database backup long term retention policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database
@param... | [
"Creates",
"or",
"updates",
"a",
"database",
"backup",
"long",
"term",
"retention",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionPoliciesInner.java#L182-L184 |
chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/IntervalST.java | IntervalST.put | public void put(Interval1D<K> interval, V value) {
"""
Insert a new node in the tree. If the tree contained that interval already, the value is
replaced.
"""
Node<K, V> origNode = get(interval);
if (origNode != null) {
//System.err.println("Dupe is being put into the map. Interval: " + interval ... | java | public void put(Interval1D<K> interval, V value) {
Node<K, V> origNode = get(interval);
if (origNode != null) {
//System.err.println("Dupe is being put into the map. Interval: " + interval +
// "\n\tOld: " + origNode.getValue() + " New: " + value);
origNode.setValue(value);
} else {... | [
"public",
"void",
"put",
"(",
"Interval1D",
"<",
"K",
">",
"interval",
",",
"V",
"value",
")",
"{",
"Node",
"<",
"K",
",",
"V",
">",
"origNode",
"=",
"get",
"(",
"interval",
")",
";",
"if",
"(",
"origNode",
"!=",
"null",
")",
"{",
"//System.err.pri... | Insert a new node in the tree. If the tree contained that interval already, the value is
replaced. | [
"Insert",
"a",
"new",
"node",
"in",
"the",
"tree",
".",
"If",
"the",
"tree",
"contained",
"that",
"interval",
"already",
"the",
"value",
"is",
"replaced",
"."
] | train | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/IntervalST.java#L269-L278 |
j256/ormlite-core | src/main/java/com/j256/ormlite/misc/TransactionManager.java | TransactionManager.callInTransaction | public static <T> T callInTransaction(final DatabaseConnection connection, final DatabaseType databaseType,
final Callable<T> callable) throws SQLException {
"""
Same as {@link #callInTransaction(Callable)} except as a static method on a connection with database-type.
<p>
WARNING: it is up to you to properl... | java | public static <T> T callInTransaction(final DatabaseConnection connection, final DatabaseType databaseType,
final Callable<T> callable) throws SQLException {
return callInTransaction(connection, false, databaseType, callable);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"callInTransaction",
"(",
"final",
"DatabaseConnection",
"connection",
",",
"final",
"DatabaseType",
"databaseType",
",",
"final",
"Callable",
"<",
"T",
">",
"callable",
")",
"throws",
"SQLException",
"{",
"return",
"callI... | Same as {@link #callInTransaction(Callable)} except as a static method on a connection with database-type.
<p>
WARNING: it is up to you to properly synchronize around this method if multiple threads are using the same
database connection or if your connection-source is single-connection. The reason why this is necessa... | [
"Same",
"as",
"{",
"@link",
"#callInTransaction",
"(",
"Callable",
")",
"}",
"except",
"as",
"a",
"static",
"method",
"on",
"a",
"connection",
"with",
"database",
"-",
"type",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/misc/TransactionManager.java#L195-L198 |
crnk-project/crnk-framework | crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaModule.java | JpaModule.createServerModule | public static JpaModule createServerModule(JpaModuleConfig config, EntityManager em, TransactionRunner transactionRunner) {
"""
Creates a new JpaModule for a Crnk server. No entities are by
default exposed as JSON API resources. Make use of
{@link #addRepository(JpaRepositoryConfig)} to add resources.
@param ... | java | public static JpaModule createServerModule(JpaModuleConfig config, EntityManager em, TransactionRunner transactionRunner) {
return createServerModule(config, () -> em, transactionRunner);
} | [
"public",
"static",
"JpaModule",
"createServerModule",
"(",
"JpaModuleConfig",
"config",
",",
"EntityManager",
"em",
",",
"TransactionRunner",
"transactionRunner",
")",
"{",
"return",
"createServerModule",
"(",
"config",
",",
"(",
")",
"->",
"em",
",",
"transactionR... | Creates a new JpaModule for a Crnk server. No entities are by
default exposed as JSON API resources. Make use of
{@link #addRepository(JpaRepositoryConfig)} to add resources.
@param em to use
@param transactionRunner to use
@return created module | [
"Creates",
"a",
"new",
"JpaModule",
"for",
"a",
"Crnk",
"server",
".",
"No",
"entities",
"are",
"by",
"default",
"exposed",
"as",
"JSON",
"API",
"resources",
".",
"Make",
"use",
"of",
"{",
"@link",
"#addRepository",
"(",
"JpaRepositoryConfig",
")",
"}",
"t... | train | https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaModule.java#L185-L187 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java | SDMath.asum | public SDVariable asum(String name, SDVariable in, int... dimensions) {
"""
Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))
@param name Name of the output variable
@param in Input variable
@param dimensions Dimensions to reduce over. If dimensions... | java | public SDVariable asum(String name, SDVariable in, int... dimensions) {
validateNumerical("asum", in);
SDVariable ret = f().asum(in, dimensions);
return updateVariableNameAndReference(ret, name);
} | [
"public",
"SDVariable",
"asum",
"(",
"String",
"name",
",",
"SDVariable",
"in",
",",
"int",
"...",
"dimensions",
")",
"{",
"validateNumerical",
"(",
"\"asum\"",
",",
"in",
")",
";",
"SDVariable",
"ret",
"=",
"f",
"(",
")",
".",
"asum",
"(",
"in",
",",
... | Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))
@param name Name of the output variable
@param in Input variable
@param dimensions Dimensions to reduce over. If dimensions are not specified, full array reduction is performed
@return Reduced array of rank (... | [
"Absolute",
"sum",
"array",
"reduction",
"operation",
"optionally",
"along",
"specified",
"dimensions",
":",
"out",
"=",
"sum",
"(",
"abs",
"(",
"x",
"))"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L270-L274 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGate.java | SingleInputGate.assignExclusiveSegments | public void assignExclusiveSegments(NetworkBufferPool networkBufferPool, int networkBuffersPerChannel) throws IOException {
"""
Assign the exclusive buffers to all remote input channels directly for credit-based mode.
@param networkBufferPool The global pool to request and recycle exclusive buffers
@param netw... | java | public void assignExclusiveSegments(NetworkBufferPool networkBufferPool, int networkBuffersPerChannel) throws IOException {
checkState(this.isCreditBased, "Bug in input gate setup logic: exclusive buffers only exist with credit-based flow control.");
checkState(this.networkBufferPool == null, "Bug in input gate set... | [
"public",
"void",
"assignExclusiveSegments",
"(",
"NetworkBufferPool",
"networkBufferPool",
",",
"int",
"networkBuffersPerChannel",
")",
"throws",
"IOException",
"{",
"checkState",
"(",
"this",
".",
"isCreditBased",
",",
"\"Bug in input gate setup logic: exclusive buffers only ... | Assign the exclusive buffers to all remote input channels directly for credit-based mode.
@param networkBufferPool The global pool to request and recycle exclusive buffers
@param networkBuffersPerChannel The number of exclusive buffers for each channel | [
"Assign",
"the",
"exclusive",
"buffers",
"to",
"all",
"remote",
"input",
"channels",
"directly",
"for",
"credit",
"-",
"based",
"mode",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGate.java#L305-L321 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseBlock | private Stmt.Block parseBlock(EnclosingScope scope, boolean isLoop) {
"""
Parse a block of zero or more statements which share the same indentation
level. Their indentation level must be strictly greater than that of
their parent, otherwise the end of block is signaled. The <i>indentation
level</i> for the bloc... | java | private Stmt.Block parseBlock(EnclosingScope scope, boolean isLoop) {
// First, determine the initial indentation of this block based on the
// first statement (or null if there is no statement).
Indent indent = getIndent();
// We must clone the environment here, in order to ensure variables
// declared withi... | [
"private",
"Stmt",
".",
"Block",
"parseBlock",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"isLoop",
")",
"{",
"// First, determine the initial indentation of this block based on the",
"// first statement (or null if there is no statement).",
"Indent",
"indent",
"=",
"getInde... | Parse a block of zero or more statements which share the same indentation
level. Their indentation level must be strictly greater than that of
their parent, otherwise the end of block is signaled. The <i>indentation
level</i> for the block is set by the first statement encountered
(assuming their is one). An error occu... | [
"Parse",
"a",
"block",
"of",
"zero",
"or",
"more",
"statements",
"which",
"share",
"the",
"same",
"indentation",
"level",
".",
"Their",
"indentation",
"level",
"must",
"be",
"strictly",
"greater",
"than",
"that",
"of",
"their",
"parent",
"otherwise",
"the",
... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L628-L663 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.setPerspectiveLH | public Matrix4f setPerspectiveLH(float fovy, float aspect, float zNear, float zFar, boolean zZeroToOne) {
"""
Set this matrix to be a symmetric perspective projection frustum transformation for a left-handed coordinate system
using the given NDC z range of <code>[-1..+1]</code>.
<p>
In order to apply the perspe... | java | public Matrix4f setPerspectiveLH(float fovy, float aspect, float zNear, float zFar, boolean zZeroToOne) {
MemUtil.INSTANCE.zero(this);
float h = (float) Math.tan(fovy * 0.5f);
this._m00(1.0f / (h * aspect));
this._m11(1.0f / h);
boolean farInf = zFar > 0 && Float.isInfinite(zFar)... | [
"public",
"Matrix4f",
"setPerspectiveLH",
"(",
"float",
"fovy",
",",
"float",
"aspect",
",",
"float",
"zNear",
",",
"float",
"zFar",
",",
"boolean",
"zZeroToOne",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"zero",
"(",
"this",
")",
";",
"float",
"h",
"="... | Set this matrix to be a symmetric perspective projection frustum transformation for a left-handed coordinate system
using the given NDC z range of <code>[-1..+1]</code>.
<p>
In order to apply the perspective projection transformation to an existing transformation,
use {@link #perspectiveLH(float, float, float, float, b... | [
"Set",
"this",
"matrix",
"to",
"be",
"a",
"symmetric",
"perspective",
"projection",
"frustum",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"the",
"given",
"NDC",
"z",
"range",
"of",
"<code",
">",
"[",
"-",
"1",
"..... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L10235-L10258 |
fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/StreamUtils.java | StreamUtils.iteratorToStream | public static <T> Stream<T> iteratorToStream(final Iterator<T> iterator, final Boolean parallel) {
"""
Convert an Iterator to a Stream
@param <T> the type of the Stream
@param iterator the iterator
@param parallel whether to parallelize the stream
@return the stream
"""
return stream(spliteratorU... | java | public static <T> Stream<T> iteratorToStream(final Iterator<T> iterator, final Boolean parallel) {
return stream(spliteratorUnknownSize(iterator, IMMUTABLE), parallel);
} | [
"public",
"static",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"iteratorToStream",
"(",
"final",
"Iterator",
"<",
"T",
">",
"iterator",
",",
"final",
"Boolean",
"parallel",
")",
"{",
"return",
"stream",
"(",
"spliteratorUnknownSize",
"(",
"iterator",
",",
"IM... | Convert an Iterator to a Stream
@param <T> the type of the Stream
@param iterator the iterator
@param parallel whether to parallelize the stream
@return the stream | [
"Convert",
"an",
"Iterator",
"to",
"a",
"Stream"
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/StreamUtils.java#L76-L78 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/handler/chain/ChainedIoHandler.java | ChainedIoHandler.messageReceived | @Override
public void messageReceived(IoSession session, Object message)
throws Exception {
"""
Handles the specified <tt>messageReceived</tt> event with the
{@link IoHandlerCommand} or {@link IoHandlerChain} you specified
in the constructor.
"""
chain.execute(null, session, message);... | java | @Override
public void messageReceived(IoSession session, Object message)
throws Exception {
chain.execute(null, session, message);
} | [
"@",
"Override",
"public",
"void",
"messageReceived",
"(",
"IoSession",
"session",
",",
"Object",
"message",
")",
"throws",
"Exception",
"{",
"chain",
".",
"execute",
"(",
"null",
",",
"session",
",",
"message",
")",
";",
"}"
] | Handles the specified <tt>messageReceived</tt> event with the
{@link IoHandlerCommand} or {@link IoHandlerChain} you specified
in the constructor. | [
"Handles",
"the",
"specified",
"<tt",
">",
"messageReceived<",
"/",
"tt",
">",
"event",
"with",
"the",
"{"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/handler/chain/ChainedIoHandler.java#L64-L68 |
banq/jdonframework | src/main/java/com/jdon/util/MultiHashMap.java | MultiHashMap.get | public Object get(Object key,Object subKey) {
"""
Returns the value to which this map maps the specified key and subKey. Returns null if the map contains no mapping
for this key and subKey. A return value of null does not necessarily indicate that the map contains no mapping
for the key and subKey; it's also pos... | java | public Object get(Object key,Object subKey){
HashMap a = (HashMap)super.get(key);
if(a!=null){
Object b=a.get(subKey);
return b;
}
return null;
} | [
"public",
"Object",
"get",
"(",
"Object",
"key",
",",
"Object",
"subKey",
")",
"{",
"HashMap",
"a",
"=",
"(",
"HashMap",
")",
"super",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"a",
"!=",
"null",
")",
"{",
"Object",
"b",
"=",
"a",
".",
"get"... | Returns the value to which this map maps the specified key and subKey. Returns null if the map contains no mapping
for this key and subKey. A return value of null does not necessarily indicate that the map contains no mapping
for the key and subKey; it's also possible that the map explicitly maps the key to null.
The c... | [
"Returns",
"the",
"value",
"to",
"which",
"this",
"map",
"maps",
"the",
"specified",
"key",
"and",
"subKey",
".",
"Returns",
"null",
"if",
"the",
"map",
"contains",
"no",
"mapping",
"for",
"this",
"key",
"and",
"subKey",
".",
"A",
"return",
"value",
"of"... | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/MultiHashMap.java#L51-L58 |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/nww/utils/NwwUtilities.java | NwwUtilities.computeDistance | public static double computeDistance( double lat1, double lon1, double lat2, double lon2 ) {
"""
Calculates distance between 2 lat/long points on WGS84.
<p>Taken from Android sources.</p>
@param lat1
@param lon1
@param lat2
@param lon2
@return
"""
// Based on http://www.ngs.noaa.gov/PUBS_LIB/... | java | public static double computeDistance( double lat1, double lon1, double lat2, double lon2 ) {
// Based on http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf
// using the "Inverse Formula" (section 4)
int MAXITERS = 20;
// Convert lat/long to radians
lat1 *= Math.PI / 180.0;
lat2... | [
"public",
"static",
"double",
"computeDistance",
"(",
"double",
"lat1",
",",
"double",
"lon1",
",",
"double",
"lat2",
",",
"double",
"lon2",
")",
"{",
"// Based on http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf",
"// using the \"Inverse Formula\" (section 4)",
"int",
"MAXITER... | Calculates distance between 2 lat/long points on WGS84.
<p>Taken from Android sources.</p>
@param lat1
@param lon1
@param lat2
@param lon2
@return | [
"Calculates",
"distance",
"between",
"2",
"lat",
"/",
"long",
"points",
"on",
"WGS84",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/utils/NwwUtilities.java#L281-L345 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/util/annotation/AnnotationUtils.java | AnnotationUtils.findTypeAnnotation | public static <A extends Annotation> A findTypeAnnotation(final Class<?> type, final Class<A> targetAnnotationClass) {
"""
Recursive annotation search on type, it annotations and parents hierarchy. Interfaces ignored.
@param type
{@link Class}
@param targetAnnotationClass
required {@link Annotation} class
@... | java | public static <A extends Annotation> A findTypeAnnotation(final Class<?> type, final Class<A> targetAnnotationClass) {
Objects.requireNonNull(type, "incoming 'type' is not valid");
Objects.requireNonNull(targetAnnotationClass, "incoming 'targetAnnotationClass' is not valid");
if (type.equals(Object.class))
re... | [
"public",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"findTypeAnnotation",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"Class",
"<",
"A",
">",
"targetAnnotationClass",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"type",
","... | Recursive annotation search on type, it annotations and parents hierarchy. Interfaces ignored.
@param type
{@link Class}
@param targetAnnotationClass
required {@link Annotation} class
@param <A>
type param
@return {@link A} in case if found, {@code null} otherwise | [
"Recursive",
"annotation",
"search",
"on",
"type",
"it",
"annotations",
"and",
"parents",
"hierarchy",
".",
"Interfaces",
"ignored",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/util/annotation/AnnotationUtils.java#L129-L144 |
fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraBaseResource.java | FedoraBaseResource.getResourceFromPath | @VisibleForTesting
public FedoraResource getResourceFromPath(final String externalPath) {
"""
Get the FedoraResource for the resource at the external path
@param externalPath the external path
@return the fedora resource at the external path
"""
final Resource resource = translator().toDomain(ext... | java | @VisibleForTesting
public FedoraResource getResourceFromPath(final String externalPath) {
final Resource resource = translator().toDomain(externalPath);
final FedoraResource fedoraResource = translator().convert(resource);
if (fedoraResource instanceof Tombstone) {
final String ... | [
"@",
"VisibleForTesting",
"public",
"FedoraResource",
"getResourceFromPath",
"(",
"final",
"String",
"externalPath",
")",
"{",
"final",
"Resource",
"resource",
"=",
"translator",
"(",
")",
".",
"toDomain",
"(",
"externalPath",
")",
";",
"final",
"FedoraResource",
... | Get the FedoraResource for the resource at the external path
@param externalPath the external path
@return the fedora resource at the external path | [
"Get",
"the",
"FedoraResource",
"for",
"the",
"resource",
"at",
"the",
"external",
"path"
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraBaseResource.java#L91-L102 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/Where.java | Where.rawComparison | public Where<T, ID> rawComparison(String columnName, String rawOperator, Object value) throws SQLException {
"""
Make a comparison where the operator is specified by the caller. It is up to the caller to specify an appropriate
operator for the database and that it be formatted correctly.
"""
addClause(new S... | java | public Where<T, ID> rawComparison(String columnName, String rawOperator, Object value) throws SQLException {
addClause(new SimpleComparison(columnName, findColumnFieldType(columnName), value, rawOperator));
return this;
} | [
"public",
"Where",
"<",
"T",
",",
"ID",
">",
"rawComparison",
"(",
"String",
"columnName",
",",
"String",
"rawOperator",
",",
"Object",
"value",
")",
"throws",
"SQLException",
"{",
"addClause",
"(",
"new",
"SimpleComparison",
"(",
"columnName",
",",
"findColum... | Make a comparison where the operator is specified by the caller. It is up to the caller to specify an appropriate
operator for the database and that it be formatted correctly. | [
"Make",
"a",
"comparison",
"where",
"the",
"operator",
"is",
"specified",
"by",
"the",
"caller",
".",
"It",
"is",
"up",
"to",
"the",
"caller",
"to",
"specify",
"an",
"appropriate",
"operator",
"for",
"the",
"database",
"and",
"that",
"it",
"be",
"formatted... | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/Where.java#L464-L467 |
code4everything/util | src/main/java/com/zhazhapan/util/Formatter.java | Formatter.toCurrency | public static String toCurrency(Locale locale, double number) {
"""
格式化为货币字符串
@param locale {@link Locale},比如:{@link Locale#CHINA}
@param number 数字
@return 货币字符串
@since 1.0.9
"""
return NumberFormat.getCurrencyInstance(locale).format(number);
} | java | public static String toCurrency(Locale locale, double number) {
return NumberFormat.getCurrencyInstance(locale).format(number);
} | [
"public",
"static",
"String",
"toCurrency",
"(",
"Locale",
"locale",
",",
"double",
"number",
")",
"{",
"return",
"NumberFormat",
".",
"getCurrencyInstance",
"(",
"locale",
")",
".",
"format",
"(",
"number",
")",
";",
"}"
] | 格式化为货币字符串
@param locale {@link Locale},比如:{@link Locale#CHINA}
@param number 数字
@return 货币字符串
@since 1.0.9 | [
"格式化为货币字符串"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Formatter.java#L156-L158 |
JRebirth/JRebirth | org.jrebirth.af/presentation/src/main/java/org/jrebirth/af/presentation/ui/base/AbstractSlideModel.java | AbstractSlideModel.buildHorizontalAnimation | protected Animation buildHorizontalAnimation(final double fromX, final double toX, final double fromY, final double toY) {
"""
Build a scaling animation.
@param fromX the x starting point coordinate
@param toX the x arrival point coordinate
@param fromY the y starting point coordinate
@param toY the y arriva... | java | protected Animation buildHorizontalAnimation(final double fromX, final double toX, final double fromY, final double toY) {
final double angle = findAngle(fromX, toX, fromY, toY);
final MotionBlur mb = MotionBlurBuilder.create().angle(angle).build();
node().setEffect(mb);
return Parall... | [
"protected",
"Animation",
"buildHorizontalAnimation",
"(",
"final",
"double",
"fromX",
",",
"final",
"double",
"toX",
",",
"final",
"double",
"fromY",
",",
"final",
"double",
"toY",
")",
"{",
"final",
"double",
"angle",
"=",
"findAngle",
"(",
"fromX",
",",
"... | Build a scaling animation.
@param fromX the x starting point coordinate
@param toX the x arrival point coordinate
@param fromY the y starting point coordinate
@param toY the y arrival point coordinate
@return a translate animation | [
"Build",
"a",
"scaling",
"animation",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/presentation/src/main/java/org/jrebirth/af/presentation/ui/base/AbstractSlideModel.java#L495-L522 |
alipay/sofa-rpc | extension-impl/fault-tolerance/src/main/java/com/alipay/sofa/rpc/client/aft/ProviderInfoWeightManager.java | ProviderInfoWeightManager.degradeWeight | public static boolean degradeWeight(ProviderInfo providerInfo, int weight) {
"""
Degrade weight of provider info
@param providerInfo ProviderInfo
@param weight degraded weight
@return is degrade success
"""
providerInfo.setStatus(ProviderStatus.DEGRADED);
providerInfo.setWeight(weigh... | java | public static boolean degradeWeight(ProviderInfo providerInfo, int weight) {
providerInfo.setStatus(ProviderStatus.DEGRADED);
providerInfo.setWeight(weight);
return true;
} | [
"public",
"static",
"boolean",
"degradeWeight",
"(",
"ProviderInfo",
"providerInfo",
",",
"int",
"weight",
")",
"{",
"providerInfo",
".",
"setStatus",
"(",
"ProviderStatus",
".",
"DEGRADED",
")",
";",
"providerInfo",
".",
"setWeight",
"(",
"weight",
")",
";",
... | Degrade weight of provider info
@param providerInfo ProviderInfo
@param weight degraded weight
@return is degrade success | [
"Degrade",
"weight",
"of",
"provider",
"info"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/fault-tolerance/src/main/java/com/alipay/sofa/rpc/client/aft/ProviderInfoWeightManager.java#L49-L53 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/sax/Excel03SaxReader.java | Excel03SaxReader.read | public Excel03SaxReader read(POIFSFileSystem fs, int sheetIndex) throws POIException {
"""
读取
@param fs {@link POIFSFileSystem}
@param sheetIndex sheet序号
@return this
@throws POIException IO异常包装
"""
this.sheetIndex = sheetIndex;
formatListener = new FormatTrackingHSSFListener(new MissingRecordAwa... | java | public Excel03SaxReader read(POIFSFileSystem fs, int sheetIndex) throws POIException {
this.sheetIndex = sheetIndex;
formatListener = new FormatTrackingHSSFListener(new MissingRecordAwareHSSFListener(this));
final HSSFRequest request = new HSSFRequest();
if (isOutputFormulaValues) {
request.addListene... | [
"public",
"Excel03SaxReader",
"read",
"(",
"POIFSFileSystem",
"fs",
",",
"int",
"sheetIndex",
")",
"throws",
"POIException",
"{",
"this",
".",
"sheetIndex",
"=",
"sheetIndex",
";",
"formatListener",
"=",
"new",
"FormatTrackingHSSFListener",
"(",
"new",
"MissingRecor... | 读取
@param fs {@link POIFSFileSystem}
@param sheetIndex sheet序号
@return this
@throws POIException IO异常包装 | [
"读取"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/sax/Excel03SaxReader.java#L109-L127 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/tools/Tools.java | Tools.selectRules | public static void selectRules(JLanguageTool lt, List<String> disabledRuleIds, List<String> enabledRuleIds, boolean useEnabledOnly) {
"""
Enable and disable rules of the given LanguageTool instance.
@param lt LanguageTool object
@param disabledRuleIds ids of the rules to be disabled
@param enabledRuleIds ids of... | java | public static void selectRules(JLanguageTool lt, List<String> disabledRuleIds, List<String> enabledRuleIds, boolean useEnabledOnly) {
Set<String> disabledRuleIdsSet = new HashSet<>();
disabledRuleIdsSet.addAll(disabledRuleIds);
Set<String> enabledRuleIdsSet = new HashSet<>();
enabledRuleIdsSet.addAll(en... | [
"public",
"static",
"void",
"selectRules",
"(",
"JLanguageTool",
"lt",
",",
"List",
"<",
"String",
">",
"disabledRuleIds",
",",
"List",
"<",
"String",
">",
"enabledRuleIds",
",",
"boolean",
"useEnabledOnly",
")",
"{",
"Set",
"<",
"String",
">",
"disabledRuleId... | Enable and disable rules of the given LanguageTool instance.
@param lt LanguageTool object
@param disabledRuleIds ids of the rules to be disabled
@param enabledRuleIds ids of the rules to be enabled
@param useEnabledOnly if set to {@code true}, disable all rules except those enabled explicitly | [
"Enable",
"and",
"disable",
"rules",
"of",
"the",
"given",
"LanguageTool",
"instance",
"."
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/tools/Tools.java#L286-L292 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/current_timezone.java | current_timezone.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
current_timezone_responses result = (current_timezone_responses) servic... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
current_timezone_responses result = (current_timezone_responses) service.get_payload_formatter().string_to_resource(current_timezone_responses.class, response);
if(result.errorcode != 0)
{
if (res... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"current_timezone_responses",
"result",
"=",
"(",
"current_timezone_responses",
")",
"service",
".",
"get_payl... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/current_timezone.java#L203-L220 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.assertTableDoesNotExistOnCassandraKeyspace | @Then("^a Cassandra keyspace '(.+?)' does not contain a table '(.+?)'$")
public void assertTableDoesNotExistOnCassandraKeyspace(String keyspace, String tableName) {
"""
Checks a cassandra keyspace does not contain a table.
@param keyspace
@param tableName
"""
assertThat(commonspec.getCassandraC... | java | @Then("^a Cassandra keyspace '(.+?)' does not contain a table '(.+?)'$")
public void assertTableDoesNotExistOnCassandraKeyspace(String keyspace, String tableName) {
assertThat(commonspec.getCassandraClient().getTables(keyspace)).as("The table " + tableName + "exists on cassandra").doesNotContain(tableName);... | [
"@",
"Then",
"(",
"\"^a Cassandra keyspace '(.+?)' does not contain a table '(.+?)'$\"",
")",
"public",
"void",
"assertTableDoesNotExistOnCassandraKeyspace",
"(",
"String",
"keyspace",
",",
"String",
"tableName",
")",
"{",
"assertThat",
"(",
"commonspec",
".",
"getCassandraCl... | Checks a cassandra keyspace does not contain a table.
@param keyspace
@param tableName | [
"Checks",
"a",
"cassandra",
"keyspace",
"does",
"not",
"contain",
"a",
"table",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L668-L671 |
alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/MyScpClient.java | MyScpClient.put | public void put(String localFile, String remoteTargetDirectory) throws IOException {
"""
Copy a local file to a remote directory, uses mode 0600 when creating
the file on the remote side.
@param localFile Path and name of local file.
@param remoteTargetDirectory Remote target directory.
@throws I... | java | public void put(String localFile, String remoteTargetDirectory) throws IOException {
put(new String[]{localFile}, remoteTargetDirectory, "0600");
} | [
"public",
"void",
"put",
"(",
"String",
"localFile",
",",
"String",
"remoteTargetDirectory",
")",
"throws",
"IOException",
"{",
"put",
"(",
"new",
"String",
"[",
"]",
"{",
"localFile",
"}",
",",
"remoteTargetDirectory",
",",
"\"0600\"",
")",
";",
"}"
] | Copy a local file to a remote directory, uses mode 0600 when creating
the file on the remote side.
@param localFile Path and name of local file.
@param remoteTargetDirectory Remote target directory.
@throws IOException | [
"Copy",
"a",
"local",
"file",
"to",
"a",
"remote",
"directory",
"uses",
"mode",
"0600",
"when",
"creating",
"the",
"file",
"on",
"the",
"remote",
"side",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/MyScpClient.java#L303-L305 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.listSiteDiagnosticCategoriesAsync | public Observable<Page<DiagnosticCategoryInner>> listSiteDiagnosticCategoriesAsync(final String resourceGroupName, final String siteName) {
"""
Get Diagnostics Categories.
Get Diagnostics Categories.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
... | java | public Observable<Page<DiagnosticCategoryInner>> listSiteDiagnosticCategoriesAsync(final String resourceGroupName, final String siteName) {
return listSiteDiagnosticCategoriesWithServiceResponseAsync(resourceGroupName, siteName)
.map(new Func1<ServiceResponse<Page<DiagnosticCategoryInner>>, Page<Dia... | [
"public",
"Observable",
"<",
"Page",
"<",
"DiagnosticCategoryInner",
">",
">",
"listSiteDiagnosticCategoriesAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"siteName",
")",
"{",
"return",
"listSiteDiagnosticCategoriesWithServiceResponseAsync",
"... | Get Diagnostics Categories.
Get Diagnostics Categories.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<DiagnosticCategoryInner> object | [
"Get",
"Diagnostics",
"Categories",
".",
"Get",
"Diagnostics",
"Categories",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L212-L220 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.