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 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/flink | flink-core/src/main/java/org/apache/flink/core/fs/EntropyInjector.java | EntropyInjector.removeEntropyMarkerIfPresent | public static Path removeEntropyMarkerIfPresent(FileSystem fs, Path path) {
"""
Removes the entropy marker string from the path, if the given file system is an
entropy-injecting file system (implements {@link EntropyInjectingFileSystem}) and
the entropy marker key is present. Otherwise, this returns the path as ... | java | public static Path removeEntropyMarkerIfPresent(FileSystem fs, Path path) {
final EntropyInjectingFileSystem efs = getEntropyFs(fs);
if (efs == null) {
return path;
}
else {
try {
return resolveEntropy(path, efs, false);
}
catch (IOException e) {
// this should never happen, because the pat... | [
"public",
"static",
"Path",
"removeEntropyMarkerIfPresent",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
")",
"{",
"final",
"EntropyInjectingFileSystem",
"efs",
"=",
"getEntropyFs",
"(",
"fs",
")",
";",
"if",
"(",
"efs",
"==",
"null",
")",
"{",
"return",
"p... | Removes the entropy marker string from the path, if the given file system is an
entropy-injecting file system (implements {@link EntropyInjectingFileSystem}) and
the entropy marker key is present. Otherwise, this returns the path as is.
@param path The path to filter.
@return The path without the marker string. | [
"Removes",
"the",
"entropy",
"marker",
"string",
"from",
"the",
"path",
"if",
"the",
"given",
"file",
"system",
"is",
"an",
"entropy",
"-",
"injecting",
"file",
"system",
"(",
"implements",
"{",
"@link",
"EntropyInjectingFileSystem",
"}",
")",
"and",
"the",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/fs/EntropyInjector.java#L73-L88 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java | XmlUtil.appendChild | public static Element appendChild(Node node, String tagName) {
"""
在已有节点上创建子节点
@param node 节点
@param tagName 标签名
@return 子节点
@since 4.0.9
"""
Document doc = (node instanceof Document) ? (Document) node : node.getOwnerDocument();
Element child = doc.createElement(tagName);
node.appendChild(child)... | java | public static Element appendChild(Node node, String tagName) {
Document doc = (node instanceof Document) ? (Document) node : node.getOwnerDocument();
Element child = doc.createElement(tagName);
node.appendChild(child);
return child;
} | [
"public",
"static",
"Element",
"appendChild",
"(",
"Node",
"node",
",",
"String",
"tagName",
")",
"{",
"Document",
"doc",
"=",
"(",
"node",
"instanceof",
"Document",
")",
"?",
"(",
"Document",
")",
"node",
":",
"node",
".",
"getOwnerDocument",
"(",
")",
... | 在已有节点上创建子节点
@param node 节点
@param tagName 标签名
@return 子节点
@since 4.0.9 | [
"在已有节点上创建子节点"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java#L777-L782 |
schallee/alib4j | core/src/main/java/net/darkmist/alib/res/PkgRes.java | PkgRes.getResourcePathFor | public static String getResourcePathFor(CharSequence name, Object obj) {
"""
Gets a resource path using obj's class's package name as
the prefix.
@param name The name of the resource.
@param obj The object to use for the package name
@return Path of a resource prefixed by obj's class package
name.
@throws Nu... | java | public static String getResourcePathFor(CharSequence name, Object obj)
{
if(obj == null)
throw new NullPointerException("obj is null");
return getResourcePathFor(name,obj.getClass());
} | [
"public",
"static",
"String",
"getResourcePathFor",
"(",
"CharSequence",
"name",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"obj is null\"",
")",
";",
"return",
"getResourcePathFor",
"(",
... | Gets a resource path using obj's class's package name as
the prefix.
@param name The name of the resource.
@param obj The object to use for the package name
@return Path of a resource prefixed by obj's class package
name.
@throws NullPointerException if name or obj are null. | [
"Gets",
"a",
"resource",
"path",
"using",
"obj",
"s",
"class",
"s",
"package",
"name",
"as",
"the",
"prefix",
"."
] | train | https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/core/src/main/java/net/darkmist/alib/res/PkgRes.java#L216-L221 |
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.executeScriptActionsAsync | public Observable<Void> executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) {
"""
Executes script actions on the specified HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@para... | java | public Observable<Void> executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) {
return executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
... | [
"public",
"Observable",
"<",
"Void",
">",
"executeScriptActionsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"ExecuteScriptActionParameters",
"parameters",
")",
"{",
"return",
"executeScriptActionsWithServiceResponseAsync",
"(",
"resourceGroup... | Executes script actions on the specified HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param parameters The parameters for executing script actions.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observabl... | [
"Executes",
"script",
"actions",
"on",
"the",
"specified",
"HDInsight",
"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#L1746-L1753 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CProductLocalServiceBaseImpl.java | CProductLocalServiceBaseImpl.fetchCProductByUuidAndGroupId | @Override
public CProduct fetchCProductByUuidAndGroupId(String uuid, long groupId) {
"""
Returns the c product matching the UUID and group.
@param uuid the c product's UUID
@param groupId the primary key of the group
@return the matching c product, or <code>null</code> if a matching c product could not be fo... | java | @Override
public CProduct fetchCProductByUuidAndGroupId(String uuid, long groupId) {
return cProductPersistence.fetchByUUID_G(uuid, groupId);
} | [
"@",
"Override",
"public",
"CProduct",
"fetchCProductByUuidAndGroupId",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"cProductPersistence",
".",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";",
"}"
] | Returns the c product matching the UUID and group.
@param uuid the c product's UUID
@param groupId the primary key of the group
@return the matching c product, or <code>null</code> if a matching c product could not be found | [
"Returns",
"the",
"c",
"product",
"matching",
"the",
"UUID",
"and",
"group",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CProductLocalServiceBaseImpl.java#L250-L253 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java | FastAdapter.getPreItemCountByOrder | public int getPreItemCountByOrder(int order) {
"""
calculates the item count up to a given (excluding this) order number
@param order the number up to which the items are counted
@return the total count of items up to the adapter order
"""
//if we are empty just return 0 count
if (mGlobalSi... | java | public int getPreItemCountByOrder(int order) {
//if we are empty just return 0 count
if (mGlobalSize == 0) {
return 0;
}
int size = 0;
//count the number of items before the adapter with the given order
for (int i = 0; i < Math.min(order, mAdapters.size()); ... | [
"public",
"int",
"getPreItemCountByOrder",
"(",
"int",
"order",
")",
"{",
"//if we are empty just return 0 count",
"if",
"(",
"mGlobalSize",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"int",
"size",
"=",
"0",
";",
"//count the number of items before the adapter w... | calculates the item count up to a given (excluding this) order number
@param order the number up to which the items are counted
@return the total count of items up to the adapter order | [
"calculates",
"the",
"item",
"count",
"up",
"to",
"a",
"given",
"(",
"excluding",
"this",
")",
"order",
"number"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L961-L976 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java | MultiIndex.removeAllDocuments | synchronized int removeAllDocuments(String uuid) throws IOException {
"""
Deletes all documents that match the <code>uuid</code>.
@param uuid
documents that match this <code>uuid</code> will be deleted.
@return the number of deleted documents.
@throws IOException
if an error occurs while deleting documents.... | java | synchronized int removeAllDocuments(String uuid) throws IOException
{
synchronized (updateMonitor)
{
//updateInProgress = true;
indexUpdateMonitor.setUpdateInProgress(true, false);
}
int num;
try
{
Term idTerm = new Term(FieldNames.UUID, uuid.toString())... | [
"synchronized",
"int",
"removeAllDocuments",
"(",
"String",
"uuid",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"updateMonitor",
")",
"{",
"//updateInProgress = true;",
"indexUpdateMonitor",
".",
"setUpdateInProgress",
"(",
"true",
",",
"false",
")",
";",
... | Deletes all documents that match the <code>uuid</code>.
@param uuid
documents that match this <code>uuid</code> will be deleted.
@return the number of deleted documents.
@throws IOException
if an error occurs while deleting documents. | [
"Deletes",
"all",
"documents",
"that",
"match",
"the",
"<code",
">",
"uuid<",
"/",
"code",
">",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java#L1082-L1126 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/LagrangeFormula.java | LagrangeFormula.process_F64 | public static double process_F64(double sample, double x[], double y[], int i0, int i1) {
"""
UsingLlangrange's formula it interpulates the value of a function at the specified sample
point given discrete samples. Which samples are used and the order of the approximation are
given by i0 and i1.
@param sample... | java | public static double process_F64(double sample, double x[], double y[], int i0, int i1) {
double result = 0;
for (int i = i0; i <= i1; i++) {
double numerator = 1.0;
for (int j = i0; j <= i1; j++) {
if (i != j)
numerator *= sample - x[j];
}
double denominator = 1.0;
double a = x[i];
... | [
"public",
"static",
"double",
"process_F64",
"(",
"double",
"sample",
",",
"double",
"x",
"[",
"]",
",",
"double",
"y",
"[",
"]",
",",
"int",
"i0",
",",
"int",
"i1",
")",
"{",
"double",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"i0",
... | UsingLlangrange's formula it interpulates the value of a function at the specified sample
point given discrete samples. Which samples are used and the order of the approximation are
given by i0 and i1.
@param sample Where the estimate is done.
@param x Where the function was sampled.
@param y The function's value... | [
"UsingLlangrange",
"s",
"formula",
"it",
"interpulates",
"the",
"value",
"of",
"a",
"function",
"at",
"the",
"specified",
"sample",
"point",
"given",
"discrete",
"samples",
".",
"Which",
"samples",
"are",
"used",
"and",
"the",
"order",
"of",
"the",
"approximat... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/LagrangeFormula.java#L43-L67 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/Branch.java | Branch.addInstallMetadata | public Branch addInstallMetadata(@NonNull String key, @NonNull String value) {
"""
<p>
This API allows to tag the install with custom attribute. Add any key-values that qualify or distinguish an install here.
Please make sure this method is called before the Branch init, which is on the onStartMethod of first ac... | java | public Branch addInstallMetadata(@NonNull String key, @NonNull String value) {
prefHelper_.addInstallMetadata(key, value);
return this;
} | [
"public",
"Branch",
"addInstallMetadata",
"(",
"@",
"NonNull",
"String",
"key",
",",
"@",
"NonNull",
"String",
"value",
")",
"{",
"prefHelper_",
".",
"addInstallMetadata",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | <p>
This API allows to tag the install with custom attribute. Add any key-values that qualify or distinguish an install here.
Please make sure this method is called before the Branch init, which is on the onStartMethod of first activity.
A better place to call this method is right after Branch#getAutoInstance()
</p> | [
"<p",
">",
"This",
"API",
"allows",
"to",
"tag",
"the",
"install",
"with",
"custom",
"attribute",
".",
"Add",
"any",
"key",
"-",
"values",
"that",
"qualify",
"or",
"distinguish",
"an",
"install",
"here",
".",
"Please",
"make",
"sure",
"this",
"method",
"... | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/Branch.java#L955-L958 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java | Utility.arrayEquals | public final static boolean arrayEquals(Object[] source, Object target) {
"""
Convenience utility to compare two Object[]s.
Ought to be in System
"""
if (source == null) return (target == null);
if (!(target instanceof Object[])) return false;
Object[] targ = (Object[]) target;
... | java | public final static boolean arrayEquals(Object[] source, Object target) {
if (source == null) return (target == null);
if (!(target instanceof Object[])) return false;
Object[] targ = (Object[]) target;
return (source.length == targ.length
&& arrayRegionMatches(source, 0,... | [
"public",
"final",
"static",
"boolean",
"arrayEquals",
"(",
"Object",
"[",
"]",
"source",
",",
"Object",
"target",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"return",
"(",
"target",
"==",
"null",
")",
";",
"if",
"(",
"!",
"(",
"target",
"inst... | Convenience utility to compare two Object[]s.
Ought to be in System | [
"Convenience",
"utility",
"to",
"compare",
"two",
"Object",
"[]",
"s",
".",
"Ought",
"to",
"be",
"in",
"System"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java#L35-L41 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/fieldaccessor/FieldAccessor.java | FieldAccessor.setArrayLabel | public void setArrayLabel(final Object targetObj, final String label, final int index) {
"""
{@link XlsArrayColumns}フィールド用のラベル情報を設定します。
<p>ラベル情報を保持するフィールドがない場合は、処理はスキップされます。</p>
@param targetObj フィールドが定義されているクラスのインスタンス
@param label ラベル情報
@param index インデックスのキー。0以上を指定します。
@throws IllegalArgumentException {@l... | java | public void setArrayLabel(final Object targetObj, final String label, final int index) {
ArgUtils.notNull(targetObj, "targetObj");
ArgUtils.notEmpty(label, "label");
ArgUtils.notMin(index, 0, "index");
arrayLabelSetter.ifPresent(setter -> setter.set(targetObj, lab... | [
"public",
"void",
"setArrayLabel",
"(",
"final",
"Object",
"targetObj",
",",
"final",
"String",
"label",
",",
"final",
"int",
"index",
")",
"{",
"ArgUtils",
".",
"notNull",
"(",
"targetObj",
",",
"\"targetObj\"",
")",
";",
"ArgUtils",
".",
"notEmpty",
"(",
... | {@link XlsArrayColumns}フィールド用のラベル情報を設定します。
<p>ラベル情報を保持するフィールドがない場合は、処理はスキップされます。</p>
@param targetObj フィールドが定義されているクラスのインスタンス
@param label ラベル情報
@param index インデックスのキー。0以上を指定します。
@throws IllegalArgumentException {@literal targetObj == null or label == null.}
@throws IllegalArgumentException {@literal label or index < ... | [
"{",
"@link",
"XlsArrayColumns",
"}",
"フィールド用のラベル情報を設定します。",
"<p",
">",
"ラベル情報を保持するフィールドがない場合は、処理はスキップされます。<",
"/",
"p",
">"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/fieldaccessor/FieldAccessor.java#L473-L481 |
victims/victims-lib-java | src/main/java/com/redhat/victims/database/VictimsSQL.java | VictimsSQL.setObjects | protected void setObjects(PreparedStatement ps, Object... objects)
throws SQLException {
"""
Helper function to set the values given, to a {@link PreparedStatement},
in the order in which they are given.
@param ps
@param objects
@throws SQLException
"""
int index = 1;
for (Obj... | java | protected void setObjects(PreparedStatement ps, Object... objects)
throws SQLException {
int index = 1;
for (Object obj : objects) {
ps.setObject(index, obj);
index++;
}
} | [
"protected",
"void",
"setObjects",
"(",
"PreparedStatement",
"ps",
",",
"Object",
"...",
"objects",
")",
"throws",
"SQLException",
"{",
"int",
"index",
"=",
"1",
";",
"for",
"(",
"Object",
"obj",
":",
"objects",
")",
"{",
"ps",
".",
"setObject",
"(",
"in... | Helper function to set the values given, to a {@link PreparedStatement},
in the order in which they are given.
@param ps
@param objects
@throws SQLException | [
"Helper",
"function",
"to",
"set",
"the",
"values",
"given",
"to",
"a",
"{",
"@link",
"PreparedStatement",
"}",
"in",
"the",
"order",
"in",
"which",
"they",
"are",
"given",
"."
] | train | https://github.com/victims/victims-lib-java/blob/ccd0e2fcc409bb6cdfc5de411c3bb202c9095f8b/src/main/java/com/redhat/victims/database/VictimsSQL.java#L143-L150 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/ConcurrentServiceReferenceSetMap.java | ConcurrentServiceReferenceSetMap.removeReference | public boolean removeReference(K key, ServiceReference<V> reference) {
"""
Removes the reference associated with the key.
@param key Key associated with this reference
@param reference ServiceReference for the target service
@return true if reference was unset (not previously replaced)
"""
if (key... | java | public boolean removeReference(K key, ServiceReference<V> reference) {
if (key == null)
return false;
ConcurrentServiceReferenceSet<V> csrs = elementMap.get(key);
if (csrs == null) {
return false;
}
return csrs.removeReference(reference);
} | [
"public",
"boolean",
"removeReference",
"(",
"K",
"key",
",",
"ServiceReference",
"<",
"V",
">",
"reference",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"return",
"false",
";",
"ConcurrentServiceReferenceSet",
"<",
"V",
">",
"csrs",
"=",
"elementMap",
... | Removes the reference associated with the key.
@param key Key associated with this reference
@param reference ServiceReference for the target service
@return true if reference was unset (not previously replaced) | [
"Removes",
"the",
"reference",
"associated",
"with",
"the",
"key",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/ConcurrentServiceReferenceSetMap.java#L142-L151 |
fabric8io/kubernetes-client | kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java | OperationSupport.handleCreate | protected <T, I> T handleCreate(I resource, Class<T> outputType) throws ExecutionException, InterruptedException, KubernetesClientException, IOException {
"""
Create a resource.
@param resource resource provided
@param outputType resource type you want as output
@param <T> template argument for output type
@... | java | protected <T, I> T handleCreate(I resource, Class<T> outputType) throws ExecutionException, InterruptedException, KubernetesClientException, IOException {
RequestBody body = RequestBody.create(JSON, JSON_MAPPER.writeValueAsString(resource));
Request.Builder requestBuilder = new Request.Builder().post(body).url(... | [
"protected",
"<",
"T",
",",
"I",
">",
"T",
"handleCreate",
"(",
"I",
"resource",
",",
"Class",
"<",
"T",
">",
"outputType",
")",
"throws",
"ExecutionException",
",",
"InterruptedException",
",",
"KubernetesClientException",
",",
"IOException",
"{",
"RequestBody"... | Create a resource.
@param resource resource provided
@param outputType resource type you want as output
@param <T> template argument for output type
@param <I> template argument for resource
@return returns de-serialized version of apiserver response in form of type provided
@throws ExecutionException Execution Excep... | [
"Create",
"a",
"resource",
"."
] | train | https://github.com/fabric8io/kubernetes-client/blob/141668a882ed8e902c045a5cd0a80f14bd17d132/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java#L231-L235 |
zxing/zxing | core/src/main/java/com/google/zxing/pdf417/decoder/PDF417ScanningDecoder.java | PDF417ScanningDecoder.correctErrors | private static int correctErrors(int[] codewords, int[] erasures, int numECCodewords) throws ChecksumException {
"""
<p>Given data and error-correction codewords received, possibly corrupted by errors, attempts to
correct the errors in-place.</p>
@param codewords data and error correction codewords
@param e... | java | private static int correctErrors(int[] codewords, int[] erasures, int numECCodewords) throws ChecksumException {
if (erasures != null &&
erasures.length > numECCodewords / 2 + MAX_ERRORS ||
numECCodewords < 0 ||
numECCodewords > MAX_EC_CODEWORDS) {
// Too many errors or EC Codewords is... | [
"private",
"static",
"int",
"correctErrors",
"(",
"int",
"[",
"]",
"codewords",
",",
"int",
"[",
"]",
"erasures",
",",
"int",
"numECCodewords",
")",
"throws",
"ChecksumException",
"{",
"if",
"(",
"erasures",
"!=",
"null",
"&&",
"erasures",
".",
"length",
"... | <p>Given data and error-correction codewords received, possibly corrupted by errors, attempts to
correct the errors in-place.</p>
@param codewords data and error correction codewords
@param erasures positions of any known erasures
@param numECCodewords number of error correction codewords that are available in codew... | [
"<p",
">",
"Given",
"data",
"and",
"error",
"-",
"correction",
"codewords",
"received",
"possibly",
"corrupted",
"by",
"errors",
"attempts",
"to",
"correct",
"the",
"errors",
"in",
"-",
"place",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/pdf417/decoder/PDF417ScanningDecoder.java#L549-L558 |
JodaOrg/joda-time | src/main/java/org/joda/time/base/BaseInterval.java | BaseInterval.setInterval | protected void setInterval(long startInstant, long endInstant, Chronology chrono) {
"""
Sets this interval from two millisecond instants and a chronology.
@param startInstant the start of the time interval
@param endInstant the start of the time interval
@param chrono the chronology, not null
@throws Ille... | java | protected void setInterval(long startInstant, long endInstant, Chronology chrono) {
checkInterval(startInstant, endInstant);
iStartMillis = startInstant;
iEndMillis = endInstant;
iChronology = DateTimeUtils.getChronology(chrono);
} | [
"protected",
"void",
"setInterval",
"(",
"long",
"startInstant",
",",
"long",
"endInstant",
",",
"Chronology",
"chrono",
")",
"{",
"checkInterval",
"(",
"startInstant",
",",
"endInstant",
")",
";",
"iStartMillis",
"=",
"startInstant",
";",
"iEndMillis",
"=",
"en... | Sets this interval from two millisecond instants and a chronology.
@param startInstant the start of the time interval
@param endInstant the start of the time interval
@param chrono the chronology, not null
@throws IllegalArgumentException if the end is before the start | [
"Sets",
"this",
"interval",
"from",
"two",
"millisecond",
"instants",
"and",
"a",
"chronology",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BaseInterval.java#L247-L252 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/configuration/impl/ConfigurationAbstractImpl.java | ConfigurationAbstractImpl.getInteger | public int getInteger(String key, int defaultValue) {
"""
Returns the integer value for the specified key. If no value for this key
is found in the configuration or the value is not an legal integer
<code>defaultValue</code> is returned.
@param key the key
@param defaultValue the default Value
@return the v... | java | public int getInteger(String key, int defaultValue)
{
int ret;
try
{
String tmp = properties.getProperty(key);
if (tmp == null)
{
properties.put(key, String.valueOf(defaultValue));
logger.debug("No value for key \""... | [
"public",
"int",
"getInteger",
"(",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"int",
"ret",
";",
"try",
"{",
"String",
"tmp",
"=",
"properties",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"tmp",
"==",
"null",
")",
"{",
"propert... | Returns the integer value for the specified key. If no value for this key
is found in the configuration or the value is not an legal integer
<code>defaultValue</code> is returned.
@param key the key
@param defaultValue the default Value
@return the value for the key, or <code>defaultValue</code> | [
"Returns",
"the",
"integer",
"value",
"for",
"the",
"specified",
"key",
".",
"If",
"no",
"value",
"for",
"this",
"key",
"is",
"found",
"in",
"the",
"configuration",
"or",
"the",
"value",
"is",
"not",
"an",
"legal",
"integer",
"<code",
">",
"defaultValue<",... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/configuration/impl/ConfigurationAbstractImpl.java#L146-L175 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/PippoSettings.java | PippoSettings.getDurationInDays | public long getDurationInDays(String name, long defaultValue) {
"""
Gets the duration setting and converts it to days.
<p/>
The setting must be use one of the following conventions:
<ul>
<li>n MILLISECONDS
<li>n SECONDS
<li>n MINUTES
<li>n HOURS
<li>n DAYS
</ul>
@param name
@param defaultValue in days... | java | public long getDurationInDays(String name, long defaultValue) {
TimeUnit timeUnit = extractTimeUnit(name, defaultValue + " DAYS");
long duration = getLong(name, defaultValue);
return timeUnit.toDays(duration);
} | [
"public",
"long",
"getDurationInDays",
"(",
"String",
"name",
",",
"long",
"defaultValue",
")",
"{",
"TimeUnit",
"timeUnit",
"=",
"extractTimeUnit",
"(",
"name",
",",
"defaultValue",
"+",
"\" DAYS\"",
")",
";",
"long",
"duration",
"=",
"getLong",
"(",
"name",
... | Gets the duration setting and converts it to days.
<p/>
The setting must be use one of the following conventions:
<ul>
<li>n MILLISECONDS
<li>n SECONDS
<li>n MINUTES
<li>n HOURS
<li>n DAYS
</ul>
@param name
@param defaultValue in days
@return days | [
"Gets",
"the",
"duration",
"setting",
"and",
"converts",
"it",
"to",
"days",
".",
"<p",
"/",
">",
"The",
"setting",
"must",
"be",
"use",
"one",
"of",
"the",
"following",
"conventions",
":",
"<ul",
">",
"<li",
">",
"n",
"MILLISECONDS",
"<li",
">",
"n",
... | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L971-L976 |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/strategy/concurrency/HystrixConcurrencyStrategy.java | HystrixConcurrencyStrategy.getThreadPool | public ThreadPoolExecutor getThreadPool(final HystrixThreadPoolKey threadPoolKey, HystrixProperty<Integer> corePoolSize, HystrixProperty<Integer> maximumPoolSize, HystrixProperty<Integer> keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) {
"""
Factory method to provide {@link ThreadPoolExecutor} ins... | java | public ThreadPoolExecutor getThreadPool(final HystrixThreadPoolKey threadPoolKey, HystrixProperty<Integer> corePoolSize, HystrixProperty<Integer> maximumPoolSize, HystrixProperty<Integer> keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) {
final ThreadFactory threadFactory = getThreadFactory(thre... | [
"public",
"ThreadPoolExecutor",
"getThreadPool",
"(",
"final",
"HystrixThreadPoolKey",
"threadPoolKey",
",",
"HystrixProperty",
"<",
"Integer",
">",
"corePoolSize",
",",
"HystrixProperty",
"<",
"Integer",
">",
"maximumPoolSize",
",",
"HystrixProperty",
"<",
"Integer",
"... | Factory method to provide {@link ThreadPoolExecutor} instances as desired.
<p>
Note that the corePoolSize, maximumPoolSize and keepAliveTime values will be dynamically set during runtime if their values change using the {@link ThreadPoolExecutor#setCorePoolSize},
{@link ThreadPoolExecutor#setMaximumPoolSize} and {@link... | [
"Factory",
"method",
"to",
"provide",
"{",
"@link",
"ThreadPoolExecutor",
"}",
"instances",
"as",
"desired",
".",
"<p",
">",
"Note",
"that",
"the",
"corePoolSize",
"maximumPoolSize",
"and",
"keepAliveTime",
"values",
"will",
"be",
"dynamically",
"set",
"during",
... | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/concurrency/HystrixConcurrencyStrategy.java#L78-L92 |
apache/spark | launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java | AbstractCommandBuilder.addToClassPath | private void addToClassPath(Set<String> cp, String entries) {
"""
Adds entries to the classpath.
@param cp List to which the new entries are appended.
@param entries New classpath entries (separated by File.pathSeparator).
"""
if (isEmpty(entries)) {
return;
}
String[] split = entries.spl... | java | private void addToClassPath(Set<String> cp, String entries) {
if (isEmpty(entries)) {
return;
}
String[] split = entries.split(Pattern.quote(File.pathSeparator));
for (String entry : split) {
if (!isEmpty(entry)) {
if (new File(entry).isDirectory() && !entry.endsWith(File.separator))... | [
"private",
"void",
"addToClassPath",
"(",
"Set",
"<",
"String",
">",
"cp",
",",
"String",
"entries",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"entries",
")",
")",
"{",
"return",
";",
"}",
"String",
"[",
"]",
"split",
"=",
"entries",
".",
"split",
"(",
... | Adds entries to the classpath.
@param cp List to which the new entries are appended.
@param entries New classpath entries (separated by File.pathSeparator). | [
"Adds",
"entries",
"to",
"the",
"classpath",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java#L217-L230 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.flip | public static void flip(File imageFile, File outFile) throws IORuntimeException {
"""
水平翻转图像
@param imageFile 图像文件
@param outFile 输出文件
@throws IORuntimeException IO异常
@since 3.2.2
"""
flip(read(imageFile), outFile);
} | java | public static void flip(File imageFile, File outFile) throws IORuntimeException {
flip(read(imageFile), outFile);
} | [
"public",
"static",
"void",
"flip",
"(",
"File",
"imageFile",
",",
"File",
"outFile",
")",
"throws",
"IORuntimeException",
"{",
"flip",
"(",
"read",
"(",
"imageFile",
")",
",",
"outFile",
")",
";",
"}"
] | 水平翻转图像
@param imageFile 图像文件
@param outFile 输出文件
@throws IORuntimeException IO异常
@since 3.2.2 | [
"水平翻转图像"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1070-L1072 |
michel-kraemer/citeproc-java | citeproc-java/src/main/java/de/undercouch/citeproc/helper/CSLUtils.java | CSLUtils.readFileToString | public static String readFileToString(File f, String encoding) throws IOException {
"""
Reads a string from a file.
@param f the file
@param encoding the character encoding
@return the string
@throws IOException if the file contents could not be read
"""
return readStreamToString(new FileInputStream(f), ... | java | public static String readFileToString(File f, String encoding) throws IOException {
return readStreamToString(new FileInputStream(f), encoding);
} | [
"public",
"static",
"String",
"readFileToString",
"(",
"File",
"f",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"return",
"readStreamToString",
"(",
"new",
"FileInputStream",
"(",
"f",
")",
",",
"encoding",
")",
";",
"}"
] | Reads a string from a file.
@param f the file
@param encoding the character encoding
@return the string
@throws IOException if the file contents could not be read | [
"Reads",
"a",
"string",
"from",
"a",
"file",
"."
] | train | https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/CSLUtils.java#L73-L75 |
operasoftware/operaprestodriver | src/com/opera/core/systems/runner/launcher/OperaLauncherProtocol.java | OperaLauncherProtocol.sendRequestHeader | private void sendRequestHeader(MessageType type, int size) throws IOException {
"""
Send the 8 byte header before a Opera Launcher message body (payload).
@param type the payload type to be sent after
@param size size of the payload following the header
@throws IOException if socket send error or protocol par... | java | private void sendRequestHeader(MessageType type, int size) throws IOException {
ByteBuffer buf = ByteBuffer.allocate(8);
buf.order(ByteOrder.BIG_ENDIAN);
buf.put((byte) 'L');
buf.put((byte) '1');
buf.put(type.getValue());
buf.put((byte) 0); // request
buf.putInt(size);
buf.flip();
l... | [
"private",
"void",
"sendRequestHeader",
"(",
"MessageType",
"type",
",",
"int",
"size",
")",
"throws",
"IOException",
"{",
"ByteBuffer",
"buf",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"8",
")",
";",
"buf",
".",
"order",
"(",
"ByteOrder",
".",
"BIG_ENDIAN",
... | Send the 8 byte header before a Opera Launcher message body (payload).
@param type the payload type to be sent after
@param size size of the payload following the header
@throws IOException if socket send error or protocol parse error | [
"Send",
"the",
"8",
"byte",
"header",
"before",
"a",
"Opera",
"Launcher",
"message",
"body",
"(",
"payload",
")",
"."
] | train | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/runner/launcher/OperaLauncherProtocol.java#L127-L138 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java | ByteUtils.bytesToBigInteger | public static final BigInteger bytesToBigInteger( byte[] data, int[] offset ) {
"""
Return the <code>BigInteger</code> represented by the bytes in
<code>data</code> staring at offset <code>offset[0]</code>.
@param data the array from which to read
@param offset A single element array whose first element is th... | java | public static final BigInteger bytesToBigInteger( byte[] data, int[] offset ) {
int length = bytesToInt(data, offset);
byte[] bytes = new byte[length];
offset[0] += memcpy(bytes, 0, data, offset[0], length);
return new BigInteger(bytes);
} | [
"public",
"static",
"final",
"BigInteger",
"bytesToBigInteger",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"[",
"]",
"offset",
")",
"{",
"int",
"length",
"=",
"bytesToInt",
"(",
"data",
",",
"offset",
")",
";",
"byte",
"[",
"]",
"bytes",
"=",
"new",
... | Return the <code>BigInteger</code> represented by the bytes in
<code>data</code> staring at offset <code>offset[0]</code>.
@param data the array from which to read
@param offset A single element array whose first element is the index in
data from which to begin reading on function entry, and which
on function exit ha... | [
"Return",
"the",
"<code",
">",
"BigInteger<",
"/",
"code",
">",
"represented",
"by",
"the",
"bytes",
"in",
"<code",
">",
"data<",
"/",
"code",
">",
"staring",
"at",
"offset",
"<code",
">",
"offset",
"[",
"0",
"]",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java#L358-L364 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/parameter/ObjectParameter.java | ObjectParameter.parseClassParameter | private Object parseClassParameter(final String serializedObject) {
"""
Parse a class definition by calling Class.forName.
@param serializedObject the full class name
@return the class object
"""
Object res = null;
try {
res = Class.forName(serializedObject);
} catch (... | java | private Object parseClassParameter(final String serializedObject) {
Object res = null;
try {
res = Class.forName(serializedObject);
} catch (final ClassNotFoundException e) {
throw new CoreRuntimeException("Impossible to load class " + serializedObject, e);
}
... | [
"private",
"Object",
"parseClassParameter",
"(",
"final",
"String",
"serializedObject",
")",
"{",
"Object",
"res",
"=",
"null",
";",
"try",
"{",
"res",
"=",
"Class",
".",
"forName",
"(",
"serializedObject",
")",
";",
"}",
"catch",
"(",
"final",
"ClassNotFoun... | Parse a class definition by calling Class.forName.
@param serializedObject the full class name
@return the class object | [
"Parse",
"a",
"class",
"definition",
"by",
"calling",
"Class",
".",
"forName",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/parameter/ObjectParameter.java#L162-L170 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/handler/file/FileHandlerUtil.java | FileHandlerUtil.generateOutputFilePath | public static String generateOutputFilePath(String path, String fileName) {
"""
Generate output file path.
@param path the path
@param fileName the file name
@return the string
"""
String tempPath = separatorsToSystem(path);
tempPath = tempPath + File.separatorChar + fileName;
return tempPath;
} | java | public static String generateOutputFilePath(String path, String fileName) {
String tempPath = separatorsToSystem(path);
tempPath = tempPath + File.separatorChar + fileName;
return tempPath;
} | [
"public",
"static",
"String",
"generateOutputFilePath",
"(",
"String",
"path",
",",
"String",
"fileName",
")",
"{",
"String",
"tempPath",
"=",
"separatorsToSystem",
"(",
"path",
")",
";",
"tempPath",
"=",
"tempPath",
"+",
"File",
".",
"separatorChar",
"+",
"fi... | Generate output file path.
@param path the path
@param fileName the file name
@return the string | [
"Generate",
"output",
"file",
"path",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/handler/file/FileHandlerUtil.java#L62-L66 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsTransparencyImpl.java | CmsTransparencyImpl.setTransparency | public static void setTransparency(Element elem, int alpha) {
"""
Given a DOM element, set the transparency value, with 100 being fully opaque and 0 being fully transparent.<p>
@param elem A com.google.gwt.user.client.Element object
@param alpha An alpha value
"""
float ieVersion = getIEVersion(... | java | public static void setTransparency(Element elem, int alpha) {
float ieVersion = getIEVersion();
// only IE 8 requires special treatment, older IE versions are no longer supported
if (ieVersion < 9.0) {
elem.getStyle().setProperty(
"-ms-filter",
... | [
"public",
"static",
"void",
"setTransparency",
"(",
"Element",
"elem",
",",
"int",
"alpha",
")",
"{",
"float",
"ieVersion",
"=",
"getIEVersion",
"(",
")",
";",
"// only IE 8 requires special treatment, older IE versions are no longer supported\r",
"if",
"(",
"ieVersion",
... | Given a DOM element, set the transparency value, with 100 being fully opaque and 0 being fully transparent.<p>
@param elem A com.google.gwt.user.client.Element object
@param alpha An alpha value | [
"Given",
"a",
"DOM",
"element",
"set",
"the",
"transparency",
"value",
"with",
"100",
"being",
"fully",
"opaque",
"and",
"0",
"being",
"fully",
"transparent",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsTransparencyImpl.java#L74-L86 |
groovy/groovy-core | src/main/groovy/util/GroovyScriptEngine.java | GroovyScriptEngine.initGroovyLoader | private GroovyClassLoader initGroovyLoader() {
"""
Initialize a new GroovyClassLoader with a default or
constructor-supplied parentClassLoader.
@return the parent classloader used to load scripts
"""
return (GroovyClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
publi... | java | private GroovyClassLoader initGroovyLoader() {
return (GroovyClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
if (parentLoader instanceof GroovyClassLoader) {
return new ScriptClassLoader((GroovyClassLoader) parentLoader);
... | [
"private",
"GroovyClassLoader",
"initGroovyLoader",
"(",
")",
"{",
"return",
"(",
"GroovyClassLoader",
")",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"(",
")",
"{",
"public",
"Object",
"run",
"(",
")",
"{",
"if",
"(",
"parentLoader... | Initialize a new GroovyClassLoader with a default or
constructor-supplied parentClassLoader.
@return the parent classloader used to load scripts | [
"Initialize",
"a",
"new",
"GroovyClassLoader",
"with",
"a",
"default",
"or",
"constructor",
"-",
"supplied",
"parentClassLoader",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/util/GroovyScriptEngine.java#L357-L367 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.newVarNode | static Node newVarNode(String name, Node value) {
"""
Create a VAR node containing the given name and initial value expression.
"""
Node lhs = IR.name(name);
if (value != null) {
lhs.srcref(value);
}
return newVarNode(lhs, value);
} | java | static Node newVarNode(String name, Node value) {
Node lhs = IR.name(name);
if (value != null) {
lhs.srcref(value);
}
return newVarNode(lhs, value);
} | [
"static",
"Node",
"newVarNode",
"(",
"String",
"name",
",",
"Node",
"value",
")",
"{",
"Node",
"lhs",
"=",
"IR",
".",
"name",
"(",
"name",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"lhs",
".",
"srcref",
"(",
"value",
")",
";",
"}",
... | Create a VAR node containing the given name and initial value expression. | [
"Create",
"a",
"VAR",
"node",
"containing",
"the",
"given",
"name",
"and",
"initial",
"value",
"expression",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L4547-L4553 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryStatistics.java | RepositoryStatistics.statisticsFor | public static Statistics statisticsFor( long[] values ) {
"""
Utility method to construct the statistics for a series of values.
@param values the values; the array reference may not be null but the array may be empty
@return the core statistics; never null
"""
int length = values.length;
i... | java | public static Statistics statisticsFor( long[] values ) {
int length = values.length;
if (length == 0) return EMPTY_STATISTICS;
if (length == 1) return statisticsFor(values[0]);
long total = 0L;
long max = Long.MIN_VALUE;
long min = Long.MAX_VALUE;
for (long value... | [
"public",
"static",
"Statistics",
"statisticsFor",
"(",
"long",
"[",
"]",
"values",
")",
"{",
"int",
"length",
"=",
"values",
".",
"length",
";",
"if",
"(",
"length",
"==",
"0",
")",
"return",
"EMPTY_STATISTICS",
";",
"if",
"(",
"length",
"==",
"1",
")... | Utility method to construct the statistics for a series of values.
@param values the values; the array reference may not be null but the array may be empty
@return the core statistics; never null | [
"Utility",
"method",
"to",
"construct",
"the",
"statistics",
"for",
"a",
"series",
"of",
"values",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryStatistics.java#L693-L713 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/mains/DependencyGenericMain.java | DependencyGenericMain.setupDependencyExtractor | protected void setupDependencyExtractor() {
"""
Links the desired {@link DependencyExtractor} with the {@link
DependencyExtractorManager}, creating the {@code DependencyExtractor}
with optional configuration file, if it is not {@code null}, and any
{@link TokenFilter}s or {@link Stemmer}s that have been specifi... | java | protected void setupDependencyExtractor() {
TokenFilter filter = (argOptions.hasOption("tokenFilter"))
? TokenFilter.loadFromSpecification(argOptions.getStringOption('F'))
: null;
Stemmer stemmer = argOptions.getObjectOption("stemmingAlgorithm", null);
String format = ar... | [
"protected",
"void",
"setupDependencyExtractor",
"(",
")",
"{",
"TokenFilter",
"filter",
"=",
"(",
"argOptions",
".",
"hasOption",
"(",
"\"tokenFilter\"",
")",
")",
"?",
"TokenFilter",
".",
"loadFromSpecification",
"(",
"argOptions",
".",
"getStringOption",
"(",
"... | Links the desired {@link DependencyExtractor} with the {@link
DependencyExtractorManager}, creating the {@code DependencyExtractor}
with optional configuration file, if it is not {@code null}, and any
{@link TokenFilter}s or {@link Stemmer}s that have been specified by the
command line. | [
"Links",
"the",
"desired",
"{"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/mains/DependencyGenericMain.java#L101-L126 |
SeaCloudsEU/SeaCloudsPlatform | monitor/seaclouds-data-collector/src/main/java/eu/seaclouds/monitor/datacollector/Registry.java | Registry.addResource | public static void addResource(String type, String id, String url) {
"""
This method allow to add a new monitored resource to the Registry.
@param type the Type of the new resource to be added.
@param id the id of the new resource to be added.
@param url the String representation of the url of the new resource ... | java | public static void addResource(String type, String id, String url){
//add the new resource to the list of the managed resources
logger.info("Adding the following new resource to the Data Collector Descriptor: {}, {}", type, id);
try {
resources.put(new InternalCompo... | [
"public",
"static",
"void",
"addResource",
"(",
"String",
"type",
",",
"String",
"id",
",",
"String",
"url",
")",
"{",
"//add the new resource to the list of the managed resources",
"logger",
".",
"info",
"(",
"\"Adding the following new resource to the Data Collector Descrip... | This method allow to add a new monitored resource to the Registry.
@param type the Type of the new resource to be added.
@param id the id of the new resource to be added.
@param url the String representation of the url of the new resource to be added. | [
"This",
"method",
"allow",
"to",
"add",
"a",
"new",
"monitored",
"resource",
"to",
"the",
"Registry",
"."
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/monitor/seaclouds-data-collector/src/main/java/eu/seaclouds/monitor/datacollector/Registry.java#L213-L252 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemoteDomainProvider.java | RemoteDomainProvider.loadRepresentativeDomainAssignments | private void loadRepresentativeDomainAssignments() throws IOException {
"""
Requests the domain assignments for the current PDB IDs from the PDB.
@throws IOException if the server cannot be reached
"""
AssignmentXMLSerializer results = null;
try {
URL u = new URL(url + "getRepresentativeDomains");
l... | java | private void loadRepresentativeDomainAssignments() throws IOException {
AssignmentXMLSerializer results = null;
try {
URL u = new URL(url + "getRepresentativeDomains");
logger.info("Fetching {}",u);
InputStream response = URLConnectionTools.getInputStream(u);
String xml = JFatCatClient.convertStreamToSt... | [
"private",
"void",
"loadRepresentativeDomainAssignments",
"(",
")",
"throws",
"IOException",
"{",
"AssignmentXMLSerializer",
"results",
"=",
"null",
";",
"try",
"{",
"URL",
"u",
"=",
"new",
"URL",
"(",
"url",
"+",
"\"getRepresentativeDomains\"",
")",
";",
"logger"... | Requests the domain assignments for the current PDB IDs from the PDB.
@throws IOException if the server cannot be reached | [
"Requests",
"the",
"domain",
"assignments",
"for",
"the",
"current",
"PDB",
"IDs",
"from",
"the",
"PDB",
".",
"@throws",
"IOException",
"if",
"the",
"server",
"cannot",
"be",
"reached"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemoteDomainProvider.java#L97-L127 |
derari/cthul | matchers/src/main/java/org/cthul/matchers/diagnose/QuickDiagnosingMatcherBase.java | QuickDiagnosingMatcherBase.quickMatch | protected static boolean quickMatch(Matcher<?> matcher, Object item, Description mismatch) {
"""
Uses the {@code matcher} to validate {@code item}.
If validation fails, an error message is appended to {@code mismatch}.
<p>
The code is equivalent to
<pre>{@code
if (matcher.matches(item)) {
return true;
} els... | java | protected static boolean quickMatch(Matcher<?> matcher, Object item, Description mismatch) {
return QuickDiagnose.matches(matcher, item, mismatch);
} | [
"protected",
"static",
"boolean",
"quickMatch",
"(",
"Matcher",
"<",
"?",
">",
"matcher",
",",
"Object",
"item",
",",
"Description",
"mismatch",
")",
"{",
"return",
"QuickDiagnose",
".",
"matches",
"(",
"matcher",
",",
"item",
",",
"mismatch",
")",
";",
"}... | Uses the {@code matcher} to validate {@code item}.
If validation fails, an error message is appended to {@code mismatch}.
<p>
The code is equivalent to
<pre>{@code
if (matcher.matches(item)) {
return true;
} else {
matcher.describeMismatch(item, mismatch);
return false;
}
}</pre>
but uses optimizations for diagnosing m... | [
"Uses",
"the",
"{",
"@code",
"matcher",
"}",
"to",
"validate",
"{",
"@code",
"item",
"}",
".",
"If",
"validation",
"fails",
"an",
"error",
"message",
"is",
"appended",
"to",
"{",
"@code",
"mismatch",
"}",
".",
"<p",
">",
"The",
"code",
"is",
"equivalen... | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/matchers/src/main/java/org/cthul/matchers/diagnose/QuickDiagnosingMatcherBase.java#L81-L83 |
google/error-prone | core/src/main/java/com/google/errorprone/refaster/UTemplater.java | UTemplater.createTemplate | public static Template<?> createTemplate(Context context, MethodTree decl) {
"""
Returns a template based on a method. One-line methods starting with a {@code return} statement
are guessed to be expression templates, and all other methods are guessed to be block
templates.
"""
MethodSymbol declSym = ASTH... | java | public static Template<?> createTemplate(Context context, MethodTree decl) {
MethodSymbol declSym = ASTHelpers.getSymbol(decl);
ImmutableClassToInstanceMap<Annotation> annotations = UTemplater.annotationMap(declSym);
ImmutableMap<String, VarSymbol> freeExpressionVars = freeExpressionVariables(decl);
Con... | [
"public",
"static",
"Template",
"<",
"?",
">",
"createTemplate",
"(",
"Context",
"context",
",",
"MethodTree",
"decl",
")",
"{",
"MethodSymbol",
"declSym",
"=",
"ASTHelpers",
".",
"getSymbol",
"(",
"decl",
")",
";",
"ImmutableClassToInstanceMap",
"<",
"Annotatio... | Returns a template based on a method. One-line methods starting with a {@code return} statement
are guessed to be expression templates, and all other methods are guessed to be block
templates. | [
"Returns",
"a",
"template",
"based",
"on",
"a",
"method",
".",
"One",
"-",
"line",
"methods",
"starting",
"with",
"a",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/refaster/UTemplater.java#L141-L187 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/CmsEditorBase.java | CmsEditorBase.renderInlineEntity | public void renderInlineEntity(String entityId, I_CmsInlineFormParent formParent) {
"""
Renders the entity form within the given context.<p>
@param entityId the entity id
@param formParent the form parent widget
"""
m_entity = m_entityBackend.getEntity(entityId);
if (m_entity != null) {... | java | public void renderInlineEntity(String entityId, I_CmsInlineFormParent formParent) {
m_entity = m_entityBackend.getEntity(entityId);
if (m_entity != null) {
if (m_rootHandler == null) {
m_rootHandler = new CmsRootHandler();
} else {
m_rootHa... | [
"public",
"void",
"renderInlineEntity",
"(",
"String",
"entityId",
",",
"I_CmsInlineFormParent",
"formParent",
")",
"{",
"m_entity",
"=",
"m_entityBackend",
".",
"getEntity",
"(",
"entityId",
")",
";",
"if",
"(",
"m_entity",
"!=",
"null",
")",
"{",
"if",
"(",
... | Renders the entity form within the given context.<p>
@param entityId the entity id
@param formParent the form parent widget | [
"Renders",
"the",
"entity",
"form",
"within",
"the",
"given",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsEditorBase.java#L456-L473 |
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/ExtensionsInner.java | ExtensionsInner.disableMonitoringAsync | public Observable<Void> disableMonitoringAsync(String resourceGroupName, String clusterName) {
"""
Disables the Operations Management Suite (OMS) on the HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thro... | java | public Observable<Void> disableMonitoringAsync(String resourceGroupName, String clusterName) {
return disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
... | [
"public",
"Observable",
"<",
"Void",
">",
"disableMonitoringAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
")",
"{",
"return",
"disableMonitoringWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
")",
".",
"map",
"(",
"... | Disables the Operations Management Suite (OMS) on the HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Disables",
"the",
"Operations",
"Management",
"Suite",
"(",
"OMS",
")",
"on",
"the",
"HDInsight",
"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/ExtensionsInner.java#L391-L398 |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/Signature.java | Signature.classTypeSignature | private static void classTypeSignature(Result sb, TypeMirror type) throws IOException {
"""
ClassTypeSignature:
L PackageSpecifieropt SimpleClassTypeSignature ClassTypeSignatureSuffix* ;
@param sb
@param type
"""
sb.append('L');
packageSpecifier(sb, type);
simpleClassTypeSignature(sb... | java | private static void classTypeSignature(Result sb, TypeMirror type) throws IOException
{
sb.append('L');
packageSpecifier(sb, type);
simpleClassTypeSignature(sb, type);
classTypeSignatureSuffix(sb, type);
sb.append(';');
} | [
"private",
"static",
"void",
"classTypeSignature",
"(",
"Result",
"sb",
",",
"TypeMirror",
"type",
")",
"throws",
"IOException",
"{",
"sb",
".",
"append",
"(",
"'",
"'",
")",
";",
"packageSpecifier",
"(",
"sb",
",",
"type",
")",
";",
"simpleClassTypeSignatur... | ClassTypeSignature:
L PackageSpecifieropt SimpleClassTypeSignature ClassTypeSignatureSuffix* ;
@param sb
@param type | [
"ClassTypeSignature",
":",
"L",
"PackageSpecifieropt",
"SimpleClassTypeSignature",
"ClassTypeSignatureSuffix",
"*",
";"
] | train | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/Signature.java#L141-L148 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPPUtility.java | MPPUtility.getUnicodeString | public static final String getUnicodeString(byte[] data, int offset) {
"""
Reads a string of two byte characters from the input array.
This method assumes that the string finishes either at the
end of the array, or when char zero is encountered.
The value starts at the position specified by the offset
paramete... | java | public static final String getUnicodeString(byte[] data, int offset)
{
int length = getUnicodeStringLengthInBytes(data, offset);
return length == 0 ? "" : new String(data, offset, length, CharsetHelper.UTF16LE);
} | [
"public",
"static",
"final",
"String",
"getUnicodeString",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"int",
"length",
"=",
"getUnicodeStringLengthInBytes",
"(",
"data",
",",
"offset",
")",
";",
"return",
"length",
"==",
"0",
"?",
"\"\"... | Reads a string of two byte characters from the input array.
This method assumes that the string finishes either at the
end of the array, or when char zero is encountered.
The value starts at the position specified by the offset
parameter.
@param data byte array of data
@param offset start point of unicode string
@retu... | [
"Reads",
"a",
"string",
"of",
"two",
"byte",
"characters",
"from",
"the",
"input",
"array",
".",
"This",
"method",
"assumes",
"that",
"the",
"string",
"finishes",
"either",
"at",
"the",
"end",
"of",
"the",
"array",
"or",
"when",
"char",
"zero",
"is",
"en... | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L423-L427 |
Azure/azure-sdk-for-java | cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java | AccountsInner.getUsagesAsync | public Observable<UsagesResultInner> getUsagesAsync(String resourceGroupName, String accountName, String filter) {
"""
Get usages for the requested Cognitive Services account.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountName The name of Cognitive Servic... | java | public Observable<UsagesResultInner> getUsagesAsync(String resourceGroupName, String accountName, String filter) {
return getUsagesWithServiceResponseAsync(resourceGroupName, accountName, filter).map(new Func1<ServiceResponse<UsagesResultInner>, UsagesResultInner>() {
@Override
public Us... | [
"public",
"Observable",
"<",
"UsagesResultInner",
">",
"getUsagesAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"filter",
")",
"{",
"return",
"getUsagesWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
","... | Get usages for the requested Cognitive Services account.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountName The name of Cognitive Services account.
@param filter An OData filter expression that describes a subset of usages to return. The supported parameter is na... | [
"Get",
"usages",
"for",
"the",
"requested",
"Cognitive",
"Services",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java#L1182-L1189 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java | XSLTAttributeDef.processQNAMES | Vector processQNAMES(
StylesheetHandler handler, String uri, String name, String rawName, String value)
throws org.xml.sax.SAXException {
"""
Process an attribute string of type T_QNAMES into a vector of QNames where
the specification requires that non-prefixed elements not be placed in a
n... | java | Vector processQNAMES(
StylesheetHandler handler, String uri, String name, String rawName, String value)
throws org.xml.sax.SAXException
{
StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f");
int nQNames = tokenizer.countTokens();
Vector qnames = new Vector(nQNames);
... | [
"Vector",
"processQNAMES",
"(",
"StylesheetHandler",
"handler",
",",
"String",
"uri",
",",
"String",
"name",
",",
"String",
"rawName",
",",
"String",
"value",
")",
"throws",
"org",
".",
"xml",
".",
"sax",
".",
"SAXException",
"{",
"StringTokenizer",
"tokenizer... | Process an attribute string of type T_QNAMES into a vector of QNames where
the specification requires that non-prefixed elements not be placed in a
namespace. (See section 2.4 of XSLT 1.0.)
@param handler non-null reference to current StylesheetHandler that is constructing the Templates.
@param uri The Namespace URI,... | [
"Process",
"an",
"attribute",
"string",
"of",
"type",
"T_QNAMES",
"into",
"a",
"vector",
"of",
"QNames",
"where",
"the",
"specification",
"requires",
"that",
"non",
"-",
"prefixed",
"elements",
"not",
"be",
"placed",
"in",
"a",
"namespace",
".",
"(",
"See",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java#L1083-L1099 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/managers/AccountManager.java | AccountManager.setAvatar | @CheckReturnValue
public AccountManager setAvatar(Icon avatar, String currentPassword) {
"""
Sets the avatar for the currently logged in account
@param avatar
An {@link net.dv8tion.jda.core.entities.Icon Icon} instance representing
the new Avatar for the current account, {@code null} to reset the avatar ... | java | @CheckReturnValue
public AccountManager setAvatar(Icon avatar, String currentPassword)
{
this.currentPassword = currentPassword;
this.avatar = avatar;
set |= AVATAR;
return this;
} | [
"@",
"CheckReturnValue",
"public",
"AccountManager",
"setAvatar",
"(",
"Icon",
"avatar",
",",
"String",
"currentPassword",
")",
"{",
"this",
".",
"currentPassword",
"=",
"currentPassword",
";",
"this",
".",
"avatar",
"=",
"avatar",
";",
"set",
"|=",
"AVATAR",
... | Sets the avatar for the currently logged in account
@param avatar
An {@link net.dv8tion.jda.core.entities.Icon Icon} instance representing
the new Avatar for the current account, {@code null} to reset the avatar to the default avatar.
@param currentPassword
The current password for the represented account,
this is o... | [
"Sets",
"the",
"avatar",
"for",
"the",
"currently",
"logged",
"in",
"account"
] | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/managers/AccountManager.java#L251-L258 |
atomix/catalyst | common/src/main/java/io/atomix/catalyst/util/PropertiesReader.java | PropertiesReader.getEnum | public <T extends Enum<T>> T getEnum(String property, Class<T> type) {
"""
Reads an enum property.
@param property The property name.
@param type The enum type.
@param <T> The enum type.
@return The property value.
@throws ConfigurationException if the property is not present
"""
return Enum.valueOf... | java | public <T extends Enum<T>> T getEnum(String property, Class<T> type) {
return Enum.valueOf(type, getString(property));
} | [
"public",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"getEnum",
"(",
"String",
"property",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"Enum",
".",
"valueOf",
"(",
"type",
",",
"getString",
"(",
"property",
")",
")",
";",
... | Reads an enum property.
@param property The property name.
@param type The enum type.
@param <T> The enum type.
@return The property value.
@throws ConfigurationException if the property is not present | [
"Reads",
"an",
"enum",
"property",
"."
] | train | https://github.com/atomix/catalyst/blob/140e762cb975cd8ee1fd85119043c5b8bf917c5c/common/src/main/java/io/atomix/catalyst/util/PropertiesReader.java#L202-L204 |
openengsb/openengsb | api/ekb/src/main/java/org/openengsb/core/ekb/api/transformation/TransformationDescription.java | TransformationDescription.valueField | public void valueField(String targetField, String value) {
"""
Adds a value step to the transformation description. The given value is written to the target field.
"""
TransformationStep step = new TransformationStep();
step.setTargetField(targetField);
step.setOperationParameter(Transf... | java | public void valueField(String targetField, String value) {
TransformationStep step = new TransformationStep();
step.setTargetField(targetField);
step.setOperationParameter(TransformationConstants.VALUE_PARAM, value);
step.setOperationName("value");
steps.add(step);
} | [
"public",
"void",
"valueField",
"(",
"String",
"targetField",
",",
"String",
"value",
")",
"{",
"TransformationStep",
"step",
"=",
"new",
"TransformationStep",
"(",
")",
";",
"step",
".",
"setTargetField",
"(",
"targetField",
")",
";",
"step",
".",
"setOperati... | Adds a value step to the transformation description. The given value is written to the target field. | [
"Adds",
"a",
"value",
"step",
"to",
"the",
"transformation",
"description",
".",
"The",
"given",
"value",
"is",
"written",
"to",
"the",
"target",
"field",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/ekb/src/main/java/org/openengsb/core/ekb/api/transformation/TransformationDescription.java#L152-L158 |
b3log/latke | latke-core/src/main/java/org/json/JSONArray.java | JSONArray.optLong | public long optLong(int index, long defaultValue) {
"""
Get the optional long value associated with an index. The defaultValue is
returned if there is no value for the index, or if the value is not a
number and cannot be converted to a number.
@param index
The index must be between 0 and length() - 1.
@para... | java | public long optLong(int index, long defaultValue) {
final Number val = this.optNumber(index, null);
if (val == null) {
return defaultValue;
}
return val.longValue();
} | [
"public",
"long",
"optLong",
"(",
"int",
"index",
",",
"long",
"defaultValue",
")",
"{",
"final",
"Number",
"val",
"=",
"this",
".",
"optNumber",
"(",
"index",
",",
"null",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return",
"defaultValue",
... | Get the optional long value associated with an index. The defaultValue is
returned if there is no value for the index, or if the value is not a
number and cannot be converted to a number.
@param index
The index must be between 0 and length() - 1.
@param defaultValue
The default value.
@return The value. | [
"Get",
"the",
"optional",
"long",
"value",
"associated",
"with",
"an",
"index",
".",
"The",
"defaultValue",
"is",
"returned",
"if",
"there",
"is",
"no",
"value",
"for",
"the",
"index",
"or",
"if",
"the",
"value",
"is",
"not",
"a",
"number",
"and",
"canno... | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/JSONArray.java#L784-L790 |
apache/incubator-heron | heron/packing/src/java/org/apache/heron/packing/utils/PackingUtils.java | PackingUtils.finalizePadding | public static Resource finalizePadding(
Resource containerResource, Resource padding, int paddingPercentage) {
"""
Finalize padding by taking Math.max(containerResource * paddingPercent, paddingValue)
@param containerResource max container resource
@param padding padding value
@param paddingPercentage p... | java | public static Resource finalizePadding(
Resource containerResource, Resource padding, int paddingPercentage) {
double cpuPadding = Math.max(padding.getCpu(),
containerResource.getCpu() * paddingPercentage / 100);
ByteAmount ramPadding = ByteAmount.fromBytes(Math.max(padding.getRam().asBytes(),
... | [
"public",
"static",
"Resource",
"finalizePadding",
"(",
"Resource",
"containerResource",
",",
"Resource",
"padding",
",",
"int",
"paddingPercentage",
")",
"{",
"double",
"cpuPadding",
"=",
"Math",
".",
"max",
"(",
"padding",
".",
"getCpu",
"(",
")",
",",
"cont... | Finalize padding by taking Math.max(containerResource * paddingPercent, paddingValue)
@param containerResource max container resource
@param padding padding value
@param paddingPercentage padding percent
@return finalized padding amount | [
"Finalize",
"padding",
"by",
"taking",
"Math",
".",
"max",
"(",
"containerResource",
"*",
"paddingPercent",
"paddingValue",
")"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/packing/src/java/org/apache/heron/packing/utils/PackingUtils.java#L94-L104 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/duration/impl/PeriodFormatterData.java | PeriodFormatterData.appendPrefix | public boolean appendPrefix(int tl, int td, StringBuffer sb) {
"""
Append the appropriate prefix to the string builder, depending on whether and
how a limit and direction are to be displayed.
@param tl how and whether to display the time limit
@param td how and whether to display the time direction
@param sb... | java | public boolean appendPrefix(int tl, int td, StringBuffer sb) {
if (dr.scopeData != null) {
int ix = tl * 3 + td;
ScopeData sd = dr.scopeData[ix];
if (sd != null) {
String prefix = sd.prefix;
if (prefix != null) {
sb.append(prefix);
return sd.requiresDigitPrefix;... | [
"public",
"boolean",
"appendPrefix",
"(",
"int",
"tl",
",",
"int",
"td",
",",
"StringBuffer",
"sb",
")",
"{",
"if",
"(",
"dr",
".",
"scopeData",
"!=",
"null",
")",
"{",
"int",
"ix",
"=",
"tl",
"*",
"3",
"+",
"td",
";",
"ScopeData",
"sd",
"=",
"dr... | Append the appropriate prefix to the string builder, depending on whether and
how a limit and direction are to be displayed.
@param tl how and whether to display the time limit
@param td how and whether to display the time direction
@param sb the string builder to which to append the text
@return true if a following d... | [
"Append",
"the",
"appropriate",
"prefix",
"to",
"the",
"string",
"builder",
"depending",
"on",
"whether",
"and",
"how",
"a",
"limit",
"and",
"direction",
"are",
"to",
"be",
"displayed",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/duration/impl/PeriodFormatterData.java#L98-L111 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/HydrogenPlacer.java | HydrogenPlacer.placeHydrogens2D | public void placeHydrogens2D(final IAtomContainer container, final double bondLength) {
"""
Place all hydrogens connected to atoms which have already been laid out.
@param container atom container
@param bondLength bond length to user
"""
logger.debug("placing hydrogens on all atoms");
for... | java | public void placeHydrogens2D(final IAtomContainer container, final double bondLength) {
logger.debug("placing hydrogens on all atoms");
for (IAtom atom : container.atoms()) {
// only place hydrogens for atoms which have coordinates
if (atom.getPoint2d() != null) {
... | [
"public",
"void",
"placeHydrogens2D",
"(",
"final",
"IAtomContainer",
"container",
",",
"final",
"double",
"bondLength",
")",
"{",
"logger",
".",
"debug",
"(",
"\"placing hydrogens on all atoms\"",
")",
";",
"for",
"(",
"IAtom",
"atom",
":",
"container",
".",
"a... | Place all hydrogens connected to atoms which have already been laid out.
@param container atom container
@param bondLength bond length to user | [
"Place",
"all",
"hydrogens",
"connected",
"to",
"atoms",
"which",
"have",
"already",
"been",
"laid",
"out",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/HydrogenPlacer.java#L62-L71 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java | SphereUtil.latlngMinDistRad | @Reference(authors = "Erich Schubert, Arthur Zimek, Hans-Peter Kriegel", //
title = "Geodetic Distance Queries on R-Trees for Indexing Geographic Data", //
booktitle = "Int. Symp. Advances in Spatial and Temporal Databases (SSTD'2013)", //
url = "https://doi.org/10.1007/978-3-642-40235-7_9", //
... | java | @Reference(authors = "Erich Schubert, Arthur Zimek, Hans-Peter Kriegel", //
title = "Geodetic Distance Queries on R-Trees for Indexing Geographic Data", //
booktitle = "Int. Symp. Advances in Spatial and Temporal Databases (SSTD'2013)", //
url = "https://doi.org/10.1007/978-3-642-40235-7_9", //
... | [
"@",
"Reference",
"(",
"authors",
"=",
"\"Erich Schubert, Arthur Zimek, Hans-Peter Kriegel\"",
",",
"//",
"title",
"=",
"\"Geodetic Distance Queries on R-Trees for Indexing Geographic Data\"",
",",
"//",
"booktitle",
"=",
"\"Int. Symp. Advances in Spatial and Temporal Databases (SSTD'2... | Point to rectangle minimum distance.
<p>
Complexity:
<ul>
<li>Trivial cases (on longitude slice): no trigonometric functions.</li>
<li>Corner case: 3/4 trig + 4-5 trig, 1 sqrt</li>
<li>Cross-track case: 4+2 trig</li>
</ul>
<p>
<b>Important:</b> Rectangles must be in -pi:+pi, and must have min <
max, so they cannot c... | [
"Point",
"to",
"rectangle",
"minimum",
"distance",
".",
"<p",
">",
"Complexity",
":",
"<ul",
">",
"<li",
">",
"Trivial",
"cases",
"(",
"on",
"longitude",
"slice",
")",
":",
"no",
"trigonometric",
"functions",
".",
"<",
"/",
"li",
">",
"<li",
">",
"Corn... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java#L684-L729 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SerializedCheckpointData.java | SerializedCheckpointData.toDeque | public static <T> ArrayDeque<Tuple2<Long, Set<T>>> toDeque(
SerializedCheckpointData[] data,
TypeSerializer<T> serializer) throws IOException {
"""
De-serializes an array of SerializedCheckpointData back into an ArrayDeque of element checkpoints.
@param data The data to be deserialized.
@param serializer... | java | public static <T> ArrayDeque<Tuple2<Long, Set<T>>> toDeque(
SerializedCheckpointData[] data,
TypeSerializer<T> serializer) throws IOException {
ArrayDeque<Tuple2<Long, Set<T>>> deque = new ArrayDeque<>(data.length);
DataInputDeserializer deser = null;
for (SerializedCheckpointData checkpoint : data) {
... | [
"public",
"static",
"<",
"T",
">",
"ArrayDeque",
"<",
"Tuple2",
"<",
"Long",
",",
"Set",
"<",
"T",
">",
">",
">",
"toDeque",
"(",
"SerializedCheckpointData",
"[",
"]",
"data",
",",
"TypeSerializer",
"<",
"T",
">",
"serializer",
")",
"throws",
"IOExceptio... | De-serializes an array of SerializedCheckpointData back into an ArrayDeque of element checkpoints.
@param data The data to be deserialized.
@param serializer The serializer used to deserialize the data.
@param <T> The type of the elements.
@return An ArrayDeque of element checkpoints.
@throws IOException Thrown, if t... | [
"De",
"-",
"serializes",
"an",
"array",
"of",
"SerializedCheckpointData",
"back",
"into",
"an",
"ArrayDeque",
"of",
"element",
"checkpoints",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SerializedCheckpointData.java#L152-L179 |
LearnLib/automatalib | commons/util/src/main/java/net/automatalib/commons/util/IOUtil.java | IOUtil.copy | public static void copy(InputStream is, OutputStream os, boolean close) throws IOException {
"""
Copies all data from the given input stream to the given output stream.
@param is
the input stream.
@param os
the output stream.
@param close
<code>true</code> if both streams are closed afterwards, <code>false... | java | public static void copy(InputStream is, OutputStream os, boolean close) throws IOException {
byte[] buf = new byte[DEFAULT_BUFFER_SIZE];
int len;
try {
while ((len = is.read(buf)) != -1) {
os.write(buf, 0, len);
}
} finally {
if (close)... | [
"public",
"static",
"void",
"copy",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
",",
"boolean",
"close",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"DEFAULT_BUFFER_SIZE",
"]",
";",
"int",
"len",
";",
"tr... | Copies all data from the given input stream to the given output stream.
@param is
the input stream.
@param os
the output stream.
@param close
<code>true</code> if both streams are closed afterwards, <code>false</code> otherwise.
@throws IOException
if an I/O error occurs. | [
"Copies",
"all",
"data",
"from",
"the",
"given",
"input",
"stream",
"to",
"the",
"given",
"output",
"stream",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/util/src/main/java/net/automatalib/commons/util/IOUtil.java#L99-L112 |
opentable/otj-jaxrs | client/src/main/java/com/opentable/jaxrs/JaxRsClientFactory.java | JaxRsClientFactory.addFeatureToGroup | @SafeVarargs
public final synchronized JaxRsClientFactory addFeatureToGroup(JaxRsFeatureGroup group, Class<? extends Feature>... features) {
"""
Register a list of features to all clients marked with the given group.
"""
Preconditions.checkState(!started, "Already started building clients");
... | java | @SafeVarargs
public final synchronized JaxRsClientFactory addFeatureToGroup(JaxRsFeatureGroup group, Class<? extends Feature>... features) {
Preconditions.checkState(!started, "Already started building clients");
classFeatureMap.putAll(group, Arrays.asList(features));
LOG.trace("Group {} reg... | [
"@",
"SafeVarargs",
"public",
"final",
"synchronized",
"JaxRsClientFactory",
"addFeatureToGroup",
"(",
"JaxRsFeatureGroup",
"group",
",",
"Class",
"<",
"?",
"extends",
"Feature",
">",
"...",
"features",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"star... | Register a list of features to all clients marked with the given group. | [
"Register",
"a",
"list",
"of",
"features",
"to",
"all",
"clients",
"marked",
"with",
"the",
"given",
"group",
"."
] | train | https://github.com/opentable/otj-jaxrs/blob/384e7094fe5a56d41b2a9970bfd783fa85cbbcb8/client/src/main/java/com/opentable/jaxrs/JaxRsClientFactory.java#L159-L165 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Path3d.java | Path3d.quadTo | public void quadTo(Point3d controlPoint, Point3d endPoint) {
"""
Adds a curved segment, defined by two new points, to the path by
drawing a Quadratic curve that intersects both the current
coordinates and the specified endPoint,
using the specified controlPoint as a quadratic
parametric control point.
All coo... | java | public void quadTo(Point3d controlPoint, Point3d endPoint) {
ensureSlots(true, 6);
this.types[this.numTypesProperty.get()] = PathElementType.QUAD_TO;
this.numTypesProperty.set(this.numTypesProperty.get()+1);
this.coordsProperty[this.numCoordsProperty.get()] = controlPoint.xProperty;
this.numCoordsProperty.se... | [
"public",
"void",
"quadTo",
"(",
"Point3d",
"controlPoint",
",",
"Point3d",
"endPoint",
")",
"{",
"ensureSlots",
"(",
"true",
",",
"6",
")",
";",
"this",
".",
"types",
"[",
"this",
".",
"numTypesProperty",
".",
"get",
"(",
")",
"]",
"=",
"PathElementType... | Adds a curved segment, defined by two new points, to the path by
drawing a Quadratic curve that intersects both the current
coordinates and the specified endPoint,
using the specified controlPoint as a quadratic
parametric control point.
All coordinates are specified in Point3d.
We store the property here, and not the... | [
"Adds",
"a",
"curved",
"segment",
"defined",
"by",
"two",
"new",
"points",
"to",
"the",
"path",
"by",
"drawing",
"a",
"Quadratic",
"curve",
"that",
"intersects",
"both",
"the",
"current",
"coordinates",
"and",
"the",
"specified",
"endPoint",
"using",
"the",
... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Path3d.java#L2185-L2214 |
AKSW/RDFUnit | rdfunit-validate/src/main/java/org/aksw/rdfunit/validate/ws/AbstractRDFUnitWebService.java | AbstractRDFUnitWebService.writeResults | private static void writeResults(final RDFUnitConfiguration configuration, final TestExecution testExecution, HttpServletResponse httpServletResponse) throws RdfWriterException, IOException {
"""
Writes the output of the validation to the HttpServletResponse
"""
SerializationFormat serializationFormat ... | java | private static void writeResults(final RDFUnitConfiguration configuration, final TestExecution testExecution, HttpServletResponse httpServletResponse) throws RdfWriterException, IOException {
SerializationFormat serializationFormat = configuration.geFirstOutputFormat();
if (serializationFormat == null) ... | [
"private",
"static",
"void",
"writeResults",
"(",
"final",
"RDFUnitConfiguration",
"configuration",
",",
"final",
"TestExecution",
"testExecution",
",",
"HttpServletResponse",
"httpServletResponse",
")",
"throws",
"RdfWriterException",
",",
"IOException",
"{",
"Serializatio... | Writes the output of the validation to the HttpServletResponse | [
"Writes",
"the",
"output",
"of",
"the",
"validation",
"to",
"the",
"HttpServletResponse"
] | train | https://github.com/AKSW/RDFUnit/blob/083f18ebda4ad790b1fbb4cfe1c9dd1762d51384/rdfunit-validate/src/main/java/org/aksw/rdfunit/validate/ws/AbstractRDFUnitWebService.java#L83-L92 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.cut | public static void cut(InputStream srcStream, OutputStream destStream, Rectangle rectangle) {
"""
图像切割(按指定起点坐标和宽高切割),此方法并不关闭流
@param srcStream 源图像流
@param destStream 切片后的图像输出流
@param rectangle 矩形对象,表示矩形区域的x,y,width,height
@since 3.1.0
"""
cut(read(srcStream), destStream, rectangle);
} | java | public static void cut(InputStream srcStream, OutputStream destStream, Rectangle rectangle) {
cut(read(srcStream), destStream, rectangle);
} | [
"public",
"static",
"void",
"cut",
"(",
"InputStream",
"srcStream",
",",
"OutputStream",
"destStream",
",",
"Rectangle",
"rectangle",
")",
"{",
"cut",
"(",
"read",
"(",
"srcStream",
")",
",",
"destStream",
",",
"rectangle",
")",
";",
"}"
] | 图像切割(按指定起点坐标和宽高切割),此方法并不关闭流
@param srcStream 源图像流
@param destStream 切片后的图像输出流
@param rectangle 矩形对象,表示矩形区域的x,y,width,height
@since 3.1.0 | [
"图像切割",
"(",
"按指定起点坐标和宽高切割",
")",
",此方法并不关闭流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L268-L270 |
molgenis/molgenis | molgenis-i18n/src/main/java/org/molgenis/i18n/LocalizationMessageSource.java | LocalizationMessageSource.resolveCode | @Override
public MessageFormat resolveCode(String code, Locale locale) {
"""
Looks up the {@link MessageFormat} for a code.
@param code the code to look up
@param locale the {@link Locale} for which the code should be looked up
@return newly created {@link MessageFormat}
"""
String resolved = resolv... | java | @Override
public MessageFormat resolveCode(String code, Locale locale) {
String resolved = resolveCodeWithoutArguments(code, locale);
if (resolved == null) {
return null;
}
return createMessageFormat(resolved, locale);
} | [
"@",
"Override",
"public",
"MessageFormat",
"resolveCode",
"(",
"String",
"code",
",",
"Locale",
"locale",
")",
"{",
"String",
"resolved",
"=",
"resolveCodeWithoutArguments",
"(",
"code",
",",
"locale",
")",
";",
"if",
"(",
"resolved",
"==",
"null",
")",
"{"... | Looks up the {@link MessageFormat} for a code.
@param code the code to look up
@param locale the {@link Locale} for which the code should be looked up
@return newly created {@link MessageFormat} | [
"Looks",
"up",
"the",
"{",
"@link",
"MessageFormat",
"}",
"for",
"a",
"code",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-i18n/src/main/java/org/molgenis/i18n/LocalizationMessageSource.java#L61-L68 |
vkostyukov/la4j | src/main/java/org/la4j/Vector.java | Vector.slice | public Vector slice(int from, int until) {
"""
Retrieves the specified sub-vector of this vector. The sub-vector is specified by
interval of indices.
@param from the beginning of indices interval
@param until the ending of indices interval
@return the sub-vector of this vector
"""
if (until - f... | java | public Vector slice(int from, int until) {
if (until - from < 0) {
fail("Wrong slice range: [" + from + ".." + until + "].");
}
Vector result = blankOfLength(until - from);
for (int i = from; i < until; i++) {
result.set(i - from, get(i));
}
ret... | [
"public",
"Vector",
"slice",
"(",
"int",
"from",
",",
"int",
"until",
")",
"{",
"if",
"(",
"until",
"-",
"from",
"<",
"0",
")",
"{",
"fail",
"(",
"\"Wrong slice range: [\"",
"+",
"from",
"+",
"\"..\"",
"+",
"until",
"+",
"\"].\"",
")",
";",
"}",
"V... | Retrieves the specified sub-vector of this vector. The sub-vector is specified by
interval of indices.
@param from the beginning of indices interval
@param until the ending of indices interval
@return the sub-vector of this vector | [
"Retrieves",
"the",
"specified",
"sub",
"-",
"vector",
"of",
"this",
"vector",
".",
"The",
"sub",
"-",
"vector",
"is",
"specified",
"by",
"interval",
"of",
"indices",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Vector.java#L616-L628 |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java | AuditUtils.valueChanged | public static boolean valueChanged(Enum<?> before, Enum<?> after) {
"""
Returns true only if the value changed.
@param before the value before change
@param after the value after change
@return true if value changed, else false
"""
if (before == null && after == null) {
return false;
... | java | public static boolean valueChanged(Enum<?> before, Enum<?> after) {
if (before == null && after == null) {
return false;
}
if (after == null) {
return false;
}
if (before == null && after != null) {
return true;
}
return !(befor... | [
"public",
"static",
"boolean",
"valueChanged",
"(",
"Enum",
"<",
"?",
">",
"before",
",",
"Enum",
"<",
"?",
">",
"after",
")",
"{",
"if",
"(",
"before",
"==",
"null",
"&&",
"after",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
... | Returns true only if the value changed.
@param before the value before change
@param after the value after change
@return true if value changed, else false | [
"Returns",
"true",
"only",
"if",
"the",
"value",
"changed",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L169-L180 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitUses | @Override
public R visitUses(UsesTree node, P p) {
"""
{@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction}
"""
return defaultAction(node, p);
} | java | @Override
public R visitUses(UsesTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitUses",
"(",
"UsesTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L453-L456 |
demidenko05/beigesoft-webcrud-jar | src/main/java/org/beigesoft/web/factory/HlFlCnNm.java | HlFlCnNm.getFor | @Override
public final String getFor(final Class<?> pCls, final String pFldNm) {
"""
<p>Get thing for given class and field name.</p>
@param pCls a Class
@param pFldNm Field Name
@return converter name or NULL
"""
String cnNm;
boolean isCr = this.mngSettings.getFieldsSettings() == null
|| th... | java | @Override
public final String getFor(final Class<?> pCls, final String pFldNm) {
String cnNm;
boolean isCr = this.mngSettings.getFieldsSettings() == null
|| this.mngSettings.getFieldsSettings().get(pCls) == null;
cnNm = this.mngSettings.lazFldSts(pCls, pFldNm).get(this.settingName);
if (cnNm != ... | [
"@",
"Override",
"public",
"final",
"String",
"getFor",
"(",
"final",
"Class",
"<",
"?",
">",
"pCls",
",",
"final",
"String",
"pFldNm",
")",
"{",
"String",
"cnNm",
";",
"boolean",
"isCr",
"=",
"this",
".",
"mngSettings",
".",
"getFieldsSettings",
"(",
")... | <p>Get thing for given class and field name.</p>
@param pCls a Class
@param pFldNm Field Name
@return converter name or NULL | [
"<p",
">",
"Get",
"thing",
"for",
"given",
"class",
"and",
"field",
"name",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-webcrud-jar/blob/e973170f8fc1f164f0b67af9bb6a52b04579b64a/src/main/java/org/beigesoft/web/factory/HlFlCnNm.java#L61-L76 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java | CmsContainerpageController.getModelGroups | public List<CmsContainerPageElementPanel> getModelGroups() {
"""
Collects all container elements which are model groups.<p>
@return the list of model group container elements
"""
final List<CmsContainerPageElementPanel> result = Lists.newArrayList();
processPageContent(new I_PageContentVis... | java | public List<CmsContainerPageElementPanel> getModelGroups() {
final List<CmsContainerPageElementPanel> result = Lists.newArrayList();
processPageContent(new I_PageContentVisitor() {
public boolean beginContainer(String name, CmsContainer container) {
return true;
... | [
"public",
"List",
"<",
"CmsContainerPageElementPanel",
">",
"getModelGroups",
"(",
")",
"{",
"final",
"List",
"<",
"CmsContainerPageElementPanel",
">",
"result",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"processPageContent",
"(",
"new",
"I_PageContentVisito... | Collects all container elements which are model groups.<p>
@return the list of model group container elements | [
"Collects",
"all",
"container",
"elements",
"which",
"are",
"model",
"groups",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java#L1706-L1730 |
alibaba/canal | driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/server/OKPacket.java | OKPacket.fromBytes | public void fromBytes(byte[] data) throws IOException {
"""
<pre>
VERSION 4.1
Bytes Name
----- ----
1 (Length Coded Binary) field_count, always = 0
1-9 (Length Coded Binary) affected_rows
1-9 (Length Coded Binary) insert_id
2 serv... | java | public void fromBytes(byte[] data) throws IOException {
int index = 0;
// 1. read field count
this.fieldCount = data[0];
index++;
// 2. read affected rows
this.affectedRows = ByteHelper.readBinaryCodedLengthBytes(data, index);
index += this.affectedRows.length;
... | [
"public",
"void",
"fromBytes",
"(",
"byte",
"[",
"]",
"data",
")",
"throws",
"IOException",
"{",
"int",
"index",
"=",
"0",
";",
"// 1. read field count",
"this",
".",
"fieldCount",
"=",
"data",
"[",
"0",
"]",
";",
"index",
"++",
";",
"// 2. read affected r... | <pre>
VERSION 4.1
Bytes Name
----- ----
1 (Length Coded Binary) field_count, always = 0
1-9 (Length Coded Binary) affected_rows
1-9 (Length Coded Binary) insert_id
2 server_status
2 warning_count
n (until end of pa... | [
"<pre",
">",
"VERSION",
"4",
".",
"1",
"Bytes",
"Name",
"-----",
"----",
"1",
"(",
"Length",
"Coded",
"Binary",
")",
"field_count",
"always",
"=",
"0",
"1",
"-",
"9",
"(",
"Length",
"Coded",
"Binary",
")",
"affected_rows",
"1",
"-",
"9",
"(",
"Length... | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/server/OKPacket.java#L38-L58 |
GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageReadChannel.java | GoogleCloudStorageReadChannel.getInitialMetadata | @Nullable
protected GoogleCloudStorageItemInfo getInitialMetadata() throws IOException {
"""
Returns {@link GoogleCloudStorageItemInfo} used to initialize metadata in constructor. By
default returns {@code null} which means that metadata will be lazily initialized during first
read.
"""
if (!readOption... | java | @Nullable
protected GoogleCloudStorageItemInfo getInitialMetadata() throws IOException {
if (!readOptions.getFastFailOnNotFound()) {
return null;
}
StorageObject object;
try {
object =
ResilientOperation.retry(
ResilientOperation.getGoogleRequestCallable(createReque... | [
"@",
"Nullable",
"protected",
"GoogleCloudStorageItemInfo",
"getInitialMetadata",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"readOptions",
".",
"getFastFailOnNotFound",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"StorageObject",
"object",
";",
... | Returns {@link GoogleCloudStorageItemInfo} used to initialize metadata in constructor. By
default returns {@code null} which means that metadata will be lazily initialized during first
read. | [
"Returns",
"{"
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageReadChannel.java#L294-L316 |
UrielCh/ovh-java-sdk | ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java | ApiOvhSms.serviceName_phonebooks_bookKey_GET | public OvhPhonebook serviceName_phonebooks_bookKey_GET(String serviceName, String bookKey) throws IOException {
"""
Get this object properties
REST: GET /sms/{serviceName}/phonebooks/{bookKey}
@param serviceName [required] The internal name of your SMS offer
@param bookKey [required] Identifier of the phonebo... | java | public OvhPhonebook serviceName_phonebooks_bookKey_GET(String serviceName, String bookKey) throws IOException {
String qPath = "/sms/{serviceName}/phonebooks/{bookKey}";
StringBuilder sb = path(qPath, serviceName, bookKey);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPhonebo... | [
"public",
"OvhPhonebook",
"serviceName_phonebooks_bookKey_GET",
"(",
"String",
"serviceName",
",",
"String",
"bookKey",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/sms/{serviceName}/phonebooks/{bookKey}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
... | Get this object properties
REST: GET /sms/{serviceName}/phonebooks/{bookKey}
@param serviceName [required] The internal name of your SMS offer
@param bookKey [required] Identifier of the phonebook | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L1086-L1091 |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONGetter.java | JSONGetter.getStrEscaped | public String getStrEscaped(K key, String defaultValue) {
"""
获取字符串类型值,并转义不可见字符,如'\n'换行符会被转义为字符串"\n"
@param key 键
@param defaultValue 默认值
@return 字符串类型值
@since 4.2.2
"""
return JSONUtil.escape(getStr(key, defaultValue));
} | java | public String getStrEscaped(K key, String defaultValue) {
return JSONUtil.escape(getStr(key, defaultValue));
} | [
"public",
"String",
"getStrEscaped",
"(",
"K",
"key",
",",
"String",
"defaultValue",
")",
"{",
"return",
"JSONUtil",
".",
"escape",
"(",
"getStr",
"(",
"key",
",",
"defaultValue",
")",
")",
";",
"}"
] | 获取字符串类型值,并转义不可见字符,如'\n'换行符会被转义为字符串"\n"
@param key 键
@param defaultValue 默认值
@return 字符串类型值
@since 4.2.2 | [
"获取字符串类型值,并转义不可见字符,如",
"\\",
"n",
"换行符会被转义为字符串",
"\\",
"n"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONGetter.java#L43-L45 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseByteObj | @Nullable
public static Byte parseByteObj (@Nullable final String sStr) {
"""
Parse the given {@link String} as {@link Byte} with radix
{@value #DEFAULT_RADIX}.
@param sStr
The String to parse. May be <code>null</code>.
@return <code>null</code> if the string does not represent a valid value.
"""
r... | java | @Nullable
public static Byte parseByteObj (@Nullable final String sStr)
{
return parseByteObj (sStr, DEFAULT_RADIX, null);
} | [
"@",
"Nullable",
"public",
"static",
"Byte",
"parseByteObj",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
")",
"{",
"return",
"parseByteObj",
"(",
"sStr",
",",
"DEFAULT_RADIX",
",",
"null",
")",
";",
"}"
] | Parse the given {@link String} as {@link Byte} with radix
{@value #DEFAULT_RADIX}.
@param sStr
The String to parse. May be <code>null</code>.
@return <code>null</code> if the string does not represent a valid value. | [
"Parse",
"the",
"given",
"{",
"@link",
"String",
"}",
"as",
"{",
"@link",
"Byte",
"}",
"with",
"radix",
"{",
"@value",
"#DEFAULT_RADIX",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L396-L400 |
zeromq/jeromq | src/main/java/org/zeromq/ZAuth.java | ZAuth.configurePlain | public ZAuth configurePlain(String domain, String filename) {
"""
Configure PLAIN authentication for a given domain. PLAIN authentication
uses a plain-text password file. To cover all domains, use "*". You can
modify the password file at any time; it is reloaded automatically.
@param domain
@param filename
... | java | public ZAuth configurePlain(String domain, String filename)
{
Objects.requireNonNull(domain, "Domain has to be supplied");
Objects.requireNonNull(filename, "File name has to be supplied");
return send(Mechanism.PLAIN.name(), domain, filename);
} | [
"public",
"ZAuth",
"configurePlain",
"(",
"String",
"domain",
",",
"String",
"filename",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"domain",
",",
"\"Domain has to be supplied\"",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"filename",
",",
"\"File name... | Configure PLAIN authentication for a given domain. PLAIN authentication
uses a plain-text password file. To cover all domains, use "*". You can
modify the password file at any time; it is reloaded automatically.
@param domain
@param filename | [
"Configure",
"PLAIN",
"authentication",
"for",
"a",
"given",
"domain",
".",
"PLAIN",
"authentication",
"uses",
"a",
"plain",
"-",
"text",
"password",
"file",
".",
"To",
"cover",
"all",
"domains",
"use",
"*",
".",
"You",
"can",
"modify",
"the",
"password",
... | train | https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZAuth.java#L528-L533 |
Stratio/bdt | src/main/java/com/stratio/qa/utils/ElasticSearchUtils.java | ElasticSearchUtils.indexDocument | public void indexDocument(String indexName, String mappingName, String id, XContentBuilder document)
throws Exception {
"""
Indexes a document.
@param indexName
@param mappingName
@param id unique identifier of the document
@param document
@throws Exception
"""
client.prepar... | java | public void indexDocument(String indexName, String mappingName, String id, XContentBuilder document)
throws Exception {
client.prepareIndex(indexName, mappingName, id).setSource(document).get();
} | [
"public",
"void",
"indexDocument",
"(",
"String",
"indexName",
",",
"String",
"mappingName",
",",
"String",
"id",
",",
"XContentBuilder",
"document",
")",
"throws",
"Exception",
"{",
"client",
".",
"prepareIndex",
"(",
"indexName",
",",
"mappingName",
",",
"id",... | Indexes a document.
@param indexName
@param mappingName
@param id unique identifier of the document
@param document
@throws Exception | [
"Indexes",
"a",
"document",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/ElasticSearchUtils.java#L273-L276 |
ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/dialogs/MappingValidationDialog.java | MappingValidationDialog.addText | public void addText(final String text, final Style style) {
"""
*
Adds the text synchronously. Do not call from the Event thread. Use a
working thread.
@param text
@param style
@throws InvocationTargetException
@throws InterruptedException
"""
try {
SwingUtilities.invokeAndWait(new Runnable()... | java | public void addText(final String text, final Style style) {
try {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
try {
doc.insertString(index, text, style);
index = index + text.length();
invalidate();
repaint();
}
... | [
"public",
"void",
"addText",
"(",
"final",
"String",
"text",
",",
"final",
"Style",
"style",
")",
"{",
"try",
"{",
"SwingUtilities",
".",
"invokeAndWait",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"doc",... | *
Adds the text synchronously. Do not call from the Event thread. Use a
working thread.
@param text
@param style
@throws InvocationTargetException
@throws InterruptedException | [
"*",
"Adds",
"the",
"text",
"synchronously",
".",
"Do",
"not",
"call",
"from",
"the",
"Event",
"thread",
".",
"Use",
"a",
"working",
"thread",
"."
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/dialogs/MappingValidationDialog.java#L141-L163 |
cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/TemplateHandler3D.java | TemplateHandler3D.loadTemplates | private void loadTemplates() throws CDKException {
"""
Load ring template
@throws CDKException The template file cannot be loaded
"""
try (InputStream gin = getClass().getResourceAsStream(TEMPLATE_PATH);
InputStream in = new GZIPInputStream(gin);
IteratingSDFReader sdfr = n... | java | private void loadTemplates() throws CDKException {
try (InputStream gin = getClass().getResourceAsStream(TEMPLATE_PATH);
InputStream in = new GZIPInputStream(gin);
IteratingSDFReader sdfr = new IteratingSDFReader(in, builder)) {
while (sdfr.hasNext()) {
fina... | [
"private",
"void",
"loadTemplates",
"(",
")",
"throws",
"CDKException",
"{",
"try",
"(",
"InputStream",
"gin",
"=",
"getClass",
"(",
")",
".",
"getResourceAsStream",
"(",
"TEMPLATE_PATH",
")",
";",
"InputStream",
"in",
"=",
"new",
"GZIPInputStream",
"(",
"gin"... | Load ring template
@throws CDKException The template file cannot be loaded | [
"Load",
"ring",
"template"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/TemplateHandler3D.java#L111-L122 |
NessComputing/components-ness-httpclient | client/src/main/java/com/nesscomputing/httpclient/HttpClientDefaultAuthProvider.java | HttpClientDefaultAuthProvider.forUserAndHost | public static final HttpClientAuthProvider forUserAndHost(final String host, final int port, final String login, final String password) {
"""
Returns an {@link HttpClientAuthProvider} that will accept a specific remote host and presents
the login and password as authentication credential.
@param host The rem... | java | public static final HttpClientAuthProvider forUserAndHost(final String host, final int port, final String login, final String password)
{
return new HttpClientDefaultAuthProvider(null, host, port, null, login, password);
} | [
"public",
"static",
"final",
"HttpClientAuthProvider",
"forUserAndHost",
"(",
"final",
"String",
"host",
",",
"final",
"int",
"port",
",",
"final",
"String",
"login",
",",
"final",
"String",
"password",
")",
"{",
"return",
"new",
"HttpClientDefaultAuthProvider",
"... | Returns an {@link HttpClientAuthProvider} that will accept a specific remote host and presents
the login and password as authentication credential.
@param host The remote host for which the credentials are valid.
@param port Port for the remote host.
@param login Login to use.
@param password Password to use. | [
"Returns",
"an",
"{",
"@link",
"HttpClientAuthProvider",
"}",
"that",
"will",
"accept",
"a",
"specific",
"remote",
"host",
"and",
"presents",
"the",
"login",
"and",
"password",
"as",
"authentication",
"credential",
"."
] | train | https://github.com/NessComputing/components-ness-httpclient/blob/8e97e8576e470449672c81fa7890c60f9986966d/client/src/main/java/com/nesscomputing/httpclient/HttpClientDefaultAuthProvider.java#L59-L62 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/AbstractResources.java | AbstractResources.getResourceAsFile | public void getResourceAsFile(String path, String fileType, OutputStream outputStream)
throws SmartsheetException {
"""
Get a sheet as a file.
Exceptions:
- InvalidRequestException : if there is any problem with the REST API request
- AuthorizationException : if there is any problem with the REST ... | java | public void getResourceAsFile(String path, String fileType, OutputStream outputStream)
throws SmartsheetException {
Util.throwIfNull(outputStream, fileType);
HttpRequest request;
request = createHttpRequest(this.getSmartsheet().getBaseURI().resolve(path), HttpMethod.GET);
re... | [
"public",
"void",
"getResourceAsFile",
"(",
"String",
"path",
",",
"String",
"fileType",
",",
"OutputStream",
"outputStream",
")",
"throws",
"SmartsheetException",
"{",
"Util",
".",
"throwIfNull",
"(",
"outputStream",
",",
"fileType",
")",
";",
"HttpRequest",
"req... | Get a sheet as a file.
Exceptions:
- InvalidRequestException : if there is any problem with the REST API request
- AuthorizationException : if there is any problem with the REST API authorization(access token)
- ResourceNotFoundException : if the resource can not be found
- ServiceUnavailableException : if the REST AP... | [
"Get",
"a",
"sheet",
"as",
"a",
"file",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/AbstractResources.java#L929-L954 |
spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/token/store/jwk/JwkDefinitionSource.java | JwkDefinitionSource.loadJwkDefinitions | static Map<String, JwkDefinitionHolder> loadJwkDefinitions(URL jwkSetUrl) {
"""
Fetches the JWK Set from the provided <code>URL</code> and
returns a <code>Map</code> keyed by the JWK keyId ("kid")
and mapped to an association of the {@link JwkDefinition} and {@link SignatureVerifier}.
Uses a {@link Jw... | java | static Map<String, JwkDefinitionHolder> loadJwkDefinitions(URL jwkSetUrl) {
InputStream jwkSetSource;
try {
jwkSetSource = jwkSetUrl.openStream();
} catch (IOException ex) {
throw new JwkException("An I/O error occurred while reading from the JWK Set source: " + ex.getMessage(), ex);
}
Set<JwkDefinitio... | [
"static",
"Map",
"<",
"String",
",",
"JwkDefinitionHolder",
">",
"loadJwkDefinitions",
"(",
"URL",
"jwkSetUrl",
")",
"{",
"InputStream",
"jwkSetSource",
";",
"try",
"{",
"jwkSetSource",
"=",
"jwkSetUrl",
".",
"openStream",
"(",
")",
";",
"}",
"catch",
"(",
"... | Fetches the JWK Set from the provided <code>URL</code> and
returns a <code>Map</code> keyed by the JWK keyId ("kid")
and mapped to an association of the {@link JwkDefinition} and {@link SignatureVerifier}.
Uses a {@link JwkSetConverter} to convert the JWK Set URL source to a set of {@link JwkDefinition}(s)
fo... | [
"Fetches",
"the",
"JWK",
"Set",
"from",
"the",
"provided",
"<code",
">",
"URL<",
"/",
"code",
">",
"and",
"returns",
"a",
"<code",
">",
"Map<",
"/",
"code",
">",
"keyed",
"by",
"the",
"JWK",
"keyId",
"(",
""",
";",
"kid"",
";",
")",
"and",
... | train | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/token/store/jwk/JwkDefinitionSource.java#L128-L151 |
protostuff/protostuff | protostuff-parser/src/main/java/io/protostuff/parser/DefaultProtoLoader.java | DefaultProtoLoader.getResource | public static URL getResource(String resource, Class<?> context) {
"""
Loads a {@link URL} resource from the classloader; If not found, the classloader of the {@code context} class
specified will be used.
"""
return getResource(resource, context, false);
} | java | public static URL getResource(String resource, Class<?> context)
{
return getResource(resource, context, false);
} | [
"public",
"static",
"URL",
"getResource",
"(",
"String",
"resource",
",",
"Class",
"<",
"?",
">",
"context",
")",
"{",
"return",
"getResource",
"(",
"resource",
",",
"context",
",",
"false",
")",
";",
"}"
] | Loads a {@link URL} resource from the classloader; If not found, the classloader of the {@code context} class
specified will be used. | [
"Loads",
"a",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-parser/src/main/java/io/protostuff/parser/DefaultProtoLoader.java#L289-L292 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/annotation/AuditAnnotationAttributes.java | AuditAnnotationAttributes.getTag | private String getTag(final Annotation[] annotations, final Method method) {
"""
Gets the repository.
@param annotations the annotations
@param method the method
@return the repository
"""
for (final Annotation annotation : annotations) {
if (annotation instanceof Audit) {
... | java | private String getTag(final Annotation[] annotations, final Method method) {
for (final Annotation annotation : annotations) {
if (annotation instanceof Audit) {
final Audit audit = (Audit) annotation;
return audit.tag();
}
}
return null;
... | [
"private",
"String",
"getTag",
"(",
"final",
"Annotation",
"[",
"]",
"annotations",
",",
"final",
"Method",
"method",
")",
"{",
"for",
"(",
"final",
"Annotation",
"annotation",
":",
"annotations",
")",
"{",
"if",
"(",
"annotation",
"instanceof",
"Audit",
")"... | Gets the repository.
@param annotations the annotations
@param method the method
@return the repository | [
"Gets",
"the",
"repository",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/annotation/AuditAnnotationAttributes.java#L190-L198 |
Stratio/stratio-connector-commons | connector-commons/src/main/java/com/stratio/connector/commons/engine/CommonsMetadataEngine.java | CommonsMetadataEngine.dropTable | @Override
public final void dropTable(ClusterName targetCluster, TableName name) throws UnsupportedException,
ExecutionException {
"""
This method drop a table.
@param targetCluster the target cluster where the table will be dropped.
@param name the table name.
@throws UnsupportedExc... | java | @Override
public final void dropTable(ClusterName targetCluster, TableName name) throws UnsupportedException,
ExecutionException {
try {
connectionHandler.startJob(targetCluster.getName());
if (logger.isDebugEnabled()) {
logger.debug("Dropping table [" ... | [
"@",
"Override",
"public",
"final",
"void",
"dropTable",
"(",
"ClusterName",
"targetCluster",
",",
"TableName",
"name",
")",
"throws",
"UnsupportedException",
",",
"ExecutionException",
"{",
"try",
"{",
"connectionHandler",
".",
"startJob",
"(",
"targetCluster",
"."... | This method drop a table.
@param targetCluster the target cluster where the table will be dropped.
@param name the table name.
@throws UnsupportedException if an operation is not supported.
@throws ExecutionException if an error happens. | [
"This",
"method",
"drop",
"a",
"table",
"."
] | train | https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/engine/CommonsMetadataEngine.java#L174-L196 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/VarianceGammaProcess.java | VarianceGammaProcess.doGenerateVarianceGammaIncrements | private void doGenerateVarianceGammaIncrements() {
"""
Lazy initialization of gammaIncrement. Synchronized to ensure thread safety of lazy init.
"""
if(varianceGammaIncrements != null) {
return;
}
myGammaProcess =
new GammaProcess(timeDiscretization,numberOfFactors,numberOfPaths,seed,1/nu,nu);
... | java | private void doGenerateVarianceGammaIncrements() {
if(varianceGammaIncrements != null) {
return;
}
myGammaProcess =
new GammaProcess(timeDiscretization,numberOfFactors,numberOfPaths,seed,1/nu,nu);
myBrownianMotion =
new BrownianMotionLazyInit(timeDiscretization,numberOfFactors,numberOfPaths,seed+1)... | [
"private",
"void",
"doGenerateVarianceGammaIncrements",
"(",
")",
"{",
"if",
"(",
"varianceGammaIncrements",
"!=",
"null",
")",
"{",
"return",
";",
"}",
"myGammaProcess",
"=",
"new",
"GammaProcess",
"(",
"timeDiscretization",
",",
"numberOfFactors",
",",
"numberOfPa... | Lazy initialization of gammaIncrement. Synchronized to ensure thread safety of lazy init. | [
"Lazy",
"initialization",
"of",
"gammaIncrement",
".",
"Synchronized",
"to",
"ensure",
"thread",
"safety",
"of",
"lazy",
"init",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/VarianceGammaProcess.java#L80-L111 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_spam_ipSpamming_stats_GET | public ArrayList<OvhSpamStats> ip_spam_ipSpamming_stats_GET(String ip, String ipSpamming, Date from, Date to) throws IOException {
"""
Get statistics about the email traffic
REST: GET /ip/{ip}/spam/{ipSpamming}/stats
@param from [required] Start date
@param to [required] End date
@param ip [required]
@param... | java | public ArrayList<OvhSpamStats> ip_spam_ipSpamming_stats_GET(String ip, String ipSpamming, Date from, Date to) throws IOException {
String qPath = "/ip/{ip}/spam/{ipSpamming}/stats";
StringBuilder sb = path(qPath, ip, ipSpamming);
query(sb, "from", from);
query(sb, "to", to);
String resp = exec(qPath, "GET", s... | [
"public",
"ArrayList",
"<",
"OvhSpamStats",
">",
"ip_spam_ipSpamming_stats_GET",
"(",
"String",
"ip",
",",
"String",
"ipSpamming",
",",
"Date",
"from",
",",
"Date",
"to",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/spam/{ipSpamming}/stats\... | Get statistics about the email traffic
REST: GET /ip/{ip}/spam/{ipSpamming}/stats
@param from [required] Start date
@param to [required] End date
@param ip [required]
@param ipSpamming [required] IP address which is sending spam | [
"Get",
"statistics",
"about",
"the",
"email",
"traffic"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L240-L247 |
OpenLiberty/open-liberty | dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/providers/GetLibraries.java | GetLibraries.listenFor | @Override
public void listenFor(final String libraryId, final Slot<? super Library> slot) {
"""
invoked by the blocking list when a synchronous fetch operation fails
"""
// Create a shared library listener
new AbstractLibraryListener(libraryId, ownerID, Providers.bundleContext) {
... | java | @Override
public void listenFor(final String libraryId, final Slot<? super Library> slot) {
// Create a shared library listener
new AbstractLibraryListener(libraryId, ownerID, Providers.bundleContext) {
@Override
void update() {
final String methodName = "upda... | [
"@",
"Override",
"public",
"void",
"listenFor",
"(",
"final",
"String",
"libraryId",
",",
"final",
"Slot",
"<",
"?",
"super",
"Library",
">",
"slot",
")",
"{",
"// Create a shared library listener",
"new",
"AbstractLibraryListener",
"(",
"libraryId",
",",
"ownerID... | invoked by the blocking list when a synchronous fetch operation fails | [
"invoked",
"by",
"the",
"blocking",
"list",
"when",
"a",
"synchronous",
"fetch",
"operation",
"fails"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/providers/GetLibraries.java#L44-L63 |
wildfly/wildfly-maven-plugin | core/src/main/java/org/wildfly/plugin/core/ServerHelper.java | ServerHelper.waitForDomain | public static void waitForDomain(final ModelControllerClient client, final long startupTimeout)
throws InterruptedException, RuntimeException, TimeoutException {
"""
Waits the given amount of time in seconds for a managed domain to start. A domain is considered started when each
of the servers in the ... | java | public static void waitForDomain(final ModelControllerClient client, final long startupTimeout)
throws InterruptedException, RuntimeException, TimeoutException {
waitForDomain(null, client, startupTimeout);
} | [
"public",
"static",
"void",
"waitForDomain",
"(",
"final",
"ModelControllerClient",
"client",
",",
"final",
"long",
"startupTimeout",
")",
"throws",
"InterruptedException",
",",
"RuntimeException",
",",
"TimeoutException",
"{",
"waitForDomain",
"(",
"null",
",",
"clie... | Waits the given amount of time in seconds for a managed domain to start. A domain is considered started when each
of the servers in the domain are started unless the server is disabled.
@param client the client used to communicate with the server
@param startupTimeout the time, in seconds, to wait for the serv... | [
"Waits",
"the",
"given",
"amount",
"of",
"time",
"in",
"seconds",
"for",
"a",
"managed",
"domain",
"to",
"start",
".",
"A",
"domain",
"is",
"considered",
"started",
"when",
"each",
"of",
"the",
"servers",
"in",
"the",
"domain",
"are",
"started",
"unless",
... | train | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/core/src/main/java/org/wildfly/plugin/core/ServerHelper.java#L141-L144 |
JM-Lab/utils-elasticsearch | src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchSearchAndCount.java | JMElasticsearchSearchAndCount.searchAll | public SearchResponse searchAll(String[] indices, String[] types) {
"""
Search all search response.
@param indices the indices
@param types the types
@return the search response
"""
return searchAll(indices, types, null, null);
} | java | public SearchResponse searchAll(String[] indices, String[] types) {
return searchAll(indices, types, null, null);
} | [
"public",
"SearchResponse",
"searchAll",
"(",
"String",
"[",
"]",
"indices",
",",
"String",
"[",
"]",
"types",
")",
"{",
"return",
"searchAll",
"(",
"indices",
",",
"types",
",",
"null",
",",
"null",
")",
";",
"}"
] | Search all search response.
@param indices the indices
@param types the types
@return the search response | [
"Search",
"all",
"search",
"response",
"."
] | train | https://github.com/JM-Lab/utils-elasticsearch/blob/6ccec90e1e51d65d2af5efbb6d7b9f9bad90e638/src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchSearchAndCount.java#L421-L423 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/discovery/AgentDetails.java | AgentDetails.setServerInfo | public void setServerInfo(String pVendor, String pProduct, String pVersion) {
"""
Single method for updating the server information when the server has been detected
@param pVendor vendor of the deteted container
@param pProduct name of the contained
@param pVersion server version (not Jolokia's version!)
... | java | public void setServerInfo(String pVendor, String pProduct, String pVersion) {
checkSeal();
serverVendor = pVendor;
serverProduct = pProduct;
serverVersion = pVersion;
} | [
"public",
"void",
"setServerInfo",
"(",
"String",
"pVendor",
",",
"String",
"pProduct",
",",
"String",
"pVersion",
")",
"{",
"checkSeal",
"(",
")",
";",
"serverVendor",
"=",
"pVendor",
";",
"serverProduct",
"=",
"pProduct",
";",
"serverVersion",
"=",
"pVersion... | Single method for updating the server information when the server has been detected
@param pVendor vendor of the deteted container
@param pProduct name of the contained
@param pVersion server version (not Jolokia's version!) | [
"Single",
"method",
"for",
"updating",
"the",
"server",
"information",
"when",
"the",
"server",
"has",
"been",
"detected"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/discovery/AgentDetails.java#L90-L95 |
javagl/ND | nd-distance/src/main/java/de/javagl/nd/distance/tuples/d/DoubleTupleDistanceFunctions.java | DoubleTupleDistanceFunctions.computeEuclidean | public static double computeEuclidean(DoubleTuple t0, DoubleTuple t1) {
"""
Computes the Euclidean distance between the given tuples
@param t0 The first tuple
@param t1 The second tuple
@return The distance
@throws IllegalArgumentException If the given tuples do not
have the same {@link Tuple#getSize() size... | java | public static double computeEuclidean(DoubleTuple t0, DoubleTuple t1)
{
return Math.sqrt(computeEuclideanSquared(t0, t1));
} | [
"public",
"static",
"double",
"computeEuclidean",
"(",
"DoubleTuple",
"t0",
",",
"DoubleTuple",
"t1",
")",
"{",
"return",
"Math",
".",
"sqrt",
"(",
"computeEuclideanSquared",
"(",
"t0",
",",
"t1",
")",
")",
";",
"}"
] | Computes the Euclidean distance between the given tuples
@param t0 The first tuple
@param t1 The second tuple
@return The distance
@throws IllegalArgumentException If the given tuples do not
have the same {@link Tuple#getSize() size} | [
"Computes",
"the",
"Euclidean",
"distance",
"between",
"the",
"given",
"tuples"
] | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-distance/src/main/java/de/javagl/nd/distance/tuples/d/DoubleTupleDistanceFunctions.java#L104-L107 |
google/closure-compiler | src/com/google/javascript/rhino/JSDocInfo.java | JSDocInfo.declareParam | boolean declareParam(JSTypeExpression jsType, String parameter) {
"""
Declares a parameter. Parameters are described using the {@code @param}
annotation.
@param jsType the parameter's type, it may be {@code null} when the
{@code @param} annotation did not specify a type.
@param parameter the parameter's name... | java | boolean declareParam(JSTypeExpression jsType, String parameter) {
lazyInitInfo();
if (info.parameters == null) {
info.parameters = new LinkedHashMap<>();
}
if (!info.parameters.containsKey(parameter)) {
info.parameters.put(parameter, jsType);
return true;
} else {
return fals... | [
"boolean",
"declareParam",
"(",
"JSTypeExpression",
"jsType",
",",
"String",
"parameter",
")",
"{",
"lazyInitInfo",
"(",
")",
";",
"if",
"(",
"info",
".",
"parameters",
"==",
"null",
")",
"{",
"info",
".",
"parameters",
"=",
"new",
"LinkedHashMap",
"<>",
"... | Declares a parameter. Parameters are described using the {@code @param}
annotation.
@param jsType the parameter's type, it may be {@code null} when the
{@code @param} annotation did not specify a type.
@param parameter the parameter's name | [
"Declares",
"a",
"parameter",
".",
"Parameters",
"are",
"described",
"using",
"the",
"{",
"@code",
"@param",
"}",
"annotation",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/JSDocInfo.java#L1383-L1394 |
javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/print/AdvancedPageNumberEvents.java | AdvancedPageNumberEvents.onCloseDocument | @Override
public void onCloseDocument(final PdfWriter writer, final Document document) {
"""
we override the onCloseDocument method.
@param writer
PdfWriter
@param document
Document
"""
template.beginText();
template.setFontAndSize(bf, 8);
template.showText(String.valueOf(writer.getPageNumber(... | java | @Override
public void onCloseDocument(final PdfWriter writer, final Document document) {
template.beginText();
template.setFontAndSize(bf, 8);
template.showText(String.valueOf(writer.getPageNumber() - 1));
template.endText();
} | [
"@",
"Override",
"public",
"void",
"onCloseDocument",
"(",
"final",
"PdfWriter",
"writer",
",",
"final",
"Document",
"document",
")",
"{",
"template",
".",
"beginText",
"(",
")",
";",
"template",
".",
"setFontAndSize",
"(",
"bf",
",",
"8",
")",
";",
"templ... | we override the onCloseDocument method.
@param writer
PdfWriter
@param document
Document | [
"we",
"override",
"the",
"onCloseDocument",
"method",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/AdvancedPageNumberEvents.java#L134-L140 |
stapler/stapler | core/src/main/java/org/kohsuke/stapler/framework/io/LargeText.java | LargeText.writeLogTo | public long writeLogTo(long start, OutputStream out) throws IOException {
"""
Writes the tail portion of the file to the {@link OutputStream}.
@param start
The byte offset in the input file where the write operation starts.
@return
if the file is still being written, this method writes the file
until the ... | java | public long writeLogTo(long start, OutputStream out) throws IOException {
CountingOutputStream os = new CountingOutputStream(out);
Session f = source.open();
f.skip(start);
if(completed) {
// write everything till EOF
byte[] buf = new byte[1024];
int... | [
"public",
"long",
"writeLogTo",
"(",
"long",
"start",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"CountingOutputStream",
"os",
"=",
"new",
"CountingOutputStream",
"(",
"out",
")",
";",
"Session",
"f",
"=",
"source",
".",
"open",
"(",
")",... | Writes the tail portion of the file to the {@link OutputStream}.
@param start
The byte offset in the input file where the write operation starts.
@return
if the file is still being written, this method writes the file
until the last newline character and returns the offset to start
the next write operation.
@throws E... | [
"Writes",
"the",
"tail",
"portion",
"of",
"the",
"file",
"to",
"the",
"{",
"@link",
"OutputStream",
"}",
"."
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/core/src/main/java/org/kohsuke/stapler/framework/io/LargeText.java#L209-L238 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/ReflectionUtil.java | ReflectionUtil.matchesParameters | @Pure
public static boolean matchesParameters(Class<?>[] formalParameters, Object... parameterValues) {
"""
Replies if the formal parameters are matching the given values.
@param formalParameters the types of the formal parameters.
@param parameterValues the values associated to the paramters.
@return <code>... | java | @Pure
public static boolean matchesParameters(Class<?>[] formalParameters, Object... parameterValues) {
if (formalParameters == null) {
return parameterValues == null;
}
if (parameterValues != null && formalParameters.length == parameterValues.length) {
for (int i = 0; i < formalParameters.length; ++i) {
... | [
"@",
"Pure",
"public",
"static",
"boolean",
"matchesParameters",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"formalParameters",
",",
"Object",
"...",
"parameterValues",
")",
"{",
"if",
"(",
"formalParameters",
"==",
"null",
")",
"{",
"return",
"parameterValues",
... | Replies if the formal parameters are matching the given values.
@param formalParameters the types of the formal parameters.
@param parameterValues the values associated to the paramters.
@return <code>true</code> if the values could be passed to the method.
@since 7.1 | [
"Replies",
"if",
"the",
"formal",
"parameters",
"are",
"matching",
"the",
"given",
"values",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/ReflectionUtil.java#L804-L818 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java | KeyUtil.generateKey | public static SecretKey generateKey(String algorithm, byte[] key) {
"""
生成 {@link SecretKey},仅用于对称加密和摘要算法密钥生成
@param algorithm 算法
@param key 密钥,如果为{@code null} 自动生成随机密钥
@return {@link SecretKey}
"""
Assert.notBlank(algorithm, "Algorithm is blank!");
SecretKey secretKey = null;
if (algorithm.start... | java | public static SecretKey generateKey(String algorithm, byte[] key) {
Assert.notBlank(algorithm, "Algorithm is blank!");
SecretKey secretKey = null;
if (algorithm.startsWith("PBE")) {
// PBE密钥
secretKey = generatePBEKey(algorithm, (null == key) ? null : StrUtil.str(key, CharsetUtil.CHARSET_UTF_8).toCharA... | [
"public",
"static",
"SecretKey",
"generateKey",
"(",
"String",
"algorithm",
",",
"byte",
"[",
"]",
"key",
")",
"{",
"Assert",
".",
"notBlank",
"(",
"algorithm",
",",
"\"Algorithm is blank!\"",
")",
";",
"SecretKey",
"secretKey",
"=",
"null",
";",
"if",
"(",
... | 生成 {@link SecretKey},仅用于对称加密和摘要算法密钥生成
@param algorithm 算法
@param key 密钥,如果为{@code null} 自动生成随机密钥
@return {@link SecretKey} | [
"生成",
"{",
"@link",
"SecretKey",
"}",
",仅用于对称加密和摘要算法密钥生成"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L114-L128 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java | PvmExecutionImpl.executeActivities | public void executeActivities(List<PvmActivity> activityStack, PvmActivity targetActivity,
PvmTransition targetTransition, Map<String, Object> variables, Map<String, Object> localVariables,
boolean skipCustomListeners, boolean skipIoMappings) {
"""
In... | java | public void executeActivities(List<PvmActivity> activityStack, PvmActivity targetActivity,
PvmTransition targetTransition, Map<String, Object> variables, Map<String, Object> localVariables,
boolean skipCustomListeners, boolean skipIoMappings) {
this.... | [
"public",
"void",
"executeActivities",
"(",
"List",
"<",
"PvmActivity",
">",
"activityStack",
",",
"PvmActivity",
"targetActivity",
",",
"PvmTransition",
"targetTransition",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"variables",
",",
"Map",
"<",
"String",
"... | Instantiates the given activity stack. Uses this execution to execute the
highest activity in the stack.
Sets the variables for the execution responsible to execute the most deeply nested
activity.
@param activityStack The most deeply nested activity is the last element in the list | [
"Instantiates",
"the",
"given",
"activity",
"stack",
".",
"Uses",
"this",
"execution",
"to",
"execute",
"the",
"highest",
"activity",
"in",
"the",
"stack",
".",
"Sets",
"the",
"variables",
"for",
"the",
"execution",
"responsible",
"to",
"execute",
"the",
"most... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L885-L919 |
aws/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/SendAutomationSignalRequest.java | SendAutomationSignalRequest.withPayload | public SendAutomationSignalRequest withPayload(java.util.Map<String, java.util.List<String>> payload) {
"""
<p>
The data sent with the signal. The data schema depends on the type of signal used in the request.
</p>
@param payload
The data sent with the signal. The data schema depends on the type of signal us... | java | public SendAutomationSignalRequest withPayload(java.util.Map<String, java.util.List<String>> payload) {
setPayload(payload);
return this;
} | [
"public",
"SendAutomationSignalRequest",
"withPayload",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"payload",
")",
"{",
"setPayload",
"(",
"payload",
")",
";",
"return",
"this",
";... | <p>
The data sent with the signal. The data schema depends on the type of signal used in the request.
</p>
@param payload
The data sent with the signal. The data schema depends on the type of signal used in the request.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"data",
"sent",
"with",
"the",
"signal",
".",
"The",
"data",
"schema",
"depends",
"on",
"the",
"type",
"of",
"signal",
"used",
"in",
"the",
"request",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/SendAutomationSignalRequest.java#L181-L184 |
apereo/cas | support/cas-server-support-scim/src/main/java/org/apereo/cas/scim/v1/ScimV1PrincipalProvisioner.java | ScimV1PrincipalProvisioner.createUserResource | @SneakyThrows
protected boolean createUserResource(final Principal p, final Credential credential) {
"""
Create user resource boolean.
@param p the p
@param credential the credential
@return the boolean
"""
val user = new UserResource(CoreSchema.USER_DESCRIPTOR);
this.mapper.m... | java | @SneakyThrows
protected boolean createUserResource(final Principal p, final Credential credential) {
val user = new UserResource(CoreSchema.USER_DESCRIPTOR);
this.mapper.map(user, p, credential);
return endpoint.create(user) != null;
} | [
"@",
"SneakyThrows",
"protected",
"boolean",
"createUserResource",
"(",
"final",
"Principal",
"p",
",",
"final",
"Credential",
"credential",
")",
"{",
"val",
"user",
"=",
"new",
"UserResource",
"(",
"CoreSchema",
".",
"USER_DESCRIPTOR",
")",
";",
"this",
".",
... | Create user resource boolean.
@param p the p
@param credential the credential
@return the boolean | [
"Create",
"user",
"resource",
"boolean",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-scim/src/main/java/org/apereo/cas/scim/v1/ScimV1PrincipalProvisioner.java#L74-L79 |
Sciss/abc4j | abc/src/main/java/abc/ui/swing/JTune.java | JTune.getHighestNoteGlyphBetween | private JNoteElementAbstract getHighestNoteGlyphBetween(NoteAbstract start, NoteAbstract end, boolean excludeStartAndEnd) {
"""
Return the JNote that have the highest bounding box
@return a JNote. May return <code>null</code> if exclude is true and no notes between start and end!
"""
Collection jnotes = ... | java | private JNoteElementAbstract getHighestNoteGlyphBetween(NoteAbstract start, NoteAbstract end, boolean excludeStartAndEnd) {
Collection jnotes = getNoteGlyphesBetween(start, end);
JNoteElementAbstract ret = null;
boolean first = true;
for (Iterator it = jnotes.iterator(); it.hasNext();) {
JNoteElementAbs... | [
"private",
"JNoteElementAbstract",
"getHighestNoteGlyphBetween",
"(",
"NoteAbstract",
"start",
",",
"NoteAbstract",
"end",
",",
"boolean",
"excludeStartAndEnd",
")",
"{",
"Collection",
"jnotes",
"=",
"getNoteGlyphesBetween",
"(",
"start",
",",
"end",
")",
";",
"JNoteE... | Return the JNote that have the highest bounding box
@return a JNote. May return <code>null</code> if exclude is true and no notes between start and end! | [
"Return",
"the",
"JNote",
"that",
"have",
"the",
"highest",
"bounding",
"box"
] | train | https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/JTune.java#L1453-L1477 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Settings.java | Settings.setLimitEventAndDataUsage | public static void setLimitEventAndDataUsage(Context context, boolean limitEventUsage) {
"""
Sets whether data such as that generated through AppEventsLogger and sent to Facebook should be restricted from
being used for purposes other than analytics and conversions, such as for targeting ads to this user. Defaul... | java | public static void setLimitEventAndDataUsage(Context context, boolean limitEventUsage) {
SharedPreferences preferences = context.getSharedPreferences(APP_EVENT_PREFERENCES, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean("limitEventUsage", limitEven... | [
"public",
"static",
"void",
"setLimitEventAndDataUsage",
"(",
"Context",
"context",
",",
"boolean",
"limitEventUsage",
")",
"{",
"SharedPreferences",
"preferences",
"=",
"context",
".",
"getSharedPreferences",
"(",
"APP_EVENT_PREFERENCES",
",",
"Context",
".",
"MODE_PRI... | Sets whether data such as that generated through AppEventsLogger and sent to Facebook should be restricted from
being used for purposes other than analytics and conversions, such as for targeting ads to this user. Defaults
to false. This value is stored on the device and persists across app launches. Changes to this... | [
"Sets",
"whether",
"data",
"such",
"as",
"that",
"generated",
"through",
"AppEventsLogger",
"and",
"sent",
"to",
"Facebook",
"should",
"be",
"restricted",
"from",
"being",
"used",
"for",
"purposes",
"other",
"than",
"analytics",
"and",
"conversions",
"such",
"as... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Settings.java#L486-L491 |
aalmiray/Json-lib | src/main/java/net/sf/json/JsonConfig.java | JsonConfig.registerJsonValueProcessor | public void registerJsonValueProcessor( Class beanClass, Class propertyType, JsonValueProcessor jsonValueProcessor ) {
"""
Registers a JsonValueProcessor.<br>
[Java -> JSON]
@param beanClass the class to use as key
@param propertyType the property type to use as key
@param jsonValueProcessor the processor... | java | public void registerJsonValueProcessor( Class beanClass, Class propertyType, JsonValueProcessor jsonValueProcessor ) {
if( beanClass != null && propertyType != null && jsonValueProcessor != null ) {
beanTypeMap.put( beanClass, propertyType, jsonValueProcessor );
}
} | [
"public",
"void",
"registerJsonValueProcessor",
"(",
"Class",
"beanClass",
",",
"Class",
"propertyType",
",",
"JsonValueProcessor",
"jsonValueProcessor",
")",
"{",
"if",
"(",
"beanClass",
"!=",
"null",
"&&",
"propertyType",
"!=",
"null",
"&&",
"jsonValueProcessor",
... | Registers a JsonValueProcessor.<br>
[Java -> JSON]
@param beanClass the class to use as key
@param propertyType the property type to use as key
@param jsonValueProcessor the processor to register | [
"Registers",
"a",
"JsonValueProcessor",
".",
"<br",
">",
"[",
"Java",
"-",
">",
";",
"JSON",
"]"
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JsonConfig.java#L813-L817 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/AmountFormats.java | AmountFormats.iso8601 | public static String iso8601(Period period, Duration duration) {
"""
Formats a period and duration to a string in ISO-8601 format.
<p>
To obtain the ISO-8601 format of a {@code Period} or {@code Duration}
individually, simply call {@code toString()}.
See also {@link PeriodDuration}.
@param period the perio... | java | public static String iso8601(Period period, Duration duration) {
Objects.requireNonNull(period, "period must not be null");
Objects.requireNonNull(duration, "duration must not be null");
if (period.isZero()) {
return duration.toString();
}
if (duration.isZero()) {
... | [
"public",
"static",
"String",
"iso8601",
"(",
"Period",
"period",
",",
"Duration",
"duration",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"period",
",",
"\"period must not be null\"",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"duration",
",",
"\"dur... | Formats a period and duration to a string in ISO-8601 format.
<p>
To obtain the ISO-8601 format of a {@code Period} or {@code Duration}
individually, simply call {@code toString()}.
See also {@link PeriodDuration}.
@param period the period to format
@param duration the duration to format
@return the ISO-8601 format ... | [
"Formats",
"a",
"period",
"and",
"duration",
"to",
"a",
"string",
"in",
"ISO",
"-",
"8601",
"format",
".",
"<p",
">",
"To",
"obtain",
"the",
"ISO",
"-",
"8601",
"format",
"of",
"a",
"{",
"@code",
"Period",
"}",
"or",
"{",
"@code",
"Duration",
"}",
... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/AmountFormats.java#L149-L159 |
magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java | SessionIdFormat.createSessionId | @Nonnull
public String createSessionId(@Nonnull final String sessionId, @Nullable final String memcachedId) {
"""
Create a session id including the provided memcachedId.
@param sessionId
the original session id, it might contain the jvm route
@param memcachedId
the memcached id to encode in the session i... | java | @Nonnull
public String createSessionId(@Nonnull final String sessionId, @Nullable final String memcachedId) {
if ( LOG.isDebugEnabled() ) {
LOG.debug( "Creating new session id with orig id '" + sessionId + "' and memcached id '" + memcachedId + "'." );
}
if ( memcachedId == null ... | [
"@",
"Nonnull",
"public",
"String",
"createSessionId",
"(",
"@",
"Nonnull",
"final",
"String",
"sessionId",
",",
"@",
"Nullable",
"final",
"String",
"memcachedId",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
... | Create a session id including the provided memcachedId.
@param sessionId
the original session id, it might contain the jvm route
@param memcachedId
the memcached id to encode in the session id, may be <code>null</code>.
@return the sessionId which now contains the memcachedId if one was provided, otherwise
the session... | [
"Create",
"a",
"session",
"id",
"including",
"the",
"provided",
"memcachedId",
"."
] | train | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java#L71-L85 |
aol/cyclops | cyclops-pure/src/main/java/cyclops/instances/control/MaybeInstances.java | MaybeInstances.fromOptional | public static <T> Maybe<T> fromOptional(Higher<DataWitness.optional,T> optional) {
"""
Construct an equivalent Maybe from the Supplied Optional
<pre>
{@code
MaybeType<Integer> some = MaybeType.fromOptional(Optional.of(10));
//Maybe[10], Some[10]
MaybeType<Integer> none = MaybeType.fromOptional(Optional.zero... | java | public static <T> Maybe<T> fromOptional(Higher<DataWitness.optional,T> optional){
return Maybe.fromOptional(OptionalKind.narrowK(optional));
} | [
"public",
"static",
"<",
"T",
">",
"Maybe",
"<",
"T",
">",
"fromOptional",
"(",
"Higher",
"<",
"DataWitness",
".",
"optional",
",",
"T",
">",
"optional",
")",
"{",
"return",
"Maybe",
".",
"fromOptional",
"(",
"OptionalKind",
".",
"narrowK",
"(",
"optiona... | Construct an equivalent Maybe from the Supplied Optional
<pre>
{@code
MaybeType<Integer> some = MaybeType.fromOptional(Optional.of(10));
//Maybe[10], Some[10]
MaybeType<Integer> none = MaybeType.fromOptional(Optional.zero());
//Maybe.zero, None[]
}
</pre>
@param optional Optional to construct Maybe from
@return Maybe... | [
"Construct",
"an",
"equivalent",
"Maybe",
"from",
"the",
"Supplied",
"Optional",
"<pre",
">",
"{",
"@code",
"MaybeType<Integer",
">",
"some",
"=",
"MaybeType",
".",
"fromOptional",
"(",
"Optional",
".",
"of",
"(",
"10",
"))",
";",
"//",
"Maybe",
"[",
"10",... | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-pure/src/main/java/cyclops/instances/control/MaybeInstances.java#L88-L91 |
jenkinsci/jenkins | core/src/main/java/hudson/views/ListViewColumn.java | ListViewColumn.createDefaultInitialColumnList | public static List<ListViewColumn> createDefaultInitialColumnList(View view) {
"""
Creates the list of {@link ListViewColumn}s to be used for a {@link ListView}s and their likes.
@see View#getColumns()
@since 2.37
"""
return createDefaultInitialColumnList(DescriptorVisibilityFilter.apply(view, List... | java | public static List<ListViewColumn> createDefaultInitialColumnList(View view) {
return createDefaultInitialColumnList(DescriptorVisibilityFilter.apply(view, ListViewColumn.all()));
} | [
"public",
"static",
"List",
"<",
"ListViewColumn",
">",
"createDefaultInitialColumnList",
"(",
"View",
"view",
")",
"{",
"return",
"createDefaultInitialColumnList",
"(",
"DescriptorVisibilityFilter",
".",
"apply",
"(",
"view",
",",
"ListViewColumn",
".",
"all",
"(",
... | Creates the list of {@link ListViewColumn}s to be used for a {@link ListView}s and their likes.
@see View#getColumns()
@since 2.37 | [
"Creates",
"the",
"list",
"of",
"{",
"@link",
"ListViewColumn",
"}",
"s",
"to",
"be",
"used",
"for",
"a",
"{",
"@link",
"ListView",
"}",
"s",
"and",
"their",
"likes",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/views/ListViewColumn.java#L148-L150 |
gliga/ekstazi | org.ekstazi.core/src/main/java/org/ekstazi/agent/AgentLoader.java | AgentLoader.findToolsJar | private static File findToolsJar() {
"""
Finds tools.jar in JDK.
@return File for tools.jar, which may not be valid if tools.jar could
have not been located
"""
String javaHome = System.getProperty("java.home");
File javaHomeFile = new File(javaHome);
File toolsJarFile = new File(ja... | java | private static File findToolsJar() {
String javaHome = System.getProperty("java.home");
File javaHomeFile = new File(javaHome);
File toolsJarFile = new File(javaHomeFile, "lib" + File.separator + TOOLS_JAR_NAME);
if (!toolsJarFile.exists()) {
toolsJarFile = new File(System.g... | [
"private",
"static",
"File",
"findToolsJar",
"(",
")",
"{",
"String",
"javaHome",
"=",
"System",
".",
"getProperty",
"(",
"\"java.home\"",
")",
";",
"File",
"javaHomeFile",
"=",
"new",
"File",
"(",
"javaHome",
")",
";",
"File",
"toolsJarFile",
"=",
"new",
... | Finds tools.jar in JDK.
@return File for tools.jar, which may not be valid if tools.jar could
have not been located | [
"Finds",
"tools",
".",
"jar",
"in",
"JDK",
"."
] | train | https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/agent/AgentLoader.java#L209-L229 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java | SignatureUtils.getParameterSlotAndSignatures | public static Map<Integer, String> getParameterSlotAndSignatures(boolean methodIsStatic, String methodSignature) {
"""
returns a Map that represents the type of the parameter in slot x
@param methodIsStatic
if the method is static, causes where to start counting from, slot 0 or 1
@param methodSignature
the s... | java | public static Map<Integer, String> getParameterSlotAndSignatures(boolean methodIsStatic, String methodSignature) {
int start = methodSignature.indexOf('(') + 1;
int limit = methodSignature.lastIndexOf(')');
if ((limit - start) == 0) {
return Collections.emptyMap();
}
... | [
"public",
"static",
"Map",
"<",
"Integer",
",",
"String",
">",
"getParameterSlotAndSignatures",
"(",
"boolean",
"methodIsStatic",
",",
"String",
"methodSignature",
")",
"{",
"int",
"start",
"=",
"methodSignature",
".",
"indexOf",
"(",
"'",
"'",
")",
"+",
"1",
... | returns a Map that represents the type of the parameter in slot x
@param methodIsStatic
if the method is static, causes where to start counting from, slot 0 or 1
@param methodSignature
the signature of the method to parse
@return a map of parameter types (expect empty slots when doubles/longs are used | [
"returns",
"a",
"Map",
"that",
"represents",
"the",
"type",
"of",
"the",
"parameter",
"in",
"slot",
"x"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java#L179-L212 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.