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 |
|---|---|---|---|---|---|---|---|---|---|---|
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/IntegerField.java | IntegerField.moveSQLToField | public void moveSQLToField(ResultSet resultset, int iColumn) throws SQLException {
"""
Move the physical binary data to this SQL parameter row.
@param resultset The resultset to get the SQL data from.
@param iColumn the column in the resultset that has my data.
@exception SQLException From SQL calls.
"""
... | java | public void moveSQLToField(ResultSet resultset, int iColumn) throws SQLException
{
int sResult = resultset.getInt(iColumn);
if (resultset.wasNull())
this.setString(Constants.BLANK, false, DBConstants.READ_MOVE); // Null value
else
{
if ((!this.isNullable()) &... | [
"public",
"void",
"moveSQLToField",
"(",
"ResultSet",
"resultset",
",",
"int",
"iColumn",
")",
"throws",
"SQLException",
"{",
"int",
"sResult",
"=",
"resultset",
".",
"getInt",
"(",
"iColumn",
")",
";",
"if",
"(",
"resultset",
".",
"wasNull",
"(",
")",
")"... | Move the physical binary data to this SQL parameter row.
@param resultset The resultset to get the SQL data from.
@param iColumn the column in the resultset that has my data.
@exception SQLException From SQL calls. | [
"Move",
"the",
"physical",
"binary",
"data",
"to",
"this",
"SQL",
"parameter",
"row",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/IntegerField.java#L160-L172 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Multiset.java | Multiset.computeIfAbsent | public <E extends Exception> int computeIfAbsent(T e, Try.Function<? super T, Integer, E> mappingFunction) throws E {
"""
The implementation is equivalent to performing the following steps for this Multiset:
<pre>
final int oldValue = get(e);
if (oldValue > 0) {
return oldValue;
}
final int newValue = ... | java | public <E extends Exception> int computeIfAbsent(T e, Try.Function<? super T, Integer, E> mappingFunction) throws E {
N.checkArgNotNull(mappingFunction);
final int oldValue = get(e);
if (oldValue > 0) {
return oldValue;
}
final int newValue = mappingFuncti... | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"int",
"computeIfAbsent",
"(",
"T",
"e",
",",
"Try",
".",
"Function",
"<",
"?",
"super",
"T",
",",
"Integer",
",",
"E",
">",
"mappingFunction",
")",
"throws",
"E",
"{",
"N",
".",
"checkArgNotNull",
"(",
... | The implementation is equivalent to performing the following steps for this Multiset:
<pre>
final int oldValue = get(e);
if (oldValue > 0) {
return oldValue;
}
final int newValue = mappingFunction.apply(e);
if (newValue > 0) {
set(e, newValue);
}
return newValue;
</pre>
@param e
@param mappingFunction
@return | [
"The",
"implementation",
"is",
"equivalent",
"to",
"performing",
"the",
"following",
"steps",
"for",
"this",
"Multiset",
":"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Multiset.java#L1239-L1255 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/AbstractSimpleTag.java | AbstractSimpleTag.registerTagError | public void registerTagError(String message, Throwable e)
throws JspException {
"""
This will report an error from a tag. The error will
contain a message. If error reporting is turned off,
the message will be returned and the caller should throw
a JspException to report the error.
@param message... | java | public void registerTagError(String message, Throwable e)
throws JspException
{
ErrorHandling eh = getErrorHandling();
eh.registerTagError(message, getTagName(), this, e);
} | [
"public",
"void",
"registerTagError",
"(",
"String",
"message",
",",
"Throwable",
"e",
")",
"throws",
"JspException",
"{",
"ErrorHandling",
"eh",
"=",
"getErrorHandling",
"(",
")",
";",
"eh",
".",
"registerTagError",
"(",
"message",
",",
"getTagName",
"(",
")"... | This will report an error from a tag. The error will
contain a message. If error reporting is turned off,
the message will be returned and the caller should throw
a JspException to report the error.
@param message - the message to register with the error
@throws javax.servlet.jsp.JspException - if in-page error repor... | [
"This",
"will",
"report",
"an",
"error",
"from",
"a",
"tag",
".",
"The",
"error",
"will",
"contain",
"a",
"message",
".",
"If",
"error",
"reporting",
"is",
"turned",
"off",
"the",
"message",
"will",
"be",
"returned",
"and",
"the",
"caller",
"should",
"th... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/AbstractSimpleTag.java#L179-L184 |
recommenders/rival | rival-recommend/src/main/java/net/recommenders/rival/recommend/frameworks/MultipleRecommendationRunner.java | MultipleRecommendationRunner.runMahoutRecommenders | public static void runMahoutRecommenders(final Set<String> paths, final Properties properties) {
"""
Runs Mahout-based recommenders.
@param paths the input and output paths.
@param properties the properties.
"""
for (AbstractRunner<Long, Long> rec : instantiateMahoutRecommenders(paths, properties))... | java | public static void runMahoutRecommenders(final Set<String> paths, final Properties properties) {
for (AbstractRunner<Long, Long> rec : instantiateMahoutRecommenders(paths, properties)) {
RecommendationRunner.run(rec);
}
} | [
"public",
"static",
"void",
"runMahoutRecommenders",
"(",
"final",
"Set",
"<",
"String",
">",
"paths",
",",
"final",
"Properties",
"properties",
")",
"{",
"for",
"(",
"AbstractRunner",
"<",
"Long",
",",
"Long",
">",
"rec",
":",
"instantiateMahoutRecommenders",
... | Runs Mahout-based recommenders.
@param paths the input and output paths.
@param properties the properties. | [
"Runs",
"Mahout",
"-",
"based",
"recommenders",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-recommend/src/main/java/net/recommenders/rival/recommend/frameworks/MultipleRecommendationRunner.java#L229-L233 |
Scout24/appmon4j | core/src/main/java/de/is24/util/monitoring/database/MonitoringDataSource.java | MonitoringDataSource.doConnectionMonitoring | private void doConnectionMonitoring(long startingInstant, String monitorSuffix) {
"""
Handles the monitoring for retrieving connections and adapts the <i>max connection</i> counter if appropriate.
@param startingInstant
the instant a database connection was requested
@param monitorSuffix
the suffix for t... | java | private void doConnectionMonitoring(long startingInstant, String monitorSuffix) {
InApplicationMonitor.getInstance()
.addTimerMeasurement(this.monitorBaseName + monitorSuffix,
System.currentTimeMillis() - startingInstant);
int noCurrentConnections = this.currentConnections.incrementAndGet();
... | [
"private",
"void",
"doConnectionMonitoring",
"(",
"long",
"startingInstant",
",",
"String",
"monitorSuffix",
")",
"{",
"InApplicationMonitor",
".",
"getInstance",
"(",
")",
".",
"addTimerMeasurement",
"(",
"this",
".",
"monitorBaseName",
"+",
"monitorSuffix",
",",
"... | Handles the monitoring for retrieving connections and adapts the <i>max connection</i> counter if appropriate.
@param startingInstant
the instant a database connection was requested
@param monitorSuffix
the suffix for the monitor name to increase | [
"Handles",
"the",
"monitoring",
"for",
"retrieving",
"connections",
"and",
"adapts",
"the",
"<i",
">",
"max",
"connection<",
"/",
"i",
">",
"counter",
"if",
"appropriate",
"."
] | train | https://github.com/Scout24/appmon4j/blob/a662e5123805ea455cfd01e1b9ae5d808f83529c/core/src/main/java/de/is24/util/monitoring/database/MonitoringDataSource.java#L185-L194 |
JoeKerouac/utils | src/main/java/com/joe/utils/pattern/PatternUtils.java | PatternUtils.check | private static boolean check(String data, Pattern pattern) {
"""
检查数据是否符合正则
@param data 数据
@param pattern 正则
@return 返回true表示数据符合正则表达式(默认数据为空时返回false)
"""
if (StringUtils.isEmpty(data)) {
return false;
}
Matcher matcher = pattern.matcher(data);
return matcher... | java | private static boolean check(String data, Pattern pattern) {
if (StringUtils.isEmpty(data)) {
return false;
}
Matcher matcher = pattern.matcher(data);
return matcher.matches();
} | [
"private",
"static",
"boolean",
"check",
"(",
"String",
"data",
",",
"Pattern",
"pattern",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"data",
")",
")",
"{",
"return",
"false",
";",
"}",
"Matcher",
"matcher",
"=",
"pattern",
".",
"matcher",
... | 检查数据是否符合正则
@param data 数据
@param pattern 正则
@return 返回true表示数据符合正则表达式(默认数据为空时返回false) | [
"检查数据是否符合正则"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/pattern/PatternUtils.java#L87-L93 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/Document.java | Document.putProperties | @InterfaceAudience.Public
public SavedRevision putProperties(Map<String, Object> properties)
throws CouchbaseLiteException {
"""
Saves a new revision. The properties dictionary must have a "_rev" property
whose ID matches the current revision's (as it will if it's a modified
copy of this document... | java | @InterfaceAudience.Public
public SavedRevision putProperties(Map<String, Object> properties)
throws CouchbaseLiteException {
String prevID = (String) properties.get("_rev");
boolean allowConflict = false;
return putProperties(properties, prevID, allowConflict);
} | [
"@",
"InterfaceAudience",
".",
"Public",
"public",
"SavedRevision",
"putProperties",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"throws",
"CouchbaseLiteException",
"{",
"String",
"prevID",
"=",
"(",
"String",
")",
"properties",
".",
"get",... | Saves a new revision. The properties dictionary must have a "_rev" property
whose ID matches the current revision's (as it will if it's a modified
copy of this document's .properties property.)
@param properties the contents to be saved in the new revision
@return a new SavedRevision | [
"Saves",
"a",
"new",
"revision",
".",
"The",
"properties",
"dictionary",
"must",
"have",
"a",
"_rev",
"property",
"whose",
"ID",
"matches",
"the",
"current",
"revision",
"s",
"(",
"as",
"it",
"will",
"if",
"it",
"s",
"a",
"modified",
"copy",
"of",
"this"... | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/Document.java#L346-L352 |
aerospike/aerospike-helper | java/src/main/java/com/aerospike/helper/Utils.java | Utils.toNameValuePair | public static List<NameValuePair> toNameValuePair(Object parent, Map<String, String> map) {
"""
Creates a List of NameValuePair from a Map
@param parent The Parent object to be added to the NameValuePair of each element
@param map The map to be converted
@return The List of NameValuePairs
"""
List<NameV... | java | public static List<NameValuePair> toNameValuePair(Object parent, Map<String, String> map) {
List<NameValuePair> list = new ArrayList<NameValuePair>();
for (String key : map.keySet()) {
NameValuePair nvp = new NameValuePair(parent, key, map.get(key));
list.add(nvp);
}
return list;
} | [
"public",
"static",
"List",
"<",
"NameValuePair",
">",
"toNameValuePair",
"(",
"Object",
"parent",
",",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"List",
"<",
"NameValuePair",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"NameValuePair",
">"... | Creates a List of NameValuePair from a Map
@param parent The Parent object to be added to the NameValuePair of each element
@param map The map to be converted
@return The List of NameValuePairs | [
"Creates",
"a",
"List",
"of",
"NameValuePair",
"from",
"a",
"Map"
] | train | https://github.com/aerospike/aerospike-helper/blob/eeb4a1464bc8d9c6716c014d250c8166b5caa82d/java/src/main/java/com/aerospike/helper/Utils.java#L99-L106 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/payments/PublicCardUrl.java | PublicCardUrl.updateUrl | public static MozuUrl updateUrl(String cardId, String responseFields) {
"""
Get Resource Url for Update
@param cardId Unique identifier of the card associated with the customer account billing contact.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data retur... | java | public static MozuUrl updateUrl(String cardId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/payments/commerce/payments/cards/{cardId}?responseFields={responseFields}");
formatter.formatUrl("cardId", cardId);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(... | [
"public",
"static",
"MozuUrl",
"updateUrl",
"(",
"String",
"cardId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/payments/commerce/payments/cards/{cardId}?responseFields={responseFields}\"",
")",
";",
"formatt... | Get Resource Url for Update
@param cardId Unique identifier of the card associated with the customer account billing contact.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Atte... | [
"Get",
"Resource",
"Url",
"for",
"Update"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/payments/PublicCardUrl.java#L60-L66 |
woo-j/OkapiBarcode | src/main/java/uk/org/okapibarcode/backend/Upc.java | Upc.expandToEquivalentUpcA | protected String expandToEquivalentUpcA(String content, boolean validate) {
"""
Expands the zero-compressed UPC-E code to make a UPC-A equivalent (EN Table 5).
@param content the UPC-E code to expand
@param validate whether or not to validate the input
@return the UPC-A equivalent of the specified UPC-E code
... | java | protected String expandToEquivalentUpcA(String content, boolean validate) {
char[] upce = content.toCharArray();
char[] upca = new char[11];
Arrays.fill(upca, '0');
upca[0] = upce[0];
upca[1] = upce[1];
upca[2] = upce[2];
char emode = upce[6];
switch (e... | [
"protected",
"String",
"expandToEquivalentUpcA",
"(",
"String",
"content",
",",
"boolean",
"validate",
")",
"{",
"char",
"[",
"]",
"upce",
"=",
"content",
".",
"toCharArray",
"(",
")",
";",
"char",
"[",
"]",
"upca",
"=",
"new",
"char",
"[",
"11",
"]",
... | Expands the zero-compressed UPC-E code to make a UPC-A equivalent (EN Table 5).
@param content the UPC-E code to expand
@param validate whether or not to validate the input
@return the UPC-A equivalent of the specified UPC-E code | [
"Expands",
"the",
"zero",
"-",
"compressed",
"UPC",
"-",
"E",
"code",
"to",
"make",
"a",
"UPC",
"-",
"A",
"equivalent",
"(",
"EN",
"Table",
"5",
")",
"."
] | train | https://github.com/woo-j/OkapiBarcode/blob/d1cb4f4ab64557cd3db64d9a473528a52ce58081/src/main/java/uk/org/okapibarcode/backend/Upc.java#L242-L293 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseScsc2dense | public static int cusparseScsc2dense(
cusparseHandle handle,
int m,
int n,
cusparseMatDescr descrA,
Pointer cscSortedValA,
Pointer cscSortedRowIndA,
Pointer cscSortedColPtrA,
Pointer A,
int lda) {
"""
Description: This routine... | java | public static int cusparseScsc2dense(
cusparseHandle handle,
int m,
int n,
cusparseMatDescr descrA,
Pointer cscSortedValA,
Pointer cscSortedRowIndA,
Pointer cscSortedColPtrA,
Pointer A,
int lda)
{
return checkResult(c... | [
"public",
"static",
"int",
"cusparseScsc2dense",
"(",
"cusparseHandle",
"handle",
",",
"int",
"m",
",",
"int",
"n",
",",
"cusparseMatDescr",
"descrA",
",",
"Pointer",
"cscSortedValA",
",",
"Pointer",
"cscSortedRowIndA",
",",
"Pointer",
"cscSortedColPtrA",
",",
"Po... | Description: This routine converts a sparse matrix in CSC storage format
to a dense matrix. | [
"Description",
":",
"This",
"routine",
"converts",
"a",
"sparse",
"matrix",
"in",
"CSC",
"storage",
"format",
"to",
"a",
"dense",
"matrix",
"."
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L11497-L11509 |
akarnokd/ixjava | src/main/java/ix/Ix.java | Ix.zipWith | public final <U, R> Ix<R> zipWith(Iterable<U> other, IxFunction2<? super T, ? super U, ? extends R> zipper) {
"""
Combines the next element from this and the other source Iterable via a zipper function.
<p>
If one of the source Iterables is sorter the sequence terminates eagerly.
<p>
The result's iterator() do... | java | public final <U, R> Ix<R> zipWith(Iterable<U> other, IxFunction2<? super T, ? super U, ? extends R> zipper) {
return zip(this, other, zipper);
} | [
"public",
"final",
"<",
"U",
",",
"R",
">",
"Ix",
"<",
"R",
">",
"zipWith",
"(",
"Iterable",
"<",
"U",
">",
"other",
",",
"IxFunction2",
"<",
"?",
"super",
"T",
",",
"?",
"super",
"U",
",",
"?",
"extends",
"R",
">",
"zipper",
")",
"{",
"return"... | Combines the next element from this and the other source Iterable via a zipper function.
<p>
If one of the source Iterables is sorter the sequence terminates eagerly.
<p>
The result's iterator() doesn't support remove().
@param <U> the other source's element type
@param <R> the result value type
@param other the the o... | [
"Combines",
"the",
"next",
"element",
"from",
"this",
"and",
"the",
"other",
"source",
"Iterable",
"via",
"a",
"zipper",
"function",
".",
"<p",
">",
"If",
"one",
"of",
"the",
"source",
"Iterables",
"is",
"sorter",
"the",
"sequence",
"terminates",
"eagerly",
... | train | https://github.com/akarnokd/ixjava/blob/add721bba550c36541faa450e40a975bb65e78d7/src/main/java/ix/Ix.java#L2238-L2240 |
voldemort/voldemort | src/java/voldemort/store/metadata/MetadataStore.java | MetadataStore.addRebalancingState | public void addRebalancingState(final RebalanceTaskInfo stealInfo) {
"""
Add the steal information to the rebalancer state
@param stealInfo The steal information to add
"""
// acquire write lock
writeLock.lock();
try {
// Move into rebalancing state
if(ByteUti... | java | public void addRebalancingState(final RebalanceTaskInfo stealInfo) {
// acquire write lock
writeLock.lock();
try {
// Move into rebalancing state
if(ByteUtils.getString(get(SERVER_STATE_KEY, null).get(0).getValue(), "UTF-8")
.compareTo(VoldemortSta... | [
"public",
"void",
"addRebalancingState",
"(",
"final",
"RebalanceTaskInfo",
"stealInfo",
")",
"{",
"// acquire write lock",
"writeLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"// Move into rebalancing state",
"if",
"(",
"ByteUtils",
".",
"getString",
"(",
"get",
... | Add the steal information to the rebalancer state
@param stealInfo The steal information to add | [
"Add",
"the",
"steal",
"information",
"to",
"the",
"rebalancer",
"state"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/metadata/MetadataStore.java#L896-L921 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/util/TypeUtil.java | TypeUtil.binaryNumericPromotion | public TypeMirror binaryNumericPromotion(TypeMirror type1, TypeMirror type2) {
"""
If either type is a double TypeMirror, a double TypeMirror is returned.
Otherwise, if either type is a float TypeMirror, a float TypeMirror is returned.
Otherwise, if either type is a long TypeMirror, a long TypeMirror is returned... | java | public TypeMirror binaryNumericPromotion(TypeMirror type1, TypeMirror type2) {
TypeKind t1 = type1.getKind();
TypeKind t2 = type2.getKind();
if (t1 == TypeKind.DECLARED) {
t1 = javacTypes.unboxedType(type1).getKind();
}
if (t2 == TypeKind.DECLARED) {
t2 = javacTypes.unboxedType(type2).ge... | [
"public",
"TypeMirror",
"binaryNumericPromotion",
"(",
"TypeMirror",
"type1",
",",
"TypeMirror",
"type2",
")",
"{",
"TypeKind",
"t1",
"=",
"type1",
".",
"getKind",
"(",
")",
";",
"TypeKind",
"t2",
"=",
"type2",
".",
"getKind",
"(",
")",
";",
"if",
"(",
"... | If either type is a double TypeMirror, a double TypeMirror is returned.
Otherwise, if either type is a float TypeMirror, a float TypeMirror is returned.
Otherwise, if either type is a long TypeMirror, a long TypeMirror is returned.
Otherwise, an int TypeMirror is returned. See jls-5.6.2.
@param type1 a numeric type
@pa... | [
"If",
"either",
"type",
"is",
"a",
"double",
"TypeMirror",
"a",
"double",
"TypeMirror",
"is",
"returned",
".",
"Otherwise",
"if",
"either",
"type",
"is",
"a",
"float",
"TypeMirror",
"a",
"float",
"TypeMirror",
"is",
"returned",
".",
"Otherwise",
"if",
"eithe... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/util/TypeUtil.java#L319-L337 |
apache/flink | flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java | MetricConfig.getBoolean | public boolean getBoolean(String key, boolean defaultValue) {
"""
Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if th... | java | public boolean getBoolean(String key, boolean defaultValue) {
String argument = getProperty(key, null);
return argument == null
? defaultValue
: Boolean.parseBoolean(argument);
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"String",
"argument",
"=",
"getProperty",
"(",
"key",
",",
"null",
")",
";",
"return",
"argument",
"==",
"null",
"?",
"defaultValue",
":",
"Boolean",
".",
"p... | Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if the property is not found.
@param key the hashtable key.
@param de... | [
"Searches",
"for",
"the",
"property",
"with",
"the",
"specified",
"key",
"in",
"this",
"property",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"this",
"property",
"list",
"the",
"default",
"property",
"list",
"and",
"its",
"defaults",
"rec... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java#L110-L115 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/time/DateTimePeriod.java | DateTimePeriod.toDays | public List<DateTimePeriod> toDays() {
"""
Converts this period to a list of day periods. Partial days will not be
included. For example, a period of "January 2009" will return a list
of 31 days - one for each day in January. On the other hand, a period
of "January 20, 2009 13:00-59" would return an empty li... | java | public List<DateTimePeriod> toDays() {
ArrayList<DateTimePeriod> list = new ArrayList<DateTimePeriod>();
// default "current" day to start datetime
DateTime currentStart = getStart();
// calculate "next" day
DateTime nextStart = currentStart.plusDays(1);
// continue addi... | [
"public",
"List",
"<",
"DateTimePeriod",
">",
"toDays",
"(",
")",
"{",
"ArrayList",
"<",
"DateTimePeriod",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"DateTimePeriod",
">",
"(",
")",
";",
"// default \"current\" day to start datetime",
"DateTime",
"currentStart",
... | Converts this period to a list of day periods. Partial days will not be
included. For example, a period of "January 2009" will return a list
of 31 days - one for each day in January. On the other hand, a period
of "January 20, 2009 13:00-59" would return an empty list since partial
days are not included.
@return A l... | [
"Converts",
"this",
"period",
"to",
"a",
"list",
"of",
"day",
"periods",
".",
"Partial",
"days",
"will",
"not",
"be",
"included",
".",
"For",
"example",
"a",
"period",
"of",
"January",
"2009",
"will",
"return",
"a",
"list",
"of",
"31",
"days",
"-",
"on... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/time/DateTimePeriod.java#L299-L316 |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/der/DerUtils.java | DerUtils.sizeOf | public static int sizeOf(int tagNumber, int contentLength) {
"""
Computes the DER-encoded size of content with a specified tag number.
@param tagNumber
the DER tag number in the identifier
@param contentLength
the length of the content in bytes
@return
"""
if (tagNumber < 0 || contentLength < 0)... | java | public static int sizeOf(int tagNumber, int contentLength) {
if (tagNumber < 0 || contentLength < 0) {
throw new IllegalArgumentException("Invalid tagNumber/contentLength: " + tagNumber + ", " + contentLength);
}
int len = 0;
// ID octets
if (tagNumber <= 30) {
... | [
"public",
"static",
"int",
"sizeOf",
"(",
"int",
"tagNumber",
",",
"int",
"contentLength",
")",
"{",
"if",
"(",
"tagNumber",
"<",
"0",
"||",
"contentLength",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid tagNumber/contentLength:... | Computes the DER-encoded size of content with a specified tag number.
@param tagNumber
the DER tag number in the identifier
@param contentLength
the length of the content in bytes
@return | [
"Computes",
"the",
"DER",
"-",
"encoded",
"size",
"of",
"content",
"with",
"a",
"specified",
"tag",
"number",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/der/DerUtils.java#L181-L206 |
UrielCh/ovh-java-sdk | ovh-java-sdk-distributionimage/src/main/java/net/minidev/ovh/api/ApiOvhDistributionimage.java | ApiOvhDistributionimage.serviceType_imageName_GET | public OvhImage serviceType_imageName_GET(net.minidev.ovh.api.distribution.image.OvhService serviceType, String imageName) throws IOException {
"""
Show image details
REST: GET /distribution/image/{serviceType}/{imageName}
@param serviceType [required] service type name
@param imageName [required] image name
... | java | public OvhImage serviceType_imageName_GET(net.minidev.ovh.api.distribution.image.OvhService serviceType, String imageName) throws IOException {
String qPath = "/distribution/image/{serviceType}/{imageName}";
StringBuilder sb = path(qPath, serviceType, imageName);
String resp = execN(qPath, "GET", sb.toString(), n... | [
"public",
"OvhImage",
"serviceType_imageName_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"distribution",
".",
"image",
".",
"OvhService",
"serviceType",
",",
"String",
"imageName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"... | Show image details
REST: GET /distribution/image/{serviceType}/{imageName}
@param serviceType [required] service type name
@param imageName [required] image name
API beta | [
"Show",
"image",
"details"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-distributionimage/src/main/java/net/minidev/ovh/api/ApiOvhDistributionimage.java#L29-L34 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java | DomainsInner.updateAsync | public Observable<DomainInner> updateAsync(String resourceGroupName, String domainName, Map<String, String> tags) {
"""
Update a domain.
Asynchronously updates a domain with the specified parameters.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName Name... | java | public Observable<DomainInner> updateAsync(String resourceGroupName, String domainName, Map<String, String> tags) {
return updateWithServiceResponseAsync(resourceGroupName, domainName, tags).map(new Func1<ServiceResponse<DomainInner>, DomainInner>() {
@Override
public DomainInner call(Se... | [
"public",
"Observable",
"<",
"DomainInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Update a domain.
Asynchronously updates a domain with the specified parameters.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName Name of the domain
@param tags Tags of the domains resource
@throws IllegalArgumentException thrown if parameters fail the validation... | [
"Update",
"a",
"domain",
".",
"Asynchronously",
"updates",
"a",
"domain",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java#L662-L669 |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlUtils.java | CmsXmlUtils.unmarshalHelper | public static Document unmarshalHelper(byte[] xmlData, EntityResolver resolver) throws CmsXmlException {
"""
Helper to unmarshal (read) xml contents from a byte array into a document.<p>
Using this method ensures that the OpenCms XML entity resolver is used.<p>
@param xmlData the XML data in a byte array
@p... | java | public static Document unmarshalHelper(byte[] xmlData, EntityResolver resolver) throws CmsXmlException {
return CmsXmlUtils.unmarshalHelper(new InputSource(new ByteArrayInputStream(xmlData)), resolver);
} | [
"public",
"static",
"Document",
"unmarshalHelper",
"(",
"byte",
"[",
"]",
"xmlData",
",",
"EntityResolver",
"resolver",
")",
"throws",
"CmsXmlException",
"{",
"return",
"CmsXmlUtils",
".",
"unmarshalHelper",
"(",
"new",
"InputSource",
"(",
"new",
"ByteArrayInputStre... | Helper to unmarshal (read) xml contents from a byte array into a document.<p>
Using this method ensures that the OpenCms XML entity resolver is used.<p>
@param xmlData the XML data in a byte array
@param resolver the XML entity resolver to use
@return the base object initialized with the unmarshalled XML document
@... | [
"Helper",
"to",
"unmarshal",
"(",
"read",
")",
"xml",
"contents",
"from",
"a",
"byte",
"array",
"into",
"a",
"document",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlUtils.java#L702-L705 |
xwiki/xwiki-commons | xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java | XARMojo.addFileElements | private void addFileElements(Collection<ArchiveEntry> files, Element filesElement) throws Exception {
"""
Add all the XML elements under the <files> element (the list of files present in the XAR).
@param files the list of files that we want to include in the generated package XML file.
@param filesElemen... | java | private void addFileElements(Collection<ArchiveEntry> files, Element filesElement) throws Exception
{
for (ArchiveEntry entry : files) {
// Don't add files in META-INF to the package.xml file
if (entry.getName().indexOf("META-INF") == -1) {
XWikiDocument xdoc = getDoc... | [
"private",
"void",
"addFileElements",
"(",
"Collection",
"<",
"ArchiveEntry",
">",
"files",
",",
"Element",
"filesElement",
")",
"throws",
"Exception",
"{",
"for",
"(",
"ArchiveEntry",
"entry",
":",
"files",
")",
"{",
"// Don't add files in META-INF to the package.xml... | Add all the XML elements under the <files> element (the list of files present in the XAR).
@param files the list of files that we want to include in the generated package XML file.
@param filesElement the files element to which to add to | [
"Add",
"all",
"the",
"XML",
"elements",
"under",
"the",
"<",
";",
"files>",
";",
"element",
"(",
"the",
"list",
"of",
"files",
"present",
"in",
"the",
"XAR",
")",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java#L366-L387 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/contentcensor/AipContentCensor.java | AipContentCensor.imageCensorUserDefined | public JSONObject imageCensorUserDefined(String image, EImgType type, HashMap<String, String> options) {
"""
图像审核接口
本接口除了支持自定义配置外,还对返回结果进行了总体的包装,按照用户在控制台中配置的规则直接返回是否合规,如果不合规则指出具体不合规的内容。
@param image 本地图片路径或图片url
@param type image参数类型:FILE或URL
@param options 可选参数
@return JSONObject
"""
if (type == ... | java | public JSONObject imageCensorUserDefined(String image, EImgType type, HashMap<String, String> options) {
if (type == EImgType.FILE) {
try {
byte[] imgData = Util.readFileByBytes(image);
return imageCensorUserDefined(imgData, options);
} catch (IOException ... | [
"public",
"JSONObject",
"imageCensorUserDefined",
"(",
"String",
"image",
",",
"EImgType",
"type",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"if",
"(",
"type",
"==",
"EImgType",
".",
"FILE",
")",
"{",
"try",
"{",
"byte",
"["... | 图像审核接口
本接口除了支持自定义配置外,还对返回结果进行了总体的包装,按照用户在控制台中配置的规则直接返回是否合规,如果不合规则指出具体不合规的内容。
@param image 本地图片路径或图片url
@param type image参数类型:FILE或URL
@param options 可选参数
@return JSONObject | [
"图像审核接口",
"本接口除了支持自定义配置外,还对返回结果进行了总体的包装,按照用户在控制台中配置的规则直接返回是否合规,如果不合规则指出具体不合规的内容。"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/contentcensor/AipContentCensor.java#L299-L315 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getGroupChar | private synchronized int getGroupChar(String name, int choice) {
"""
Getting the character with the tokenized argument name
@param name of the character
@return character with the tokenized argument name or -1 if character
is not found
"""
for (int i = 0; i < m_groupcount_; i ++) {
// po... | java | private synchronized int getGroupChar(String name, int choice)
{
for (int i = 0; i < m_groupcount_; i ++) {
// populating the data set of grouptable
int startgpstrindex = getGroupLengths(i, m_groupoffsets_,
m_grouplengths_);
... | [
"private",
"synchronized",
"int",
"getGroupChar",
"(",
"String",
"name",
",",
"int",
"choice",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"m_groupcount_",
";",
"i",
"++",
")",
"{",
"// populating the data set of grouptable",
"int",
"startgpst... | Getting the character with the tokenized argument name
@param name of the character
@return character with the tokenized argument name or -1 if character
is not found | [
"Getting",
"the",
"character",
"with",
"the",
"tokenized",
"argument",
"name"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L1213-L1230 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/EmulatedFieldsForDumping.java | EmulatedFieldsForDumping.put | @Override
public void put(String name, Object value) {
"""
Find and set the Object value of a given field named <code>name</code>
in the receiver.
@param name
A String, the name of the field to set
@param value
New value for the field.
"""
emulatedFields.put(name, value);
} | java | @Override
public void put(String name, Object value) {
emulatedFields.put(name, value);
} | [
"@",
"Override",
"public",
"void",
"put",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"emulatedFields",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Find and set the Object value of a given field named <code>name</code>
in the receiver.
@param name
A String, the name of the field to set
@param value
New value for the field. | [
"Find",
"and",
"set",
"the",
"Object",
"value",
"of",
"a",
"given",
"field",
"named",
"<code",
">",
"name<",
"/",
"code",
">",
"in",
"the",
"receiver",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/EmulatedFieldsForDumping.java#L152-L155 |
bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleGetFileContentWithMetaData | protected FileWrapper handleGetFileContentWithMetaData(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
"""
Makes the api call to get both the file content and filemeta data, and combines those two to a FileWrapper
@param type
@param entityId
@param fileId
@return
"""
FileWra... | java | protected FileWrapper handleGetFileContentWithMetaData(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
FileWrapper fileWrapper = null;
try {
FileContent fileContent = this.handleGetFileContent(type, entityId, fileId);
List<FileMeta> metaDataList = this.hand... | [
"protected",
"FileWrapper",
"handleGetFileContentWithMetaData",
"(",
"Class",
"<",
"?",
"extends",
"FileEntity",
">",
"type",
",",
"Integer",
"entityId",
",",
"Integer",
"fileId",
")",
"{",
"FileWrapper",
"fileWrapper",
"=",
"null",
";",
"try",
"{",
"FileContent",... | Makes the api call to get both the file content and filemeta data, and combines those two to a FileWrapper
@param type
@param entityId
@param fileId
@return | [
"Makes",
"the",
"api",
"call",
"to",
"get",
"both",
"the",
"file",
"content",
"and",
"filemeta",
"data",
"and",
"combines",
"those",
"two",
"to",
"a",
"FileWrapper"
] | train | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1549-L1569 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java | ContentSpecProcessor.doesInfoTopicMatch | protected boolean doesInfoTopicMatch(final InfoTopic infoTopic, final CSInfoNodeWrapper infoNode, final CSNodeWrapper parentNode) {
"""
Checks to see if a ContentSpec topic matches a Content Spec Entity topic.
@param infoTopic The ContentSpec topic object.
@param infoNode The Content Spec Entity topic.
@pa... | java | protected boolean doesInfoTopicMatch(final InfoTopic infoTopic, final CSInfoNodeWrapper infoNode, final CSNodeWrapper parentNode) {
if (infoNode == null && infoTopic != null) return false;
// If the unique id is not from the parser, in which case it will start with a number than use the unique id to co... | [
"protected",
"boolean",
"doesInfoTopicMatch",
"(",
"final",
"InfoTopic",
"infoTopic",
",",
"final",
"CSInfoNodeWrapper",
"infoNode",
",",
"final",
"CSNodeWrapper",
"parentNode",
")",
"{",
"if",
"(",
"infoNode",
"==",
"null",
"&&",
"infoTopic",
"!=",
"null",
")",
... | Checks to see if a ContentSpec topic matches a Content Spec Entity topic.
@param infoTopic The ContentSpec topic object.
@param infoNode The Content Spec Entity topic.
@param parentNode
@return True if the topic is determined to match otherwise false. | [
"Checks",
"to",
"see",
"if",
"a",
"ContentSpec",
"topic",
"matches",
"a",
"Content",
"Spec",
"Entity",
"topic",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java#L2155-L2165 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/processor/TableProcessor.java | TableProcessor.addRelationIntoMetadata | private void addRelationIntoMetadata(Class<?> entityClass, Field relationField, EntityMetadata metadata) {
"""
Adds relationship info into metadata for a given field
<code>relationField</code>.
@param entityClass
the entity class
@param relationField
the relation field
@param metadata
the metadata
"""... | java | private void addRelationIntoMetadata(Class<?> entityClass, Field relationField, EntityMetadata metadata)
{
RelationMetadataProcessor relProcessor = null;
try
{
relProcessor = RelationMetadataProcessorFactory
.getRelationMetadataProcessor(relationField, kundera... | [
"private",
"void",
"addRelationIntoMetadata",
"(",
"Class",
"<",
"?",
">",
"entityClass",
",",
"Field",
"relationField",
",",
"EntityMetadata",
"metadata",
")",
"{",
"RelationMetadataProcessor",
"relProcessor",
"=",
"null",
";",
"try",
"{",
"relProcessor",
"=",
"R... | Adds relationship info into metadata for a given field
<code>relationField</code>.
@param entityClass
the entity class
@param relationField
the relation field
@param metadata
the metadata | [
"Adds",
"relationship",
"info",
"into",
"metadata",
"for",
"a",
"given",
"field",
"<code",
">",
"relationField<",
"/",
"code",
">",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/processor/TableProcessor.java#L226-L251 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TimeZone.java | TimeZone.getOffset | public void getOffset(long date, boolean local, int[] offsets) {
"""
Returns the time zone raw and GMT offset for the given moment
in time. Upon return, local-millis = GMT-millis + rawOffset +
dstOffset. All computations are performed in the proleptic
Gregorian calendar. The default implementation in the Tim... | java | public void getOffset(long date, boolean local, int[] offsets) {
offsets[0] = getRawOffset();
if (!local) {
date += offsets[0]; // now in local standard millis
}
// When local == true, date might not be in local standard
// millis. getOffset taking 6 parameters used... | [
"public",
"void",
"getOffset",
"(",
"long",
"date",
",",
"boolean",
"local",
",",
"int",
"[",
"]",
"offsets",
")",
"{",
"offsets",
"[",
"0",
"]",
"=",
"getRawOffset",
"(",
")",
";",
"if",
"(",
"!",
"local",
")",
"{",
"date",
"+=",
"offsets",
"[",
... | Returns the time zone raw and GMT offset for the given moment
in time. Upon return, local-millis = GMT-millis + rawOffset +
dstOffset. All computations are performed in the proleptic
Gregorian calendar. The default implementation in the TimeZone
class delegates to the 8-argument getOffset().
@param date moment in t... | [
"Returns",
"the",
"time",
"zone",
"raw",
"and",
"GMT",
"offset",
"for",
"the",
"given",
"moment",
"in",
"time",
".",
"Upon",
"return",
"local",
"-",
"millis",
"=",
"GMT",
"-",
"millis",
"+",
"rawOffset",
"+",
"dstOffset",
".",
"All",
"computations",
"are... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TimeZone.java#L295-L326 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java | PageFlowRequestProcessor.processActionOverride | protected boolean processActionOverride( HttpServletRequest request, HttpServletResponse response )
throws IOException, ServletException {
"""
The requested action can be overridden by a request parameter. In this case, we parse the action from
the request parameter and forward to a URI constructed from ... | java | protected boolean processActionOverride( HttpServletRequest request, HttpServletResponse response )
throws IOException, ServletException
{
// Only make this check if this is an initial (non-forwarded) request.
//
// TODO: performance?
//
PageFlowRequestWrapper wrapper... | [
"protected",
"boolean",
"processActionOverride",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"// Only make this check if this is an initial (non-forwarded) request.",
"//",
"// TODO: perfo... | The requested action can be overridden by a request parameter. In this case, we parse the action from
the request parameter and forward to a URI constructed from it.
@param request the current HttpServletRequest
@param response the current HttpServletResponse
@return <code>true</code> if the action was overridden by ... | [
"The",
"requested",
"action",
"can",
"be",
"overridden",
"by",
"a",
"request",
"parameter",
".",
"In",
"this",
"case",
"we",
"parse",
"the",
"action",
"from",
"the",
"request",
"parameter",
"and",
"forward",
"to",
"a",
"URI",
"constructed",
"from",
"it",
"... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java#L344-L386 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.retrieveData | public String retrieveData(String baseData, String type) {
"""
Returns the information contained in file passed as parameter
@param baseData path to file to be read
@param type type of information, it can be: json|string
@return String
"""
String result;
InputStream stream = getClass(... | java | public String retrieveData(String baseData, String type) {
String result;
InputStream stream = getClass().getClassLoader().getResourceAsStream(baseData);
Writer writer = new StringWriter();
char[] buffer = new char[1024];
Reader reader;
if (stream == null) {
... | [
"public",
"String",
"retrieveData",
"(",
"String",
"baseData",
",",
"String",
"type",
")",
"{",
"String",
"result",
";",
"InputStream",
"stream",
"=",
"getClass",
"(",
")",
".",
"getClassLoader",
"(",
")",
".",
"getResourceAsStream",
"(",
"baseData",
")",
";... | Returns the information contained in file passed as parameter
@param baseData path to file to be read
@param type type of information, it can be: json|string
@return String | [
"Returns",
"the",
"information",
"contained",
"in",
"file",
"passed",
"as",
"parameter"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L669-L709 |
shekhargulati/strman-java | src/main/java/strman/Strman.java | Strman.endsWith | public static boolean endsWith(final String value, final String search, final boolean caseSensitive) {
"""
Test if value ends with search.
@param value input string
@param search string to search
@param caseSensitive true or false
@return true or false
"""
validate(value, NULL_STRI... | java | public static boolean endsWith(final String value, final String search, final boolean caseSensitive) {
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
return endsWith(value, search, value.length(), caseSensitive);
} | [
"public",
"static",
"boolean",
"endsWith",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"search",
",",
"final",
"boolean",
"caseSensitive",
")",
"{",
"validate",
"(",
"value",
",",
"NULL_STRING_PREDICATE",
",",
"NULL_STRING_MSG_SUPPLIER",
")",
";",
"... | Test if value ends with search.
@param value input string
@param search string to search
@param caseSensitive true or false
@return true or false | [
"Test",
"if",
"value",
"ends",
"with",
"search",
"."
] | train | https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L269-L272 |
opendatatrentino/s-match | src/main/java/it/unitn/disi/smatch/preprocessors/DefaultContextPreprocessor.java | DefaultContextPreprocessor.isNumber | private boolean isNumber(String in1) {
"""
Checks whether input string contains a number or not.
@param in1 input string
@return false if it contains a number
"""
//noinspection LoopStatementThatDoesntLoop
for (StringTokenizer stringTokenizer = new StringTokenizer(in1, numberCharacters); ... | java | private boolean isNumber(String in1) {
//noinspection LoopStatementThatDoesntLoop
for (StringTokenizer stringTokenizer = new StringTokenizer(in1, numberCharacters); stringTokenizer.hasMoreTokens(); ) {
return false;
}
return true;
} | [
"private",
"boolean",
"isNumber",
"(",
"String",
"in1",
")",
"{",
"//noinspection LoopStatementThatDoesntLoop\r",
"for",
"(",
"StringTokenizer",
"stringTokenizer",
"=",
"new",
"StringTokenizer",
"(",
"in1",
",",
"numberCharacters",
")",
";",
"stringTokenizer",
".",
"h... | Checks whether input string contains a number or not.
@param in1 input string
@return false if it contains a number | [
"Checks",
"whether",
"input",
"string",
"contains",
"a",
"number",
"or",
"not",
"."
] | train | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/smatch/preprocessors/DefaultContextPreprocessor.java#L736-L742 |
Pi4J/pi4j | pi4j-device/src/main/java/com/pi4j/component/potentiometer/microchip/impl/MicrochipPotentiometerDeviceController.java | MicrochipPotentiometerDeviceController.getValue | public int getValue(final DeviceControllerChannel channel, final boolean nonVolatile)
throws IOException {
"""
Receives the current wiper's value from the device.
@param channel Which wiper
@param nonVolatile volatile or non-volatile value
@return The wiper's value
@throws IOException Thrown if communicat... | java | public int getValue(final DeviceControllerChannel channel, final boolean nonVolatile)
throws IOException {
if (channel == null) {
throw new RuntimeException("null-channel is not allowed. For devices "
+ "knowing just one wiper Channel.A is mandatory for "
+ "parameter 'channel'");
}
// choose pr... | [
"public",
"int",
"getValue",
"(",
"final",
"DeviceControllerChannel",
"channel",
",",
"final",
"boolean",
"nonVolatile",
")",
"throws",
"IOException",
"{",
"if",
"(",
"channel",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"null-channel is no... | Receives the current wiper's value from the device.
@param channel Which wiper
@param nonVolatile volatile or non-volatile value
@return The wiper's value
@throws IOException Thrown if communication fails or device returned a malformed result | [
"Receives",
"the",
"current",
"wiper",
"s",
"value",
"from",
"the",
"device",
"."
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-device/src/main/java/com/pi4j/component/potentiometer/microchip/impl/MicrochipPotentiometerDeviceController.java#L205-L224 |
rnorth/visible-assertions | src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java | VisibleAssertions.assertEquals | public static void assertEquals(String message, Object expected, Object actual) {
"""
Assert that an actual value is equal to an expected value.
<p>
Equality is tested with the standard Object equals() method, unless both values are null.
<p>
If the assertion passes, a green tick will be shown. If the assertio... | java | public static void assertEquals(String message, Object expected, Object actual) {
String expectedInQuotes = inQuotesIfNotNull(expected);
String actualInQuotes = inQuotesIfNotNull(actual);
if (areBothNull(expected, actual)) {
pass(message);
} else if (isObjectEquals(expected... | [
"public",
"static",
"void",
"assertEquals",
"(",
"String",
"message",
",",
"Object",
"expected",
",",
"Object",
"actual",
")",
"{",
"String",
"expectedInQuotes",
"=",
"inQuotesIfNotNull",
"(",
"expected",
")",
";",
"String",
"actualInQuotes",
"=",
"inQuotesIfNotNu... | Assert that an actual value is equal to an expected value.
<p>
Equality is tested with the standard Object equals() method, unless both values are null.
<p>
If the assertion passes, a green tick will be shown. If the assertion fails, a red cross will be shown.
@param message message to display alongside the assertion... | [
"Assert",
"that",
"an",
"actual",
"value",
"is",
"equal",
"to",
"an",
"expected",
"value",
".",
"<p",
">",
"Equality",
"is",
"tested",
"with",
"the",
"standard",
"Object",
"equals",
"()",
"method",
"unless",
"both",
"values",
"are",
"null",
".",
"<p",
">... | train | https://github.com/rnorth/visible-assertions/blob/6d7a7724db40ac0e9f87279553f814b790310b3b/src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java#L160-L176 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/ResourceUtils.java | ResourceUtils.prepareClasspathResourceIfNeeded | public static Resource prepareClasspathResourceIfNeeded(final Resource resource) {
"""
Prepare classpath resource if needed file.
@param resource the resource
@return the file
"""
if (resource == null) {
LOGGER.debug("No resource defined to prepare. Returning null");
return ... | java | public static Resource prepareClasspathResourceIfNeeded(final Resource resource) {
if (resource == null) {
LOGGER.debug("No resource defined to prepare. Returning null");
return null;
}
return prepareClasspathResourceIfNeeded(resource, false, resource.getFilename());
... | [
"public",
"static",
"Resource",
"prepareClasspathResourceIfNeeded",
"(",
"final",
"Resource",
"resource",
")",
"{",
"if",
"(",
"resource",
"==",
"null",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"No resource defined to prepare. Returning null\"",
")",
";",
"return",
... | Prepare classpath resource if needed file.
@param resource the resource
@return the file | [
"Prepare",
"classpath",
"resource",
"if",
"needed",
"file",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/ResourceUtils.java#L138-L144 |
Whiley/WhileyCompiler | src/main/java/wyil/type/subtyping/SubtypeOperator.java | SubtypeOperator.isContractive | public boolean isContractive(QualifiedName nid, Type type) {
"""
<p>
Contractive types are types which cannot accept value because they have an
<i>unterminated cycle</i>. An unterminated cycle has no leaf nodes
terminating it. For example, <code>X<{X field}></code> is contractive, where
as <code>X<{null|X fiel... | java | public boolean isContractive(QualifiedName nid, Type type) {
HashSet<QualifiedName> visited = new HashSet<>();
return isContractive(nid, type, visited);
} | [
"public",
"boolean",
"isContractive",
"(",
"QualifiedName",
"nid",
",",
"Type",
"type",
")",
"{",
"HashSet",
"<",
"QualifiedName",
">",
"visited",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"return",
"isContractive",
"(",
"nid",
",",
"type",
",",
"visited... | <p>
Contractive types are types which cannot accept value because they have an
<i>unterminated cycle</i>. An unterminated cycle has no leaf nodes
terminating it. For example, <code>X<{X field}></code> is contractive, where
as <code>X<{null|X field}></code> is not.
</p>
<p>
This method returns true if the type is contr... | [
"<p",
">",
"Contractive",
"types",
"are",
"types",
"which",
"cannot",
"accept",
"value",
"because",
"they",
"have",
"an",
"<i",
">",
"unterminated",
"cycle<",
"/",
"i",
">",
".",
"An",
"unterminated",
"cycle",
"has",
"no",
"leaf",
"nodes",
"terminating",
"... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/type/subtyping/SubtypeOperator.java#L165-L168 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGraph.java | ManagementGraph.getOutputGroupVertex | public ManagementGroupVertex getOutputGroupVertex(final int stage, final int index) {
"""
Returns the output group vertex at the given index in the given stage.
@param stage
the index to the management stage
@param index
the index to the output group vertex
@return the output group vertex at the given index... | java | public ManagementGroupVertex getOutputGroupVertex(final int stage, final int index) {
if (stage >= this.stages.size()) {
return null;
}
return this.stages.get(stage).getOutputGroupVertex(index);
} | [
"public",
"ManagementGroupVertex",
"getOutputGroupVertex",
"(",
"final",
"int",
"stage",
",",
"final",
"int",
"index",
")",
"{",
"if",
"(",
"stage",
">=",
"this",
".",
"stages",
".",
"size",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"this... | Returns the output group vertex at the given index in the given stage.
@param stage
the index to the management stage
@param index
the index to the output group vertex
@return the output group vertex at the given index in the given stage or <code>null</code> if either the stage
does not exists or the given index is in... | [
"Returns",
"the",
"output",
"group",
"vertex",
"at",
"the",
"given",
"index",
"in",
"the",
"given",
"stage",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGraph.java#L239-L246 |
code4everything/util | src/main/java/com/zhazhapan/util/Utils.java | Utils.leftTrim | public static String leftTrim(String value, String leftTrim) {
"""
裁剪字符串
@param value 值
@param leftTrim 需要裁剪的值
@return 裁剪后的字符串
@since 1.0.8
"""
if (Checker.isEmpty(value) || Checker.isEmpty(leftTrim)) {
return value;
}
return value.indexOf(leftTrim) == 0 ? leftTrim... | java | public static String leftTrim(String value, String leftTrim) {
if (Checker.isEmpty(value) || Checker.isEmpty(leftTrim)) {
return value;
}
return value.indexOf(leftTrim) == 0 ? leftTrim(value.substring(leftTrim.length()), leftTrim) : value;
} | [
"public",
"static",
"String",
"leftTrim",
"(",
"String",
"value",
",",
"String",
"leftTrim",
")",
"{",
"if",
"(",
"Checker",
".",
"isEmpty",
"(",
"value",
")",
"||",
"Checker",
".",
"isEmpty",
"(",
"leftTrim",
")",
")",
"{",
"return",
"value",
";",
"}"... | 裁剪字符串
@param value 值
@param leftTrim 需要裁剪的值
@return 裁剪后的字符串
@since 1.0.8 | [
"裁剪字符串"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Utils.java#L154-L159 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFSUtils.java | VFSUtils.copyChildrenRecursive | public static void copyChildrenRecursive(VirtualFile original, VirtualFile target) throws IOException {
"""
Copy all the children from the original {@link VirtualFile} the target recursively.
@param original the file to copy children from
@param target the file to copy the children to
@throws IOException if... | java | public static void copyChildrenRecursive(VirtualFile original, VirtualFile target) throws IOException {
if (original == null) {
throw MESSAGES.nullArgument("Original VirtualFile");
}
if (target == null) {
throw MESSAGES.nullArgument("Target VirtualFile");
}
... | [
"public",
"static",
"void",
"copyChildrenRecursive",
"(",
"VirtualFile",
"original",
",",
"VirtualFile",
"target",
")",
"throws",
"IOException",
"{",
"if",
"(",
"original",
"==",
"null",
")",
"{",
"throw",
"MESSAGES",
".",
"nullArgument",
"(",
"\"Original VirtualF... | Copy all the children from the original {@link VirtualFile} the target recursively.
@param original the file to copy children from
@param target the file to copy the children to
@throws IOException if any problems occur copying the files | [
"Copy",
"all",
"the",
"children",
"from",
"the",
"original",
"{",
"@link",
"VirtualFile",
"}",
"the",
"target",
"recursively",
"."
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L352-L374 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsm.java | XsdAsm.generateClassFromElements | public void generateClassFromElements(Stream<XsdElement> elements, String apiName) {
"""
This method is the entry point for the class creation process.
It receives all the {@link XsdAbstractElement} objects and creates the necessary infrastructure for the
generated fluent interface, the required interfaces, visi... | java | public void generateClassFromElements(Stream<XsdElement> elements, String apiName){
createGeneratedFilesDirectory(apiName);
createSupportingInfrastructure(apiName);
List<XsdElement> elementList = elements.collect(Collectors.toList());
interfaceGenerator.addCreatedElements(elementList)... | [
"public",
"void",
"generateClassFromElements",
"(",
"Stream",
"<",
"XsdElement",
">",
"elements",
",",
"String",
"apiName",
")",
"{",
"createGeneratedFilesDirectory",
"(",
"apiName",
")",
";",
"createSupportingInfrastructure",
"(",
"apiName",
")",
";",
"List",
"<",
... | This method is the entry point for the class creation process.
It receives all the {@link XsdAbstractElement} objects and creates the necessary infrastructure for the
generated fluent interface, the required interfaces, visitor and all the classes based on the elements received.
@param elements The elements which will ... | [
"This",
"method",
"is",
"the",
"entry",
"point",
"for",
"the",
"class",
"creation",
"process",
".",
"It",
"receives",
"all",
"the",
"{"
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsm.java#L38-L58 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksClient.java | CloudTasksClient.acknowledgeTask | public final void acknowledgeTask(TaskName name, Timestamp scheduleTime) {
"""
Acknowledges a pull task.
<p>The worker, that is, the entity that
[leased][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] this task must call this method to
indicate that the work associated with the task has finished.
<p>The... | java | public final void acknowledgeTask(TaskName name, Timestamp scheduleTime) {
AcknowledgeTaskRequest request =
AcknowledgeTaskRequest.newBuilder()
.setName(name == null ? null : name.toString())
.setScheduleTime(scheduleTime)
.build();
acknowledgeTask(request);
} | [
"public",
"final",
"void",
"acknowledgeTask",
"(",
"TaskName",
"name",
",",
"Timestamp",
"scheduleTime",
")",
"{",
"AcknowledgeTaskRequest",
"request",
"=",
"AcknowledgeTaskRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
"==",
"null",
"?",
"n... | Acknowledges a pull task.
<p>The worker, that is, the entity that
[leased][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] this task must call this method to
indicate that the work associated with the task has finished.
<p>The worker must acknowledge a task within the
[lease_duration][google.cloud.tasks.v2beta2.Lea... | [
"Acknowledges",
"a",
"pull",
"task",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksClient.java#L2196-L2204 |
liuyukuai/commons | commons-core/src/main/java/com/itxiaoer/commons/core/date/LocalDateUtil.java | LocalDateUtil.parse | public static LocalDate parse(String localDate, String pattern) {
"""
格式化时间
@param localDate 时间
@param pattern 时间格式
@return 时间字符串
"""
return LocalDate.from(DateTimeFormatter.ofPattern(pattern).parse(localDate));
} | java | public static LocalDate parse(String localDate, String pattern) {
return LocalDate.from(DateTimeFormatter.ofPattern(pattern).parse(localDate));
} | [
"public",
"static",
"LocalDate",
"parse",
"(",
"String",
"localDate",
",",
"String",
"pattern",
")",
"{",
"return",
"LocalDate",
".",
"from",
"(",
"DateTimeFormatter",
".",
"ofPattern",
"(",
"pattern",
")",
".",
"parse",
"(",
"localDate",
")",
")",
";",
"}... | 格式化时间
@param localDate 时间
@param pattern 时间格式
@return 时间字符串 | [
"格式化时间"
] | train | https://github.com/liuyukuai/commons/blob/ba67eddb542446b12f419f1866dbaa82e47fbf35/commons-core/src/main/java/com/itxiaoer/commons/core/date/LocalDateUtil.java#L119-L121 |
OpenLiberty/open-liberty | dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/TopicBasedCache.java | TopicBasedCache.setStageTopics | synchronized void setStageTopics(String stageName, String[] topics) {
"""
Set the list of topics to be associated with the specified work stage.
@param stageName
the work stage name
@param topics
the topics associated with the work stage
"""
for (String t : topics) {
if (t.equals("*")... | java | synchronized void setStageTopics(String stageName, String[] topics) {
for (String t : topics) {
if (t.equals("*")) {
wildcardStageTopics.put("", stageName);
} else if (t.endsWith("/*")) {
wildcardStageTopics.put(t.substring(0, t.length() - 1), stageName);
... | [
"synchronized",
"void",
"setStageTopics",
"(",
"String",
"stageName",
",",
"String",
"[",
"]",
"topics",
")",
"{",
"for",
"(",
"String",
"t",
":",
"topics",
")",
"{",
"if",
"(",
"t",
".",
"equals",
"(",
"\"*\"",
")",
")",
"{",
"wildcardStageTopics",
".... | Set the list of topics to be associated with the specified work stage.
@param stageName
the work stage name
@param topics
the topics associated with the work stage | [
"Set",
"the",
"list",
"of",
"topics",
"to",
"be",
"associated",
"with",
"the",
"specified",
"work",
"stage",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/TopicBasedCache.java#L95-L108 |
Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java | TheTVDBApi.getSeries | public Series getSeries(String id, String language) throws TvDbException {
"""
Get the series information
@param id
@param language
@return
@throws com.omertron.thetvdbapi.TvDbException
"""
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(BASE_URL)
.appe... | java | public Series getSeries(String id, String language) throws TvDbException {
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(BASE_URL)
.append(apiKey)
.append(SERIES_URL)
.append(id)
.append("/");
if (StringU... | [
"public",
"Series",
"getSeries",
"(",
"String",
"id",
",",
"String",
"language",
")",
"throws",
"TvDbException",
"{",
"StringBuilder",
"urlBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"urlBuilder",
".",
"append",
"(",
"BASE_URL",
")",
".",
"append",
... | Get the series information
@param id
@param language
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"the",
"series",
"information"
] | train | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java#L96-L114 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStats.java | UicStats.addStats | private void addStats(final Map<WComponent, Stat> statsMap, final WComponent comp) {
"""
Recursively adds statistics for a component and its children to the stats map.
@param statsMap the stats map to add to.
@param comp the component to analyse.
"""
Stat stat = createStat(comp);
statsMap.put(comp, sta... | java | private void addStats(final Map<WComponent, Stat> statsMap, final WComponent comp) {
Stat stat = createStat(comp);
statsMap.put(comp, stat);
if (comp instanceof Container) {
Container container = (Container) comp;
int childCount = container.getChildCount();
for (int i = 0; i < childCount; i++) {
WC... | [
"private",
"void",
"addStats",
"(",
"final",
"Map",
"<",
"WComponent",
",",
"Stat",
">",
"statsMap",
",",
"final",
"WComponent",
"comp",
")",
"{",
"Stat",
"stat",
"=",
"createStat",
"(",
"comp",
")",
";",
"statsMap",
".",
"put",
"(",
"comp",
",",
"stat... | Recursively adds statistics for a component and its children to the stats map.
@param statsMap the stats map to add to.
@param comp the component to analyse. | [
"Recursively",
"adds",
"statistics",
"for",
"a",
"component",
"and",
"its",
"children",
"to",
"the",
"stats",
"map",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStats.java#L147-L160 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/classification/statistics/ContinuousDistributions.java | ContinuousDistributions.Gser | protected static double Gser(double x, double A) {
"""
Internal function used by GammaCdf
@param x
@param A
@return
"""
// Good for X<A+1.
double T9 = 1 / A;
double G = T9;
double I = 1;
while (T9 > G * 0.00001)
{
T9 = T9 * x / (A + I);
... | java | protected static double Gser(double x, double A)
{
// Good for X<A+1.
double T9 = 1 / A;
double G = T9;
double I = 1;
while (T9 > G * 0.00001)
{
T9 = T9 * x / (A + I);
G = G + T9;
++I;
}
G = G * Math.exp(A * Math.log... | [
"protected",
"static",
"double",
"Gser",
"(",
"double",
"x",
",",
"double",
"A",
")",
"{",
"// Good for X<A+1.",
"double",
"T9",
"=",
"1",
"/",
"A",
";",
"double",
"G",
"=",
"T9",
";",
"double",
"I",
"=",
"1",
";",
"while",
"(",
"T9",
">",
"G",
"... | Internal function used by GammaCdf
@param x
@param A
@return | [
"Internal",
"function",
"used",
"by",
"GammaCdf"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/classification/statistics/ContinuousDistributions.java#L159-L174 |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java | QuadTreeNode.setChildAt | public boolean setChildAt(QuadTreeZone zone, N newChild) {
"""
Set the child at the specified zone.
@param zone is the zone to set
@param newChild is the new node for the given zone
@return <code>true</code> on success, <code>false</code> otherwise
"""
switch (zone) {
case NORTH_WEST:
return setFir... | java | public boolean setChildAt(QuadTreeZone zone, N newChild) {
switch (zone) {
case NORTH_WEST:
return setFirstChild(newChild);
case NORTH_EAST:
return setSecondChild(newChild);
case SOUTH_WEST:
return setThirdChild(newChild);
case SOUTH_EAST:
return setFourthChild(newChild);
default:
}
return f... | [
"public",
"boolean",
"setChildAt",
"(",
"QuadTreeZone",
"zone",
",",
"N",
"newChild",
")",
"{",
"switch",
"(",
"zone",
")",
"{",
"case",
"NORTH_WEST",
":",
"return",
"setFirstChild",
"(",
"newChild",
")",
";",
"case",
"NORTH_EAST",
":",
"return",
"setSecondC... | Set the child at the specified zone.
@param zone is the zone to set
@param newChild is the new node for the given zone
@return <code>true</code> on success, <code>false</code> otherwise | [
"Set",
"the",
"child",
"at",
"the",
"specified",
"zone",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/QuadTreeNode.java#L457-L470 |
groupon/monsoon | expr/src/main/java/com/groupon/lex/metrics/PathMatcher.java | PathMatcher.valueOf | public static PathMatcher valueOf(Reader reader) throws IOException, ParseException {
"""
Read path matcher from reader.
@param reader A reader supplying the input of a path expression.
@return A PathMatcher corresponding to the parsed input
from the reader.
@throws IOException on IO errors from the reader.
... | java | public static PathMatcher valueOf(Reader reader) throws IOException, ParseException {
class DescriptiveErrorListener extends BaseErrorListener {
public List<String> errors = new ArrayList<>();
@Override
public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSym... | [
"public",
"static",
"PathMatcher",
"valueOf",
"(",
"Reader",
"reader",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"class",
"DescriptiveErrorListener",
"extends",
"BaseErrorListener",
"{",
"public",
"List",
"<",
"String",
">",
"errors",
"=",
"new",
"... | Read path matcher from reader.
@param reader A reader supplying the input of a path expression.
@return A PathMatcher corresponding to the parsed input
from the reader.
@throws IOException on IO errors from the reader.
@throws
com.groupon.lex.metrics.PathMatcher.ParseException
on invalid path expression. | [
"Read",
"path",
"matcher",
"from",
"reader",
"."
] | train | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/expr/src/main/java/com/groupon/lex/metrics/PathMatcher.java#L405-L447 |
tipsy/javalin | src/main/java/io/javalin/Javalin.java | Javalin.addWsHandler | private Javalin addWsHandler(@NotNull WsHandlerType handlerType, @NotNull String path, @NotNull Consumer<WsHandler> wsHandler) {
"""
Adds a specific WebSocket handler for the given path to the instance.
"""
return addWsHandler(handlerType, path, wsHandler, new HashSet<>());
} | java | private Javalin addWsHandler(@NotNull WsHandlerType handlerType, @NotNull String path, @NotNull Consumer<WsHandler> wsHandler) {
return addWsHandler(handlerType, path, wsHandler, new HashSet<>());
} | [
"private",
"Javalin",
"addWsHandler",
"(",
"@",
"NotNull",
"WsHandlerType",
"handlerType",
",",
"@",
"NotNull",
"String",
"path",
",",
"@",
"NotNull",
"Consumer",
"<",
"WsHandler",
">",
"wsHandler",
")",
"{",
"return",
"addWsHandler",
"(",
"handlerType",
",",
... | Adds a specific WebSocket handler for the given path to the instance. | [
"Adds",
"a",
"specific",
"WebSocket",
"handler",
"for",
"the",
"given",
"path",
"to",
"the",
"instance",
"."
] | train | https://github.com/tipsy/javalin/blob/68b2f7592f237db1c2b597e645697eb75fdaee53/src/main/java/io/javalin/Javalin.java#L514-L516 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java | ClustersInner.beginUpdateGatewaySettings | public void beginUpdateGatewaySettings(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) {
"""
Configures the gateway settings on the specified cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param parameter... | java | public void beginUpdateGatewaySettings(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) {
beginUpdateGatewaySettingsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body();
} | [
"public",
"void",
"beginUpdateGatewaySettings",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"UpdateGatewaySettingsParameters",
"parameters",
")",
"{",
"beginUpdateGatewaySettingsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
... | Configures the gateway settings on the specified cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param parameters The cluster configurations.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if... | [
"Configures",
"the",
"gateway",
"settings",
"on",
"the",
"specified",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java#L1625-L1627 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/sql/planner/LiteralEncoder.java | LiteralEncoder.toRowExpression | public static RowExpression toRowExpression(Object object, Type type) {
"""
Unlike toExpression, toRowExpression should be very straightforward given object is serializable
"""
requireNonNull(type, "type is null");
if (object instanceof RowExpression) {
return (RowExpression) objec... | java | public static RowExpression toRowExpression(Object object, Type type)
{
requireNonNull(type, "type is null");
if (object instanceof RowExpression) {
return (RowExpression) object;
}
if (object == null) {
return constantNull(type);
}
return c... | [
"public",
"static",
"RowExpression",
"toRowExpression",
"(",
"Object",
"object",
",",
"Type",
"type",
")",
"{",
"requireNonNull",
"(",
"type",
",",
"\"type is null\"",
")",
";",
"if",
"(",
"object",
"instanceof",
"RowExpression",
")",
"{",
"return",
"(",
"RowE... | Unlike toExpression, toRowExpression should be very straightforward given object is serializable | [
"Unlike",
"toExpression",
"toRowExpression",
"should",
"be",
"very",
"straightforward",
"given",
"object",
"is",
"serializable"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/sql/planner/LiteralEncoder.java#L101-L114 |
alipay/sofa-rpc | extension-impl/fault-tolerance/src/main/java/com/alipay/sofa/rpc/client/aft/impl/ServiceHorizontalMeasureStrategy.java | ServiceHorizontalMeasureStrategy.getInvocationLeastWindowCount | private long getInvocationLeastWindowCount(InvocationStat invocationStat, Integer weight, long leastWindowCount) {
"""
根据Invocation的实际权重计算该Invocation的实际最小窗口调用次数 如果目标地址原始权重为0,或者地址已经被剔除则返回-1。
@param invocationStat InvocationStat
@param weight weight
@param leastWindowCount original least Window count
@return l... | java | private long getInvocationLeastWindowCount(InvocationStat invocationStat, Integer weight, long leastWindowCount) {
InvocationStatDimension statDimension = invocationStat.getDimension();
Integer originWeight = statDimension.getOriginWeight();
if (originWeight == 0) {
LOGGER.errorWithA... | [
"private",
"long",
"getInvocationLeastWindowCount",
"(",
"InvocationStat",
"invocationStat",
",",
"Integer",
"weight",
",",
"long",
"leastWindowCount",
")",
"{",
"InvocationStatDimension",
"statDimension",
"=",
"invocationStat",
".",
"getDimension",
"(",
")",
";",
"Inte... | 根据Invocation的实际权重计算该Invocation的实际最小窗口调用次数 如果目标地址原始权重为0,或者地址已经被剔除则返回-1。
@param invocationStat InvocationStat
@param weight weight
@param leastWindowCount original least Window count
@return leastWindowCount | [
"根据Invocation的实际权重计算该Invocation的实际最小窗口调用次数",
"如果目标地址原始权重为0,或者地址已经被剔除则返回",
"-",
"1。"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/fault-tolerance/src/main/java/com/alipay/sofa/rpc/client/aft/impl/ServiceHorizontalMeasureStrategy.java#L294-L312 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/notifier/AuditNotifier.java | AuditNotifier.getTriggerDetails | protected String getTriggerDetails(Trigger trigger, NotificationContext context) {
"""
Returns the trigger detail information.
@param trigger The source trigger.
@return The trigger detail information.
"""
if (trigger != null) {
String triggerString = trigger.toString();
triggerString = Templ... | java | protected String getTriggerDetails(Trigger trigger, NotificationContext context) {
if (trigger != null) {
String triggerString = trigger.toString();
triggerString = TemplateReplacer.applyTemplateChanges(context, triggerString);
return triggerString.substring(triggerString.indexOf("{") + 1, triggerString.ind... | [
"protected",
"String",
"getTriggerDetails",
"(",
"Trigger",
"trigger",
",",
"NotificationContext",
"context",
")",
"{",
"if",
"(",
"trigger",
"!=",
"null",
")",
"{",
"String",
"triggerString",
"=",
"trigger",
".",
"toString",
"(",
")",
";",
"triggerString",
"=... | Returns the trigger detail information.
@param trigger The source trigger.
@return The trigger detail information. | [
"Returns",
"the",
"trigger",
"detail",
"information",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/notifier/AuditNotifier.java#L198-L207 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/http/HttpHeaderMap.java | HttpHeaderMap.setLongHeader | public void setLongHeader (@Nonnull @Nonempty final String sName, final long nValue) {
"""
Set the passed header as a number.
@param sName
Header name. May neither be <code>null</code> nor empty.
@param nValue
The value to be set. May not be <code>null</code>.
"""
_setHeader (sName, Long.toString (nV... | java | public void setLongHeader (@Nonnull @Nonempty final String sName, final long nValue)
{
_setHeader (sName, Long.toString (nValue));
} | [
"public",
"void",
"setLongHeader",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sName",
",",
"final",
"long",
"nValue",
")",
"{",
"_setHeader",
"(",
"sName",
",",
"Long",
".",
"toString",
"(",
"nValue",
")",
")",
";",
"}"
] | Set the passed header as a number.
@param sName
Header name. May neither be <code>null</code> nor empty.
@param nValue
The value to be set. May not be <code>null</code>. | [
"Set",
"the",
"passed",
"header",
"as",
"a",
"number",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/http/HttpHeaderMap.java#L369-L372 |
google/error-prone | check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/NullnessPropagationTransfer.java | NullnessPropagationTransfer.visitFieldAccess | @Override
Nullness visitFieldAccess(
FieldAccessNode node, Updates updates, AccessPathValues<Nullness> store) {
"""
Refines the receiver of a field access to type non-null after a successful field access, and
refines the value of the expression as a whole to non-null if applicable (e.g., if the field
has... | java | @Override
Nullness visitFieldAccess(
FieldAccessNode node, Updates updates, AccessPathValues<Nullness> store) {
if (!node.isStatic()) {
setNonnullIfTrackable(updates, node.getReceiver());
}
ClassAndField accessed = tryGetFieldSymbol(node.getTree());
return fieldNullness(accessed, AccessPat... | [
"@",
"Override",
"Nullness",
"visitFieldAccess",
"(",
"FieldAccessNode",
"node",
",",
"Updates",
"updates",
",",
"AccessPathValues",
"<",
"Nullness",
">",
"store",
")",
"{",
"if",
"(",
"!",
"node",
".",
"isStatic",
"(",
")",
")",
"{",
"setNonnullIfTrackable",
... | Refines the receiver of a field access to type non-null after a successful field access, and
refines the value of the expression as a whole to non-null if applicable (e.g., if the field
has a primitive type or the {@code store}) has a non-null value for this access path.
<p>Note: If the field access occurs when the no... | [
"Refines",
"the",
"receiver",
"of",
"a",
"field",
"access",
"to",
"type",
"non",
"-",
"null",
"after",
"a",
"successful",
"field",
"access",
"and",
"refines",
"the",
"value",
"of",
"the",
"expression",
"as",
"a",
"whole",
"to",
"non",
"-",
"null",
"if",
... | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/NullnessPropagationTransfer.java#L535-L543 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneIconifyButtonPainter.java | TitlePaneIconifyButtonPainter.paintMinimizePressed | private void paintMinimizePressed(Graphics2D g, JComponent c, int width, int height) {
"""
Paint the foreground minimize button pressed state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component.
... | java | private void paintMinimizePressed(Graphics2D g, JComponent c, int width, int height) {
iconifyPainter.paintPressed(g, c, width, height);
} | [
"private",
"void",
"paintMinimizePressed",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"iconifyPainter",
".",
"paintPressed",
"(",
"g",
",",
"c",
",",
"width",
",",
"height",
")",
";",
"}"
] | Paint the foreground minimize button pressed state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component. | [
"Paint",
"the",
"foreground",
"minimize",
"button",
"pressed",
"state",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneIconifyButtonPainter.java#L195-L197 |
threerings/nenya | core/src/main/java/com/threerings/geom/GeomUtil.java | GeomUtil.shiftToContain | public static void shiftToContain (Rectangle tainer, Rectangle tained) {
"""
Shifts the position of the <code>tainer</code> rectangle to ensure that it contains the
<code>tained</code> rectangle. The <code>tainer</code> rectangle must be larger than or
equal to the size of the <code>tained</code> rectangle.
... | java | public static void shiftToContain (Rectangle tainer, Rectangle tained)
{
if (tained.x < tainer.x) {
tainer.x = tained.x;
}
if (tained.y < tainer.y) {
tainer.y = tained.y;
}
if (tained.x + tained.width > tainer.x + tainer.width) {
tainer.x =... | [
"public",
"static",
"void",
"shiftToContain",
"(",
"Rectangle",
"tainer",
",",
"Rectangle",
"tained",
")",
"{",
"if",
"(",
"tained",
".",
"x",
"<",
"tainer",
".",
"x",
")",
"{",
"tainer",
".",
"x",
"=",
"tained",
".",
"x",
";",
"}",
"if",
"(",
"tai... | Shifts the position of the <code>tainer</code> rectangle to ensure that it contains the
<code>tained</code> rectangle. The <code>tainer</code> rectangle must be larger than or
equal to the size of the <code>tained</code> rectangle. | [
"Shifts",
"the",
"position",
"of",
"the",
"<code",
">",
"tainer<",
"/",
"code",
">",
"rectangle",
"to",
"ensure",
"that",
"it",
"contains",
"the",
"<code",
">",
"tained<",
"/",
"code",
">",
"rectangle",
".",
"The",
"<code",
">",
"tainer<",
"/",
"code",
... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/geom/GeomUtil.java#L178-L192 |
junit-team/junit4 | src/main/java/junit/framework/Assert.java | Assert.assertEquals | static public void assertEquals(String message, long expected, long actual) {
"""
Asserts that two longs are equal. If they are not
an AssertionFailedError is thrown with the given message.
"""
assertEquals(message, Long.valueOf(expected), Long.valueOf(actual));
} | java | static public void assertEquals(String message, long expected, long actual) {
assertEquals(message, Long.valueOf(expected), Long.valueOf(actual));
} | [
"static",
"public",
"void",
"assertEquals",
"(",
"String",
"message",
",",
"long",
"expected",
",",
"long",
"actual",
")",
"{",
"assertEquals",
"(",
"message",
",",
"Long",
".",
"valueOf",
"(",
"expected",
")",
",",
"Long",
".",
"valueOf",
"(",
"actual",
... | Asserts that two longs are equal. If they are not
an AssertionFailedError is thrown with the given message. | [
"Asserts",
"that",
"two",
"longs",
"are",
"equal",
".",
"If",
"they",
"are",
"not",
"an",
"AssertionFailedError",
"is",
"thrown",
"with",
"the",
"given",
"message",
"."
] | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/junit/framework/Assert.java#L158-L160 |
igniterealtime/REST-API-Client | src/main/java/org/igniterealtime/restclient/RestApiClient.java | RestApiClient.getUsers | public UserEntities getUsers(Map<String, String> queryParams) {
"""
Gets the users.
@param queryParams
the query params
@return the users
"""
UserEntities userEntities = restClient.get("users", UserEntities.class, queryParams);
return userEntities;
} | java | public UserEntities getUsers(Map<String, String> queryParams) {
UserEntities userEntities = restClient.get("users", UserEntities.class, queryParams);
return userEntities;
} | [
"public",
"UserEntities",
"getUsers",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"queryParams",
")",
"{",
"UserEntities",
"userEntities",
"=",
"restClient",
".",
"get",
"(",
"\"users\"",
",",
"UserEntities",
".",
"class",
",",
"queryParams",
")",
";",
"r... | Gets the users.
@param queryParams
the query params
@return the users | [
"Gets",
"the",
"users",
"."
] | train | https://github.com/igniterealtime/REST-API-Client/blob/fd544dd770ec2ababa47fef51579522ddce09f05/src/main/java/org/igniterealtime/restclient/RestApiClient.java#L113-L116 |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/common/Workspace.java | Workspace.findCollection | public Collection findCollection(final String title, final String contentType) {
"""
Find collection by title and/or content-type.
@param title Title or null to match all titles.
@param contentType Content-type or null to match all content-types.
@return First Collection that matches title and/or content-type... | java | public Collection findCollection(final String title, final String contentType) {
for (final Object element : collections) {
final Collection col = (Collection) element;
if (title != null && col.accepts(contentType)) {
return col;
} else if (col.accepts(content... | [
"public",
"Collection",
"findCollection",
"(",
"final",
"String",
"title",
",",
"final",
"String",
"contentType",
")",
"{",
"for",
"(",
"final",
"Object",
"element",
":",
"collections",
")",
"{",
"final",
"Collection",
"col",
"=",
"(",
"Collection",
")",
"el... | Find collection by title and/or content-type.
@param title Title or null to match all titles.
@param contentType Content-type or null to match all content-types.
@return First Collection that matches title and/or content-type. | [
"Find",
"collection",
"by",
"title",
"and",
"/",
"or",
"content",
"-",
"type",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/common/Workspace.java#L99-L109 |
EsotericSoftware/jsonbeans | src/com/esotericsoftware/jsonbeans/Json.java | Json.writeValue | public void writeValue (String name, Object value, Class knownType) {
"""
Writes the value as a field on the current JSON object, writing the class of the object if it differs from the specified
known type.
@param value May be null.
@param knownType May be null if the type is unknown.
@see #writeValue(String, ... | java | public void writeValue (String name, Object value, Class knownType) {
try {
writer.name(name);
} catch (IOException ex) {
throw new JsonException(ex);
}
writeValue(value, knownType, null);
} | [
"public",
"void",
"writeValue",
"(",
"String",
"name",
",",
"Object",
"value",
",",
"Class",
"knownType",
")",
"{",
"try",
"{",
"writer",
".",
"name",
"(",
"name",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
"throw",
"new",
"JsonExcepti... | Writes the value as a field on the current JSON object, writing the class of the object if it differs from the specified
known type.
@param value May be null.
@param knownType May be null if the type is unknown.
@see #writeValue(String, Object, Class, Class) | [
"Writes",
"the",
"value",
"as",
"a",
"field",
"on",
"the",
"current",
"JSON",
"object",
"writing",
"the",
"class",
"of",
"the",
"object",
"if",
"it",
"differs",
"from",
"the",
"specified",
"known",
"type",
"."
] | train | https://github.com/EsotericSoftware/jsonbeans/blob/ff4502d0ff86cc77aa5c61d47371d0c66c14fe2f/src/com/esotericsoftware/jsonbeans/Json.java#L398-L405 |
alipay/sofa-rpc | extension-impl/remoting-http/src/main/java/com/alipay/sofa/rpc/transport/http/AbstractHttp2ClientTransport.java | AbstractHttp2ClientTransport.doInvokeSync | protected SofaResponse doInvokeSync(SofaRequest request, int timeout) throws InterruptedException,
ExecutionException, TimeoutException {
"""
同步调用
@param request 请求对象
@param timeout 超时时间(毫秒)
@return 返回对象
@throws InterruptedException 中断异常
@throws ExecutionException 执行异常
@throws TimeoutException ... | java | protected SofaResponse doInvokeSync(SofaRequest request, int timeout) throws InterruptedException,
ExecutionException, TimeoutException {
HttpResponseFuture future = new HttpResponseFuture(request, timeout);
AbstractHttpClientHandler callback = new SyncInvokeClientHandler(transportConfig.getCons... | [
"protected",
"SofaResponse",
"doInvokeSync",
"(",
"SofaRequest",
"request",
",",
"int",
"timeout",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
",",
"TimeoutException",
"{",
"HttpResponseFuture",
"future",
"=",
"new",
"HttpResponseFuture",
"(",
"req... | 同步调用
@param request 请求对象
@param timeout 超时时间(毫秒)
@return 返回对象
@throws InterruptedException 中断异常
@throws ExecutionException 执行异常
@throws TimeoutException 超时异常 | [
"同步调用"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/remoting-http/src/main/java/com/alipay/sofa/rpc/transport/http/AbstractHttp2ClientTransport.java#L274-L284 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasACL.java | BaasACL.hasUserGrant | public boolean hasUserGrant(Grant grant,String username) {
"""
Checks if the user with {@code username} has the specified {@code grant}
@param grant a {@link com.baasbox.android.Grant}
@param username a username
@return
"""
if (grant == null) throw new IllegalArgumentException("grant cannot be null"... | java | public boolean hasUserGrant(Grant grant,String username){
if (grant == null) throw new IllegalArgumentException("grant cannot be null");
if (username==null) throw new IllegalArgumentException("username cannot be null");
Set<String> users = userGrants.get(grant);
return users!=null &&user... | [
"public",
"boolean",
"hasUserGrant",
"(",
"Grant",
"grant",
",",
"String",
"username",
")",
"{",
"if",
"(",
"grant",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"grant cannot be null\"",
")",
";",
"if",
"(",
"username",
"==",
"null",
... | Checks if the user with {@code username} has the specified {@code grant}
@param grant a {@link com.baasbox.android.Grant}
@param username a username
@return | [
"Checks",
"if",
"the",
"user",
"with",
"{"
] | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasACL.java#L101-L106 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java | HttpMessage.setField | public void setField(String name, List value) {
"""
Set a multi-value field value.
If the message is editable, then a header field is set. Otherwise
if the meesage is sending and a HTTP/1.1 version, then a trailer
field is set.
@param name Name of field
@param value New values of field
"""
if (_st... | java | public void setField(String name, List value)
{
if (_state!=__MSG_EDITABLE)
return;
_header.put(name,value);
} | [
"public",
"void",
"setField",
"(",
"String",
"name",
",",
"List",
"value",
")",
"{",
"if",
"(",
"_state",
"!=",
"__MSG_EDITABLE",
")",
"return",
";",
"_header",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Set a multi-value field value.
If the message is editable, then a header field is set. Otherwise
if the meesage is sending and a HTTP/1.1 version, then a trailer
field is set.
@param name Name of field
@param value New values of field | [
"Set",
"a",
"multi",
"-",
"value",
"field",
"value",
".",
"If",
"the",
"message",
"is",
"editable",
"then",
"a",
"header",
"field",
"is",
"set",
".",
"Otherwise",
"if",
"the",
"meesage",
"is",
"sending",
"and",
"a",
"HTTP",
"/",
"1",
".",
"1",
"versi... | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L290-L295 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemNumber.java | ElemNumber.getCountMatchPattern | XPath getCountMatchPattern(XPathContext support, int contextNode)
throws javax.xml.transform.TransformerException {
"""
Get the count match pattern, or a default value.
@param support The XPath runtime state for this.
@param contextNode The node that "." expresses.
@return the count match pattern,... | java | XPath getCountMatchPattern(XPathContext support, int contextNode)
throws javax.xml.transform.TransformerException
{
XPath countMatchPattern = m_countMatchPattern;
DTM dtm = support.getDTM(contextNode);
if (null == countMatchPattern)
{
switch (dtm.getNodeType(contextNode))
{
... | [
"XPath",
"getCountMatchPattern",
"(",
"XPathContext",
"support",
",",
"int",
"contextNode",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"XPath",
"countMatchPattern",
"=",
"m_countMatchPattern",
";",
"DTM",
"dtm",
"=",
"s... | Get the count match pattern, or a default value.
@param support The XPath runtime state for this.
@param contextNode The node that "." expresses.
@return the count match pattern, or a default value.
@throws javax.xml.transform.TransformerException | [
"Get",
"the",
"count",
"match",
"pattern",
"or",
"a",
"default",
"value",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemNumber.java#L718-L775 |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/MethodCompiler.java | MethodCompiler.addNewArray | public void addNewArray(String name, TypeMirror type, int size) throws IOException {
"""
Create new array
<p>Stack: ..., count => ..., arrayref
@param name
@param type
@param size
@throws IOException
"""
if (type.getKind() != TypeKind.ARRAY)
{
throw new IllegalArgumentExc... | java | public void addNewArray(String name, TypeMirror type, int size) throws IOException
{
if (type.getKind() != TypeKind.ARRAY)
{
throw new IllegalArgumentException(type+" is not array");
}
ArrayType at = (ArrayType) type;
addVariable(name, at);
newarra... | [
"public",
"void",
"addNewArray",
"(",
"String",
"name",
",",
"TypeMirror",
"type",
",",
"int",
"size",
")",
"throws",
"IOException",
"{",
"if",
"(",
"type",
".",
"getKind",
"(",
")",
"!=",
"TypeKind",
".",
"ARRAY",
")",
"{",
"throw",
"new",
"IllegalArgum... | Create new array
<p>Stack: ..., count => ..., arrayref
@param name
@param type
@param size
@throws IOException | [
"Create",
"new",
"array",
"<p",
">",
"Stack",
":",
"...",
"count",
"=",
">",
";",
"...",
"arrayref"
] | train | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/MethodCompiler.java#L1430-L1444 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/FeaturableConfig.java | FeaturableConfig.imports | public static FeaturableConfig imports(Xml root) {
"""
Import the featurable data from node.
@param root The root node reference (must not be <code>null</code>).
@return The featurable data.
@throws LionEngineException If unable to read node.
"""
Check.notNull(root);
final String clazz;
... | java | public static FeaturableConfig imports(Xml root)
{
Check.notNull(root);
final String clazz;
if (root.hasChild(ATT_CLASS))
{
clazz = root.getChild(ATT_CLASS).getText();
}
else
{
clazz = DEFAULT_CLASS_NAME;
}
final Strin... | [
"public",
"static",
"FeaturableConfig",
"imports",
"(",
"Xml",
"root",
")",
"{",
"Check",
".",
"notNull",
"(",
"root",
")",
";",
"final",
"String",
"clazz",
";",
"if",
"(",
"root",
".",
"hasChild",
"(",
"ATT_CLASS",
")",
")",
"{",
"clazz",
"=",
"root",... | Import the featurable data from node.
@param root The root node reference (must not be <code>null</code>).
@return The featurable data.
@throws LionEngineException If unable to read node. | [
"Import",
"the",
"featurable",
"data",
"from",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/FeaturableConfig.java#L92-L117 |
jamesagnew/hapi-fhir | hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/SpringObjectCaster.java | SpringObjectCaster.getTargetObject | public static <T> T getTargetObject(Object proxy, Class<T> clazz) throws Exception {
"""
Retrieve the Spring proxy object's target object
@param proxy
@param clazz
@param <T>
@return
@throws Exception
"""
while( (AopUtils.isJdkDynamicProxy(proxy))) {
return clazz.cast(getTargetObject((... | java | public static <T> T getTargetObject(Object proxy, Class<T> clazz) throws Exception {
while( (AopUtils.isJdkDynamicProxy(proxy))) {
return clazz.cast(getTargetObject(((Advised)proxy).getTargetSource().getTarget(), clazz));
}
return clazz.cast(proxy);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getTargetObject",
"(",
"Object",
"proxy",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"Exception",
"{",
"while",
"(",
"(",
"AopUtils",
".",
"isJdkDynamicProxy",
"(",
"proxy",
")",
")",
")",
"{",
"return... | Retrieve the Spring proxy object's target object
@param proxy
@param clazz
@param <T>
@return
@throws Exception | [
"Retrieve",
"the",
"Spring",
"proxy",
"object",
"s",
"target",
"object"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/util/SpringObjectCaster.java#L40-L46 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/operator/aggregation/AccumulatorCompiler.java | AccumulatorCompiler.generateBlockNonNullPositionForLoop | private static BytecodeBlock generateBlockNonNullPositionForLoop(Scope scope, Variable positionVariable, BytecodeBlock loopBody) {
"""
loopBody will only be executed for non-null positions in the Block
"""
Variable rowsVariable = scope.declareVariable(int.class, "rows");
Variable blockVariable ... | java | private static BytecodeBlock generateBlockNonNullPositionForLoop(Scope scope, Variable positionVariable, BytecodeBlock loopBody)
{
Variable rowsVariable = scope.declareVariable(int.class, "rows");
Variable blockVariable = scope.getVariable("block");
BytecodeBlock block = new BytecodeBlock()... | [
"private",
"static",
"BytecodeBlock",
"generateBlockNonNullPositionForLoop",
"(",
"Scope",
"scope",
",",
"Variable",
"positionVariable",
",",
"BytecodeBlock",
"loopBody",
")",
"{",
"Variable",
"rowsVariable",
"=",
"scope",
".",
"declareVariable",
"(",
"int",
".",
"cla... | loopBody will only be executed for non-null positions in the Block | [
"loopBody",
"will",
"only",
"be",
"executed",
"for",
"non",
"-",
"null",
"positions",
"in",
"the",
"Block"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/operator/aggregation/AccumulatorCompiler.java#L789-L816 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.accessRestriction_sms_id_enable_POST | public void accessRestriction_sms_id_enable_POST(Long id, String code) throws IOException {
"""
Enable this SMS account
REST: POST /me/accessRestriction/sms/{id}/enable
@param code [required] SMS code send by a cellphone
@param id [required] The Id of the restriction
"""
String qPath = "/me/accessRestri... | java | public void accessRestriction_sms_id_enable_POST(Long id, String code) throws IOException {
String qPath = "/me/accessRestriction/sms/{id}/enable";
StringBuilder sb = path(qPath, id);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "code", code);
exec(qPath, "POST", sb.toString(), o);
} | [
"public",
"void",
"accessRestriction_sms_id_enable_POST",
"(",
"Long",
"id",
",",
"String",
"code",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/accessRestriction/sms/{id}/enable\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"i... | Enable this SMS account
REST: POST /me/accessRestriction/sms/{id}/enable
@param code [required] SMS code send by a cellphone
@param id [required] The Id of the restriction | [
"Enable",
"this",
"SMS",
"account"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3796-L3802 |
theHilikus/JRoboCom | jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java | World.addFirst | public void addFirst(Robot eve) {
"""
Adds the first robot of a team. The robot becomes owned by <i>this</i> object
@param eve the first robot of the player
@throws IllegalArgumentException if the robot is not the first from its team or it exists
already
"""
if (eve.getData().getGeneration() != 0) {
... | java | public void addFirst(Robot eve) {
if (eve.getData().getGeneration() != 0) {
throw new IllegalArgumentException("Robot is not first generation");
}
if (getBotsCount(eve.getData().getTeamId(), false) > 0) {
throw new IllegalArgumentException(
"Provided robot is not the first from its team. Use add(Rob... | [
"public",
"void",
"addFirst",
"(",
"Robot",
"eve",
")",
"{",
"if",
"(",
"eve",
".",
"getData",
"(",
")",
".",
"getGeneration",
"(",
")",
"!=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Robot is not first generation\"",
")",
";",
"}... | Adds the first robot of a team. The robot becomes owned by <i>this</i> object
@param eve the first robot of the player
@throws IllegalArgumentException if the robot is not the first from its team or it exists
already | [
"Adds",
"the",
"first",
"robot",
"of",
"a",
"team",
".",
"The",
"robot",
"becomes",
"owned",
"by",
"<i",
">",
"this<",
"/",
"i",
">",
"object"
] | train | https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java#L117-L135 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/Parameters.java | Parameters.setLong | @NonNull
public Parameters setLong(@NonNull String name, long value) {
"""
Set an long value to the query parameter referenced by the given name. A query parameter
is defined by using the Expression's parameter(String name) function.
@param name The parameter name.
@param value The long value.
@return T... | java | @NonNull
public Parameters setLong(@NonNull String name, long value) {
return setValue(name, value);
} | [
"@",
"NonNull",
"public",
"Parameters",
"setLong",
"(",
"@",
"NonNull",
"String",
"name",
",",
"long",
"value",
")",
"{",
"return",
"setValue",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Set an long value to the query parameter referenced by the given name. A query parameter
is defined by using the Expression's parameter(String name) function.
@param name The parameter name.
@param value The long value.
@return The self object. | [
"Set",
"an",
"long",
"value",
"to",
"the",
"query",
"parameter",
"referenced",
"by",
"the",
"given",
"name",
".",
"A",
"query",
"parameter",
"is",
"defined",
"by",
"using",
"the",
"Expression",
"s",
"parameter",
"(",
"String",
"name",
")",
"function",
"."
... | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Parameters.java#L118-L121 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/nio/SerializationClassNameFilter.java | SerializationClassNameFilter.filter | public void filter(String className) throws SecurityException {
"""
Throws {@link SecurityException} if the given class name appears on the blacklist or does not appear a whitelist.
@param className class name to check
@throws SecurityException if the classname is not allowed for deserialization
"""
... | java | public void filter(String className) throws SecurityException {
if (blacklist.isListed(className)) {
throw new SecurityException(format(DESERIALIZATION_ERROR, className));
}
// if whitelisting is enabled (either explicit or as a default whitelist), force the whitelist check
i... | [
"public",
"void",
"filter",
"(",
"String",
"className",
")",
"throws",
"SecurityException",
"{",
"if",
"(",
"blacklist",
".",
"isListed",
"(",
"className",
")",
")",
"{",
"throw",
"new",
"SecurityException",
"(",
"format",
"(",
"DESERIALIZATION_ERROR",
",",
"c... | Throws {@link SecurityException} if the given class name appears on the blacklist or does not appear a whitelist.
@param className class name to check
@throws SecurityException if the classname is not allowed for deserialization | [
"Throws",
"{",
"@link",
"SecurityException",
"}",
"if",
"the",
"given",
"class",
"name",
"appears",
"on",
"the",
"blacklist",
"or",
"does",
"not",
"appear",
"a",
"whitelist",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/nio/SerializationClassNameFilter.java#L53-L65 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/script/ScriptBuilder.java | ScriptBuilder.bigNum | protected ScriptBuilder bigNum(int index, long num) {
"""
Adds the given number as a push data chunk to the given index in the program.
This is intended to use for negative numbers or values greater than 16, and although
it will accept numbers in the range 0-16 inclusive, the encoding would be
considered non-st... | java | protected ScriptBuilder bigNum(int index, long num) {
final byte[] data;
if (num == 0) {
data = new byte[0];
} else {
Stack<Byte> result = new Stack<>();
final boolean neg = num < 0;
long absvalue = Math.abs(num);
while (absvalue != 0... | [
"protected",
"ScriptBuilder",
"bigNum",
"(",
"int",
"index",
",",
"long",
"num",
")",
"{",
"final",
"byte",
"[",
"]",
"data",
";",
"if",
"(",
"num",
"==",
"0",
")",
"{",
"data",
"=",
"new",
"byte",
"[",
"0",
"]",
";",
"}",
"else",
"{",
"Stack",
... | Adds the given number as a push data chunk to the given index in the program.
This is intended to use for negative numbers or values greater than 16, and although
it will accept numbers in the range 0-16 inclusive, the encoding would be
considered non-standard.
@see #number(long) | [
"Adds",
"the",
"given",
"number",
"as",
"a",
"push",
"data",
"chunk",
"to",
"the",
"given",
"index",
"in",
"the",
"program",
".",
"This",
"is",
"intended",
"to",
"use",
"for",
"negative",
"numbers",
"or",
"values",
"greater",
"than",
"16",
"and",
"althou... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/script/ScriptBuilder.java#L181-L216 |
molgenis/molgenis | molgenis-api-data/src/main/java/org/molgenis/api/data/v1/RestController.java | RestController.updateFromFormPostMultiPart | @Transactional
@PostMapping(
value = "/ {
"""
Updates an entity from a html form post.
<p>Tunnels PUT through POST
<p>Example url: /api/v1/person/99?_method=PUT
"""entityTypeId}/{id}",
params = "_method=PUT",
headers = "Content-Type=multipart/form-data")
@ResponseStatus(NO_CONTENT)
... | java | @Transactional
@PostMapping(
value = "/{entityTypeId}/{id}",
params = "_method=PUT",
headers = "Content-Type=multipart/form-data")
@ResponseStatus(NO_CONTENT)
public void updateFromFormPostMultiPart(
@PathVariable("entityTypeId") String entityTypeId,
@PathVariable("id") String untype... | [
"@",
"Transactional",
"@",
"PostMapping",
"(",
"value",
"=",
"\"/{entityTypeId}/{id}\"",
",",
"params",
"=",
"\"_method=PUT\"",
",",
"headers",
"=",
"\"Content-Type=multipart/form-data\"",
")",
"@",
"ResponseStatus",
"(",
"NO_CONTENT",
")",
"public",
"void",
"updateFr... | Updates an entity from a html form post.
<p>Tunnels PUT through POST
<p>Example url: /api/v1/person/99?_method=PUT | [
"Updates",
"an",
"entity",
"from",
"a",
"html",
"form",
"post",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-api-data/src/main/java/org/molgenis/api/data/v1/RestController.java#L632-L659 |
dnsjava/dnsjava | org/xbill/DNS/TSIG.java | TSIG.applyStream | public void
applyStream(Message m, TSIGRecord old, boolean first) {
"""
Generates a TSIG record for a message and adds it to the message
@param m The message
@param old If this message is a response, the TSIG from the request
"""
if (first) {
apply(m, old);
return;
}
Date timeSigned = new Date();
int... | java | public void
applyStream(Message m, TSIGRecord old, boolean first) {
if (first) {
apply(m, old);
return;
}
Date timeSigned = new Date();
int fudge;
hmac.reset();
fudge = Options.intValue("tsigfudge");
if (fudge < 0 || fudge > 0x7FFF)
fudge = FUDGE;
DNSOutput out = new DNSOutput();
out.writeU16(old.getSi... | [
"public",
"void",
"applyStream",
"(",
"Message",
"m",
",",
"TSIGRecord",
"old",
",",
"boolean",
"first",
")",
"{",
"if",
"(",
"first",
")",
"{",
"apply",
"(",
"m",
",",
"old",
")",
";",
"return",
";",
"}",
"Date",
"timeSigned",
"=",
"new",
"Date",
... | Generates a TSIG record for a message and adds it to the message
@param m The message
@param old If this message is a response, the TSIG from the request | [
"Generates",
"a",
"TSIG",
"record",
"for",
"a",
"message",
"and",
"adds",
"it",
"to",
"the",
"message"
] | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/TSIG.java#L372-L412 |
apache/flink | flink-core/src/main/java/org/apache/flink/types/Record.java | Record.getFieldsInto | public boolean getFieldsInto(int[] positions, Value[] targets) {
"""
Gets the fields at the given positions into an array.
If at any position a field is null, then this method returns false.
All fields that have been successfully read until the failing read are correctly contained in the record.
All other field... | java | public boolean getFieldsInto(int[] positions, Value[] targets) {
for (int i = 0; i < positions.length; i++) {
if (!getFieldInto(positions[i], targets[i])) {
return false;
}
}
return true;
} | [
"public",
"boolean",
"getFieldsInto",
"(",
"int",
"[",
"]",
"positions",
",",
"Value",
"[",
"]",
"targets",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"positions",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"getField... | Gets the fields at the given positions into an array.
If at any position a field is null, then this method returns false.
All fields that have been successfully read until the failing read are correctly contained in the record.
All other fields are not set.
@param positions The positions of the fields to get.
@param t... | [
"Gets",
"the",
"fields",
"at",
"the",
"given",
"positions",
"into",
"an",
"array",
".",
"If",
"at",
"any",
"position",
"a",
"field",
"is",
"null",
"then",
"this",
"method",
"returns",
"false",
".",
"All",
"fields",
"that",
"have",
"been",
"successfully",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/Record.java#L337-L344 |
alkacon/opencms-core | src/org/opencms/ui/CmsUserIconHelper.java | CmsUserIconHelper.toRfsName | private String toRfsName(String name, IconSize size) {
"""
Transforms user name and icon size into the rfs image path.
@param name the user name
@param size IconSize to get icon for
@return the path
"""
return CmsStringUtil.joinPaths(m_cache.getRepositoryPath(), "" + name.hashCode()) + size.get... | java | private String toRfsName(String name, IconSize size) {
return CmsStringUtil.joinPaths(m_cache.getRepositoryPath(), "" + name.hashCode()) + size.getSuffix();
} | [
"private",
"String",
"toRfsName",
"(",
"String",
"name",
",",
"IconSize",
"size",
")",
"{",
"return",
"CmsStringUtil",
".",
"joinPaths",
"(",
"m_cache",
".",
"getRepositoryPath",
"(",
")",
",",
"\"\"",
"+",
"name",
".",
"hashCode",
"(",
")",
")",
"+",
"s... | Transforms user name and icon size into the rfs image path.
@param name the user name
@param size IconSize to get icon for
@return the path | [
"Transforms",
"user",
"name",
"and",
"icon",
"size",
"into",
"the",
"rfs",
"image",
"path",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsUserIconHelper.java#L457-L460 |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/resources/Generator.java | Generator.generateRandomPassword | public static String generateRandomPassword(final CharacterTypes characterTypes, final int length) {
"""
Generates a random password of the specified length with the specified characters.
@param characterTypes the types of characters to include in the password
@param length the length of the password
... | java | public static String generateRandomPassword(final CharacterTypes characterTypes, final int length)
{
final StringBuffer buffer = new StringBuffer();
String characters = "";
switch (characterTypes)
{
case ALPHA:
characters = "abcdefghijklmnopqrstuvwxyzABC... | [
"public",
"static",
"String",
"generateRandomPassword",
"(",
"final",
"CharacterTypes",
"characterTypes",
",",
"final",
"int",
"length",
")",
"{",
"final",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"String",
"characters",
"=",
"\"\"",
... | Generates a random password of the specified length with the specified characters.
@param characterTypes the types of characters to include in the password
@param length the length of the password
@return the password | [
"Generates",
"a",
"random",
"password",
"of",
"the",
"specified",
"length",
"with",
"the",
"specified",
"characters",
"."
] | train | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/resources/Generator.java#L55-L89 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/groups/pools/PoolsInterface.java | PoolsInterface.getPhotos | public PhotoList<Photo> getPhotos(String groupId, String[] tags, int perPage, int page) throws FlickrException {
"""
Convenience/Compatibility method.
This method does not require authentication.
@see com.flickr4java.flickr.photos.Extras
@param groupId
The group ID
@param tags
The optional tags (may be n... | java | public PhotoList<Photo> getPhotos(String groupId, String[] tags, int perPage, int page) throws FlickrException {
return getPhotos(groupId, tags, Extras.MIN_EXTRAS, perPage, page);
} | [
"public",
"PhotoList",
"<",
"Photo",
">",
"getPhotos",
"(",
"String",
"groupId",
",",
"String",
"[",
"]",
"tags",
",",
"int",
"perPage",
",",
"int",
"page",
")",
"throws",
"FlickrException",
"{",
"return",
"getPhotos",
"(",
"groupId",
",",
"tags",
",",
"... | Convenience/Compatibility method.
This method does not require authentication.
@see com.flickr4java.flickr.photos.Extras
@param groupId
The group ID
@param tags
The optional tags (may be null)
@param perPage
The number of photos per page (0 to ignore)
@param page
The page offset (0 to ignore)
@return A Collection of ... | [
"Convenience",
"/",
"Compatibility",
"method",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/groups/pools/PoolsInterface.java#L267-L269 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.BitArray | public JBBPDslBuilder BitArray(final String name, final JBBPBitNumber bits, final String sizeExpression) {
"""
Add named bit array with size calculated through expression.
@param name name of the array, if null then anonymous one
@param bits length of the field, must not be null
@param siz... | java | public JBBPDslBuilder BitArray(final String name, final JBBPBitNumber bits, final String sizeExpression) {
final Item item = new Item(BinType.BIT_ARRAY, name, this.byteOrder);
item.bitNumber = bits;
item.sizeExpression = assertExpressionChars(sizeExpression);
this.addItem(item);
return this;
} | [
"public",
"JBBPDslBuilder",
"BitArray",
"(",
"final",
"String",
"name",
",",
"final",
"JBBPBitNumber",
"bits",
",",
"final",
"String",
"sizeExpression",
")",
"{",
"final",
"Item",
"item",
"=",
"new",
"Item",
"(",
"BinType",
".",
"BIT_ARRAY",
",",
"name",
","... | Add named bit array with size calculated through expression.
@param name name of the array, if null then anonymous one
@param bits length of the field, must not be null
@param sizeExpression expression to be used to calculate array size, must not be null
@return the builder instance, must not be nu... | [
"Add",
"named",
"bit",
"array",
"with",
"size",
"calculated",
"through",
"expression",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L722-L728 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/utils/WidgetUtil.java | WidgetUtil.getPremadeWidgetHtml | public static String getPremadeWidgetHtml(Guild guild, WidgetTheme theme, int width, int height) {
"""
Gets the pre-made HTML Widget for the specified guild using the specified
settings. The widget will only display correctly if the guild in question
has the Widget enabled.
@param guild
the guild
@param t... | java | public static String getPremadeWidgetHtml(Guild guild, WidgetTheme theme, int width, int height)
{
Checks.notNull(guild, "Guild");
return getPremadeWidgetHtml(guild.getId(), theme, width, height);
} | [
"public",
"static",
"String",
"getPremadeWidgetHtml",
"(",
"Guild",
"guild",
",",
"WidgetTheme",
"theme",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Checks",
".",
"notNull",
"(",
"guild",
",",
"\"Guild\"",
")",
";",
"return",
"getPremadeWidgetHtml",... | Gets the pre-made HTML Widget for the specified guild using the specified
settings. The widget will only display correctly if the guild in question
has the Widget enabled.
@param guild
the guild
@param theme
the theme, light or dark
@param width
the width of the widget
@param height
the height of the widget
@retu... | [
"Gets",
"the",
"pre",
"-",
"made",
"HTML",
"Widget",
"for",
"the",
"specified",
"guild",
"using",
"the",
"specified",
"settings",
".",
"The",
"widget",
"will",
"only",
"display",
"correctly",
"if",
"the",
"guild",
"in",
"question",
"has",
"the",
"Widget",
... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/WidgetUtil.java#L106-L110 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/block/component/DirectionalComponent.java | DirectionalComponent.setDefaultState | @Override
public IBlockState setDefaultState(Block block, IBlockState state) {
"""
Sets the default value to use for the {@link IBlockState}.
@param block the block
@param state the state
@return the i block state
"""
return state.withProperty(getProperty(), EnumFacing.SOUTH);
} | java | @Override
public IBlockState setDefaultState(Block block, IBlockState state)
{
return state.withProperty(getProperty(), EnumFacing.SOUTH);
} | [
"@",
"Override",
"public",
"IBlockState",
"setDefaultState",
"(",
"Block",
"block",
",",
"IBlockState",
"state",
")",
"{",
"return",
"state",
".",
"withProperty",
"(",
"getProperty",
"(",
")",
",",
"EnumFacing",
".",
"SOUTH",
")",
";",
"}"
] | Sets the default value to use for the {@link IBlockState}.
@param block the block
@param state the state
@return the i block state | [
"Sets",
"the",
"default",
"value",
"to",
"use",
"for",
"the",
"{",
"@link",
"IBlockState",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/block/component/DirectionalComponent.java#L118-L122 |
landawn/AbacusUtil | src/com/landawn/abacus/util/IOUtil.java | IOUtil.copyURLToFile | public static void copyURLToFile(final URL source, final File destination) throws UncheckedIOException {
"""
Copies bytes from the URL <code>source</code> to a file
<code>destination</code>. The directories up to <code>destination</code>
will be created if they don't already exist. <code>destination</code>
will... | java | public static void copyURLToFile(final URL source, final File destination) throws UncheckedIOException {
InputStream is = null;
try {
is = source.openStream();
write(destination, is);
} catch (IOException e) {
throw new UncheckedIOException(e);
... | [
"public",
"static",
"void",
"copyURLToFile",
"(",
"final",
"URL",
"source",
",",
"final",
"File",
"destination",
")",
"throws",
"UncheckedIOException",
"{",
"InputStream",
"is",
"=",
"null",
";",
"try",
"{",
"is",
"=",
"source",
".",
"openStream",
"(",
")",
... | Copies bytes from the URL <code>source</code> to a file
<code>destination</code>. The directories up to <code>destination</code>
will be created if they don't already exist. <code>destination</code>
will be overwritten if it already exists.
<p>
Warning: this method does not set a connection or read timeout and thus
mig... | [
"Copies",
"bytes",
"from",
"the",
"URL",
"<code",
">",
"source<",
"/",
"code",
">",
"to",
"a",
"file",
"<code",
">",
"destination<",
"/",
"code",
">",
".",
"The",
"directories",
"up",
"to",
"<code",
">",
"destination<",
"/",
"code",
">",
"will",
"be",
... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/IOUtil.java#L2994-L3005 |
hawkular/hawkular-commons | hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/WsSessions.java | WsSessions.removeSession | public void removeSession(String key, Session doomedSession) {
"""
Removes the session associated with the given {@code key}. If {@code doomedSession} is not {@code null}, the
session matching the given {@code key} in {@link #sessions} will only be removed if that session has the same ID
as the given {@code doom... | java | public void removeSession(String key, Session doomedSession) {
SessionEntry removedEntry = null;
// If no session was passed in, remove any session associated with the given key.
// If a session was passed in, only remove it if the key is associated with that session.
// This is to supp... | [
"public",
"void",
"removeSession",
"(",
"String",
"key",
",",
"Session",
"doomedSession",
")",
"{",
"SessionEntry",
"removedEntry",
"=",
"null",
";",
"// If no session was passed in, remove any session associated with the given key.",
"// If a session was passed in, only remove it ... | Removes the session associated with the given {@code key}. If {@code doomedSession} is not {@code null}, the
session matching the given {@code key} in {@link #sessions} will only be removed if that session has the same ID
as the given {@code doomedSession}.
<p>
When removing a known session, that doomed session's webso... | [
"Removes",
"the",
"session",
"associated",
"with",
"the",
"given",
"{",
"@code",
"key",
"}",
".",
"If",
"{",
"@code",
"doomedSession",
"}",
"is",
"not",
"{",
"@code",
"null",
"}",
"the",
"session",
"matching",
"the",
"given",
"{",
"@code",
"key",
"}",
... | train | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/WsSessions.java#L213-L244 |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/epanet/OmsEpanetParametersOptions.java | OmsEpanetParametersOptions.createFromMap | public static OmsEpanetParametersOptions createFromMap( HashMap<OptionParameterCodes, String> options ) throws Exception {
"""
Create a {@link OmsEpanetParametersOptions} from a {@link HashMap} of values.
@param options the {@link HashMap} of values. The keys have to be from {@link OptionParameterCodes}.
@retu... | java | public static OmsEpanetParametersOptions createFromMap( HashMap<OptionParameterCodes, String> options ) throws Exception {
OmsEpanetParametersOptions epOptions = new OmsEpanetParametersOptions();
String units = options.get(OptionParameterCodes.UNITS);
epOptions.units = units;
String head... | [
"public",
"static",
"OmsEpanetParametersOptions",
"createFromMap",
"(",
"HashMap",
"<",
"OptionParameterCodes",
",",
"String",
">",
"options",
")",
"throws",
"Exception",
"{",
"OmsEpanetParametersOptions",
"epOptions",
"=",
"new",
"OmsEpanetParametersOptions",
"(",
")",
... | Create a {@link OmsEpanetParametersOptions} from a {@link HashMap} of values.
@param options the {@link HashMap} of values. The keys have to be from {@link OptionParameterCodes}.
@return the created {@link OmsEpanetParametersOptions}.
@throws Exception | [
"Create",
"a",
"{",
"@link",
"OmsEpanetParametersOptions",
"}",
"from",
"a",
"{",
"@link",
"HashMap",
"}",
"of",
"values",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/epanet/OmsEpanetParametersOptions.java#L246-L276 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/compiler/expansion/ExpansionServiceImpl.java | ExpansionServiceImpl.expandTerm | private void expandTerm(Term term, List<Statement> allExpansions) {
"""
Apply all matching {@link TermExpansionRule term expansion rules} defined
in <tt>termExpansionRules</tt> to the {@link Term outer term} and all the
{@link Term inner terms}.
<p>
This method is called recursively to evaluate the {@link Term... | java | private void expandTerm(Term term, List<Statement> allExpansions) {
for (final ExpansionRule<Term> rule : termExpansionRules) {
if (rule.match(term)) {
List<Statement> termExpansions = rule.expand(term);
allExpansions.addAll(termExpansions);
}
... | [
"private",
"void",
"expandTerm",
"(",
"Term",
"term",
",",
"List",
"<",
"Statement",
">",
"allExpansions",
")",
"{",
"for",
"(",
"final",
"ExpansionRule",
"<",
"Term",
">",
"rule",
":",
"termExpansionRules",
")",
"{",
"if",
"(",
"rule",
".",
"match",
"("... | Apply all matching {@link TermExpansionRule term expansion rules} defined
in <tt>termExpansionRules</tt> to the {@link Term outer term} and all the
{@link Term inner terms}.
<p>
This method is called recursively to evaluate the {@link Term inner
terms}.
</p>
@param term {@link Term}, the current term to process for ex... | [
"Apply",
"all",
"matching",
"{",
"@link",
"TermExpansionRule",
"term",
"expansion",
"rules",
"}",
"defined",
"in",
"<tt",
">",
"termExpansionRules<",
"/",
"tt",
">",
"to",
"the",
"{",
"@link",
"Term",
"outer",
"term",
"}",
"and",
"all",
"the",
"{",
"@link"... | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/compiler/expansion/ExpansionServiceImpl.java#L194-L206 |
stevespringett/Alpine | alpine/src/main/java/alpine/resources/AlpineResource.java | AlpineResource.multiParam | private String multiParam(final MultivaluedMap<String, String> queryParams, final String... params) {
"""
Provides a facility to retrieve a param by more than one name. Different libraries
and frameworks, expect (in some cases) different names for the same param.
@param queryParams the parameters from the querys... | java | private String multiParam(final MultivaluedMap<String, String> queryParams, final String... params) {
for (final String param: params) {
final String value = queryParams.getFirst(param);
if (StringUtils.isNotBlank(value)) {
return value;
}
}
re... | [
"private",
"String",
"multiParam",
"(",
"final",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"queryParams",
",",
"final",
"String",
"...",
"params",
")",
"{",
"for",
"(",
"final",
"String",
"param",
":",
"params",
")",
"{",
"final",
"String",
"val... | Provides a facility to retrieve a param by more than one name. Different libraries
and frameworks, expect (in some cases) different names for the same param.
@param queryParams the parameters from the querystring
@param params an array of one or more param names
@return the value of the param, or null if not found | [
"Provides",
"a",
"facility",
"to",
"retrieve",
"a",
"param",
"by",
"more",
"than",
"one",
"name",
".",
"Different",
"libraries",
"and",
"frameworks",
"expect",
"(",
"in",
"some",
"cases",
")",
"different",
"names",
"for",
"the",
"same",
"param",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/resources/AlpineResource.java#L313-L321 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/FilterUtils.java | FilterUtils.createPropertyFilter | public static String createPropertyFilter(String name, String value) {
"""
Creates a filter string that matches an attribute value exactly.
Characters in the value with special meaning will be escaped.
@param name a valid attribute name
@param value the exact attribute value
"""
assert name.matche... | java | public static String createPropertyFilter(String name, String value) {
assert name.matches("[^=><~()]+");
StringBuilder builder = new StringBuilder(name.length() + 3 + (value == null ? 0 : value.length() * 2));
builder.append('(').append(name).append('=');
int begin = 0;
if (va... | [
"public",
"static",
"String",
"createPropertyFilter",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"assert",
"name",
".",
"matches",
"(",
"\"[^=><~()]+\"",
")",
";",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"name",
".",
"length... | Creates a filter string that matches an attribute value exactly.
Characters in the value with special meaning will be escaped.
@param name a valid attribute name
@param value the exact attribute value | [
"Creates",
"a",
"filter",
"string",
"that",
"matches",
"an",
"attribute",
"value",
"exactly",
".",
"Characters",
"in",
"the",
"value",
"with",
"special",
"meaning",
"will",
"be",
"escaped",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/FilterUtils.java#L25-L44 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.initOrgUnit | public void initOrgUnit(CmsDbContext dbc, CmsOrganizationalUnit ou) {
"""
Initializes the organizational unit.<p>
@param dbc the DB context
@param ou the organizational unit
"""
try {
dbc.setAttribute(ATTR_INIT_OU, ou);
m_userDriver.fillDefaults(dbc);
} finally {
... | java | public void initOrgUnit(CmsDbContext dbc, CmsOrganizationalUnit ou) {
try {
dbc.setAttribute(ATTR_INIT_OU, ou);
m_userDriver.fillDefaults(dbc);
} finally {
dbc.removeAttribute(ATTR_INIT_OU);
}
} | [
"public",
"void",
"initOrgUnit",
"(",
"CmsDbContext",
"dbc",
",",
"CmsOrganizationalUnit",
"ou",
")",
"{",
"try",
"{",
"dbc",
".",
"setAttribute",
"(",
"ATTR_INIT_OU",
",",
"ou",
")",
";",
"m_userDriver",
".",
"fillDefaults",
"(",
"dbc",
")",
";",
"}",
"fi... | Initializes the organizational unit.<p>
@param dbc the DB context
@param ou the organizational unit | [
"Initializes",
"the",
"organizational",
"unit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L5200-L5208 |
javers/javers | javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java | QueryBuilder.byInstanceId | public static QueryBuilder byInstanceId(Object localId, Class entityClass) {
"""
Query for selecting changes (or snapshots) made on a concrete Entity instance.
<br/><br/>
For example, last changes on "bob" Person:
<pre>
javers.findChanges( QueryBuilder.byInstanceId("bob", Person.class).build() );
</pre>
... | java | public static QueryBuilder byInstanceId(Object localId, Class entityClass){
Validate.argumentsAreNotNull(localId, entityClass);
return new QueryBuilder(new IdFilterDefinition(instanceId(localId, entityClass)));
} | [
"public",
"static",
"QueryBuilder",
"byInstanceId",
"(",
"Object",
"localId",
",",
"Class",
"entityClass",
")",
"{",
"Validate",
".",
"argumentsAreNotNull",
"(",
"localId",
",",
"entityClass",
")",
";",
"return",
"new",
"QueryBuilder",
"(",
"new",
"IdFilterDefinit... | Query for selecting changes (or snapshots) made on a concrete Entity instance.
<br/><br/>
For example, last changes on "bob" Person:
<pre>
javers.findChanges( QueryBuilder.byInstanceId("bob", Person.class).build() );
</pre> | [
"Query",
"for",
"selecting",
"changes",
"(",
"or",
"snapshots",
")",
"made",
"on",
"a",
"concrete",
"Entity",
"instance",
".",
"<br",
"/",
">",
"<br",
"/",
">"
] | train | https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java#L89-L92 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_rule_ruleId_PUT | public void billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_rule_ruleId_PUT(String billingAccount, String serviceName, Long dialplanId, Long extensionId, Long ruleId, OvhOvhPabxDialplanExtensionRule body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{bi... | java | public void billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_rule_ruleId_PUT(String billingAccount, String serviceName, Long dialplanId, Long extensionId, Long ruleId, OvhOvhPabxDialplanExtensionRule body) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceNam... | [
"public",
"void",
"billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_rule_ruleId_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"dialplanId",
",",
"Long",
"extensionId",
",",
"Long",
"ruleId",
",",
"OvhOvhPabxDialpla... | Alter this object properties
REST: PUT /telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}/extension/{extensionId}/rule/{ruleId}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param dialplanId [required]
@... | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7261-L7265 |
CenturyLinkCloud/clc-java-sdk | sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/GroupService.java | GroupService.updateGroup | private boolean updateGroup(String groupId, GroupConfig groupConfig) {
"""
Update group
@param groupId group id to update
@param groupConfig group config
@return <tt>true</tt> if update was successful, <br/>
<tt>false</tt> otherwise
"""
return client
.updateGroup(
groupI... | java | private boolean updateGroup(String groupId, GroupConfig groupConfig) {
return client
.updateGroup(
groupId,
converter.createUpdateGroupRequest(
groupConfig,
groupConfig.getParentGroup() != null ? idByRef(groupConfig.getParentGro... | [
"private",
"boolean",
"updateGroup",
"(",
"String",
"groupId",
",",
"GroupConfig",
"groupConfig",
")",
"{",
"return",
"client",
".",
"updateGroup",
"(",
"groupId",
",",
"converter",
".",
"createUpdateGroupRequest",
"(",
"groupConfig",
",",
"groupConfig",
".",
"get... | Update group
@param groupId group id to update
@param groupConfig group config
@return <tt>true</tt> if update was successful, <br/>
<tt>false</tt> otherwise | [
"Update",
"group"
] | train | https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/GroupService.java#L356-L366 |
sdl/Testy | src/main/java/com/sdl/selenium/web/utils/GetData.java | GetData.getDate | public static String getDate(int days, int months, int years, String format) {
"""
Get Current day (+/- number of days/months/years)
@param days days
@param months months
@param years years
@param format format
@return data
"""
return getDate(days, months, years, format, Locale.ENGLISH);
} | java | public static String getDate(int days, int months, int years, String format) {
return getDate(days, months, years, format, Locale.ENGLISH);
} | [
"public",
"static",
"String",
"getDate",
"(",
"int",
"days",
",",
"int",
"months",
",",
"int",
"years",
",",
"String",
"format",
")",
"{",
"return",
"getDate",
"(",
"days",
",",
"months",
",",
"years",
",",
"format",
",",
"Locale",
".",
"ENGLISH",
")",... | Get Current day (+/- number of days/months/years)
@param days days
@param months months
@param years years
@param format format
@return data | [
"Get",
"Current",
"day",
"(",
"+",
"/",
"-",
"number",
"of",
"days",
"/",
"months",
"/",
"years",
")"
] | train | https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/web/utils/GetData.java#L51-L53 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java | AlternativeAlignment.toPDB | public String toPDB(Structure s1, Structure s2) {
"""
converts the alignment to a PDB file
each of the structures will be represented as a model.
@param s1
@param s2
@return a PDB file as a String
"""
Structure newpdb = getAlignedStructure(s1, s2);
return newpdb.toPDB();
} | java | public String toPDB(Structure s1, Structure s2){
Structure newpdb = getAlignedStructure(s1, s2);
return newpdb.toPDB();
} | [
"public",
"String",
"toPDB",
"(",
"Structure",
"s1",
",",
"Structure",
"s2",
")",
"{",
"Structure",
"newpdb",
"=",
"getAlignedStructure",
"(",
"s1",
",",
"s2",
")",
";",
"return",
"newpdb",
".",
"toPDB",
"(",
")",
";",
"}"
] | converts the alignment to a PDB file
each of the structures will be represented as a model.
@param s1
@param s2
@return a PDB file as a String | [
"converts",
"the",
"alignment",
"to",
"a",
"PDB",
"file",
"each",
"of",
"the",
"structures",
"will",
"be",
"represented",
"as",
"a",
"model",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AlternativeAlignment.java#L878-L884 |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/JPAFieldOperationsImpl.java | JPAFieldOperationsImpl.areTypesSame | private boolean areTypesSame(String from, String to) {
"""
Checks if the types are the same, removing the ".java" in the end of the string in case it exists
@param from
@param to
@return
"""
String fromCompare = from.endsWith(".java") ? from.substring(0, from.length() - 5) : from;
String toCom... | java | private boolean areTypesSame(String from, String to)
{
String fromCompare = from.endsWith(".java") ? from.substring(0, from.length() - 5) : from;
String toCompare = to.endsWith(".java") ? to.substring(0, to.length() - 5) : to;
return fromCompare.equals(toCompare);
} | [
"private",
"boolean",
"areTypesSame",
"(",
"String",
"from",
",",
"String",
"to",
")",
"{",
"String",
"fromCompare",
"=",
"from",
".",
"endsWith",
"(",
"\".java\"",
")",
"?",
"from",
".",
"substring",
"(",
"0",
",",
"from",
".",
"length",
"(",
")",
"-"... | Checks if the types are the same, removing the ".java" in the end of the string in case it exists
@param from
@param to
@return | [
"Checks",
"if",
"the",
"types",
"are",
"the",
"same",
"removing",
"the",
".",
"java",
"in",
"the",
"end",
"of",
"the",
"string",
"in",
"case",
"it",
"exists"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jpa/JPAFieldOperationsImpl.java#L430-L435 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/internal/ResettableInputStream.java | ResettableInputStream.newResettableInputStream | public static ResettableInputStream newResettableInputStream(File file,
String errmsg) {
"""
Convenient factory method to construct a new resettable input stream for
the given file, converting any IOException into SdkClientException
with the given error message.
<p>
Note the creation of a {@link Re... | java | public static ResettableInputStream newResettableInputStream(File file,
String errmsg) {
try {
return new ResettableInputStream(file);
} catch (IOException e) {
throw errmsg == null
? new SdkClientException(e)
: new SdkClientException(e... | [
"public",
"static",
"ResettableInputStream",
"newResettableInputStream",
"(",
"File",
"file",
",",
"String",
"errmsg",
")",
"{",
"try",
"{",
"return",
"new",
"ResettableInputStream",
"(",
"file",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"thro... | Convenient factory method to construct a new resettable input stream for
the given file, converting any IOException into SdkClientException
with the given error message.
<p>
Note the creation of a {@link ResettableInputStream} would entail
physically opening a file. If the opened file is meant to be closed only
(in a f... | [
"Convenient",
"factory",
"method",
"to",
"construct",
"a",
"new",
"resettable",
"input",
"stream",
"for",
"the",
"given",
"file",
"converting",
"any",
"IOException",
"into",
"SdkClientException",
"with",
"the",
"given",
"error",
"message",
".",
"<p",
">",
"Note"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/internal/ResettableInputStream.java#L247-L256 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java | ReceiveMessageActionParser.parseNamespaceValidationElements | private void parseNamespaceValidationElements(Element messageElement, XmlMessageValidationContext context) {
"""
Parses validation elements and adds information to the message validation context.
@param messageElement the message DOM element.
@param context the message validation context.
"""
//che... | java | private void parseNamespaceValidationElements(Element messageElement, XmlMessageValidationContext context) {
//check for validate elements, these elements can either have script, xpath or namespace validation information
//for now we only handle namespace validation
Map<String, String> validateN... | [
"private",
"void",
"parseNamespaceValidationElements",
"(",
"Element",
"messageElement",
",",
"XmlMessageValidationContext",
"context",
")",
"{",
"//check for validate elements, these elements can either have script, xpath or namespace validation information",
"//for now we only handle names... | Parses validation elements and adds information to the message validation context.
@param messageElement the message DOM element.
@param context the message validation context. | [
"Parses",
"validation",
"elements",
"and",
"adds",
"information",
"to",
"the",
"message",
"validation",
"context",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java#L377-L398 |
hageldave/ImagingKit | ImagingKit_Core/src/main/java/hageldave/imagingkit/core/scientific/ColorImg.java | ColorImg.toBufferedImage | public BufferedImage toBufferedImage(BufferedImage bimg, TransferFunction transferFunc) {
"""
Copies this image's data to the specified {@link BufferedImage}.
This method will preserve the {@link Raster} of the specified
BufferedImage and will only modify the contents of it.
<p>
The specified {@link TransferFu... | java | public BufferedImage toBufferedImage(BufferedImage bimg, TransferFunction transferFunc){
return toImg(transferFunc).toBufferedImage(bimg);
} | [
"public",
"BufferedImage",
"toBufferedImage",
"(",
"BufferedImage",
"bimg",
",",
"TransferFunction",
"transferFunc",
")",
"{",
"return",
"toImg",
"(",
"transferFunc",
")",
".",
"toBufferedImage",
"(",
"bimg",
")",
";",
"}"
] | Copies this image's data to the specified {@link BufferedImage}.
This method will preserve the {@link Raster} of the specified
BufferedImage and will only modify the contents of it.
<p>
The specified {@link TransferFunction} is used to map this
image's channel values to 8bit per channel ARGB values.
@param bimg the Bu... | [
"Copies",
"this",
"image",
"s",
"data",
"to",
"the",
"specified",
"{",
"@link",
"BufferedImage",
"}",
".",
"This",
"method",
"will",
"preserve",
"the",
"{",
"@link",
"Raster",
"}",
"of",
"the",
"specified",
"BufferedImage",
"and",
"will",
"only",
"modify",
... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Core/src/main/java/hageldave/imagingkit/core/scientific/ColorImg.java#L1075-L1077 |
pmwmedia/tinylog | log4j1.2-api/src/main/java/org/apache/log4j/Category.java | Category.forcedLog | protected void forcedLog(final String fqcn, final Priority level, final Object message, final Throwable t) {
"""
This method creates a new logging event and logs the event without further checks.
@param fqcn
Fully-qualified class name of the category or logger instance
@param level
Priority to log
@param me... | java | protected void forcedLog(final String fqcn, final Priority level, final Object message, final Throwable t) {
provider.log(fqcn, null, translatePriority(level), t, message == t ? null : message, (Object[]) null);
} | [
"protected",
"void",
"forcedLog",
"(",
"final",
"String",
"fqcn",
",",
"final",
"Priority",
"level",
",",
"final",
"Object",
"message",
",",
"final",
"Throwable",
"t",
")",
"{",
"provider",
".",
"log",
"(",
"fqcn",
",",
"null",
",",
"translatePriority",
"(... | This method creates a new logging event and logs the event without further checks.
@param fqcn
Fully-qualified class name of the category or logger instance
@param level
Priority to log
@param message
Message to log
@param t
Exception to log | [
"This",
"method",
"creates",
"a",
"new",
"logging",
"event",
"and",
"logs",
"the",
"event",
"without",
"further",
"checks",
"."
] | train | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/log4j1.2-api/src/main/java/org/apache/log4j/Category.java#L315-L317 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.