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 |
|---|---|---|---|---|---|---|---|---|---|---|
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/search/SearchBuilderLegacy.java | SearchBuilderLegacy.fromJson | static SearchBuilder fromJson(String json) {
"""
Returns the {@link SearchBuilder} represented by the specified JSON {@code String}.
@param json the JSON {@code String} representing a {@link SearchBuilder}
@return the {@link SearchBuilder} represented by the specified JSON {@code String}
"""
try {
... | java | static SearchBuilder fromJson(String json) {
try {
return JsonSerializer.fromString(json, SearchBuilderLegacy.class).builder;
} catch (IOException e) {
throw new IndexException(e, "Unparseable JSON search: {}", json);
}
} | [
"static",
"SearchBuilder",
"fromJson",
"(",
"String",
"json",
")",
"{",
"try",
"{",
"return",
"JsonSerializer",
".",
"fromString",
"(",
"json",
",",
"SearchBuilderLegacy",
".",
"class",
")",
".",
"builder",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
... | Returns the {@link SearchBuilder} represented by the specified JSON {@code String}.
@param json the JSON {@code String} representing a {@link SearchBuilder}
@return the {@link SearchBuilder} represented by the specified JSON {@code String} | [
"Returns",
"the",
"{",
"@link",
"SearchBuilder",
"}",
"represented",
"by",
"the",
"specified",
"JSON",
"{",
"@code",
"String",
"}",
"."
] | train | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/search/SearchBuilderLegacy.java#L97-L103 |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/TDHttpClient.java | TDHttpClient.submitRequest | public <Result> Result submitRequest(TDApiRequest apiRequest, Optional<String> apiKeyCache, TDHttpRequestHandler<Result> handler)
throws TDClientException {
"""
A low-level method to submit a TD API request.
@param apiRequest
@param apiKeyCache
@param handler
@param <Result>
@return
@throws TDC... | java | public <Result> Result submitRequest(TDApiRequest apiRequest, Optional<String> apiKeyCache, TDHttpRequestHandler<Result> handler)
throws TDClientException
{
RequestContext requestContext = new RequestContext(config, apiRequest, apiKeyCache);
try {
return submitRequest(request... | [
"public",
"<",
"Result",
">",
"Result",
"submitRequest",
"(",
"TDApiRequest",
"apiRequest",
",",
"Optional",
"<",
"String",
">",
"apiKeyCache",
",",
"TDHttpRequestHandler",
"<",
"Result",
">",
"handler",
")",
"throws",
"TDClientException",
"{",
"RequestContext",
"... | A low-level method to submit a TD API request.
@param apiRequest
@param apiKeyCache
@param handler
@param <Result>
@return
@throws TDClientException | [
"A",
"low",
"-",
"level",
"method",
"to",
"submit",
"a",
"TD",
"API",
"request",
"."
] | train | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/TDHttpClient.java#L455-L472 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java | ClassUtil.getPublicMethod | public static Method getPublicMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) throws SecurityException {
"""
查找指定Public方法 如果找不到对应的方法或方法不为public的则返回<code>null</code>
@param clazz 类
@param methodName 方法名
@param paramTypes 参数类型
@return 方法
@throws SecurityException 无权访问抛出异常
"""
return R... | java | public static Method getPublicMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) throws SecurityException {
return ReflectUtil.getPublicMethod(clazz, methodName, paramTypes);
} | [
"public",
"static",
"Method",
"getPublicMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"...",
"paramTypes",
")",
"throws",
"SecurityException",
"{",
"return",
"ReflectUtil",
".",
"getPublicMethod",
"(",... | 查找指定Public方法 如果找不到对应的方法或方法不为public的则返回<code>null</code>
@param clazz 类
@param methodName 方法名
@param paramTypes 参数类型
@return 方法
@throws SecurityException 无权访问抛出异常 | [
"查找指定Public方法",
"如果找不到对应的方法或方法不为public的则返回<code",
">",
"null<",
"/",
"code",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L294-L296 |
HsiangLeekwok/hlklib | hlklib/src/main/java/com/hlk/hlklib/lib/datetimepicker/CustomViewPager.java | CustomViewPager.onMeasure | @Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
"""
Setting wrap_content on a ViewPager's layout_height in XML
doesn't seem to be recognized and the ViewPager will fill the
height of the screen regardless. We'll force the ViewPager to
have the same height as its immediate chil... | java | @Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int height = 0;
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
int h ... | [
"@",
"Override",
"public",
"void",
"onMeasure",
"(",
"int",
"widthMeasureSpec",
",",
"int",
"heightMeasureSpec",
")",
"{",
"int",
"height",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getChildCount",
"(",
")",
";",
"i",
"++",
")"... | Setting wrap_content on a ViewPager's layout_height in XML
doesn't seem to be recognized and the ViewPager will fill the
height of the screen regardless. We'll force the ViewPager to
have the same height as its immediate child.
<p>
Thanks to alexrainman for the bugfix! | [
"Setting",
"wrap_content",
"on",
"a",
"ViewPager",
"s",
"layout_height",
"in",
"XML",
"doesn",
"t",
"seem",
"to",
"be",
"recognized",
"and",
"the",
"ViewPager",
"will",
"fill",
"the",
"height",
"of",
"the",
"screen",
"regardless",
".",
"We",
"ll",
"force",
... | train | https://github.com/HsiangLeekwok/hlklib/blob/b122f6dcab7cec60c8e5455e0c31613d08bec6ad/hlklib/src/main/java/com/hlk/hlklib/lib/datetimepicker/CustomViewPager.java#L51-L69 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java | JobsInner.listByExperimentAsync | public Observable<Page<JobInner>> listByExperimentAsync(final String resourceGroupName, final String workspaceName, final String experimentName, final JobsListByExperimentOptions jobsListByExperimentOptions) {
"""
Gets a list of Jobs within the specified Experiment.
@param resourceGroupName Name of the resource... | java | public Observable<Page<JobInner>> listByExperimentAsync(final String resourceGroupName, final String workspaceName, final String experimentName, final JobsListByExperimentOptions jobsListByExperimentOptions) {
return listByExperimentWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName, jobs... | [
"public",
"Observable",
"<",
"Page",
"<",
"JobInner",
">",
">",
"listByExperimentAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"workspaceName",
",",
"final",
"String",
"experimentName",
",",
"final",
"JobsListByExperimentOptions",
"jobsL... | Gets a list of Jobs within the specified Experiment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from... | [
"Gets",
"a",
"list",
"of",
"Jobs",
"within",
"the",
"specified",
"Experiment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java#L303-L311 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java | ClassFinder.newCompletionFailure | private CompletionFailure newCompletionFailure(TypeSymbol c,
JCDiagnostic diag) {
"""
Static factory for CompletionFailure objects.
In practice, only one can be used at a time, so we share one
to reduce the expense of allocating new exception objects.
""... | java | private CompletionFailure newCompletionFailure(TypeSymbol c,
JCDiagnostic diag) {
if (!cacheCompletionFailure) {
// log.warning("proc.messager",
// Log.getLocalizedString("class.file.not.found", c.flatname));
... | [
"private",
"CompletionFailure",
"newCompletionFailure",
"(",
"TypeSymbol",
"c",
",",
"JCDiagnostic",
"diag",
")",
"{",
"if",
"(",
"!",
"cacheCompletionFailure",
")",
"{",
"// log.warning(\"proc.messager\",",
"// Log.getLocalizedString(\"class.file.not.found\", c.flatn... | Static factory for CompletionFailure objects.
In practice, only one can be used at a time, so we share one
to reduce the expense of allocating new exception objects. | [
"Static",
"factory",
"for",
"CompletionFailure",
"objects",
".",
"In",
"practice",
"only",
"one",
"can",
"be",
"used",
"at",
"a",
"time",
"so",
"we",
"share",
"one",
"to",
"reduce",
"the",
"expense",
"of",
"allocating",
"new",
"exception",
"objects",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java#L375-L388 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/RTreeIndexCoreExtension.java | RTreeIndexCoreExtension.dropAllTriggers | public void dropAllTriggers(String tableName, String geometryColumnName) {
"""
Drop Triggers that Maintain Spatial Index Values
@param tableName
table name
@param geometryColumnName
geometry column name
"""
dropInsertTrigger(tableName, geometryColumnName);
dropUpdate1Trigger(tableName, geometryColum... | java | public void dropAllTriggers(String tableName, String geometryColumnName) {
dropInsertTrigger(tableName, geometryColumnName);
dropUpdate1Trigger(tableName, geometryColumnName);
dropUpdate2Trigger(tableName, geometryColumnName);
dropUpdate3Trigger(tableName, geometryColumnName);
dropUpdate4Trigger(tableName, g... | [
"public",
"void",
"dropAllTriggers",
"(",
"String",
"tableName",
",",
"String",
"geometryColumnName",
")",
"{",
"dropInsertTrigger",
"(",
"tableName",
",",
"geometryColumnName",
")",
";",
"dropUpdate1Trigger",
"(",
"tableName",
",",
"geometryColumnName",
")",
";",
"... | Drop Triggers that Maintain Spatial Index Values
@param tableName
table name
@param geometryColumnName
geometry column name | [
"Drop",
"Triggers",
"that",
"Maintain",
"Spatial",
"Index",
"Values"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/RTreeIndexCoreExtension.java#L876-L885 |
camunda/camunda-xml-model | src/main/java/org/camunda/bpm/model/xml/impl/util/ModelUtil.java | ModelUtil.getIndexOfElementType | public static int getIndexOfElementType(ModelElementInstance modelElement, List<ModelElementType> childElementTypes) {
"""
Find the index of the type of a model element in a list of element types
@param modelElement the model element which type is searched for
@param childElementTypes the list to search the ty... | java | public static int getIndexOfElementType(ModelElementInstance modelElement, List<ModelElementType> childElementTypes) {
for (int index = 0; index < childElementTypes.size(); index++) {
ModelElementType childElementType = childElementTypes.get(index);
Class<? extends ModelElementInstance> instanceType = c... | [
"public",
"static",
"int",
"getIndexOfElementType",
"(",
"ModelElementInstance",
"modelElement",
",",
"List",
"<",
"ModelElementType",
">",
"childElementTypes",
")",
"{",
"for",
"(",
"int",
"index",
"=",
"0",
";",
"index",
"<",
"childElementTypes",
".",
"size",
... | Find the index of the type of a model element in a list of element types
@param modelElement the model element which type is searched for
@param childElementTypes the list to search the type
@return the index of the model element type in the list or -1 if it is not found | [
"Find",
"the",
"index",
"of",
"the",
"type",
"of",
"a",
"model",
"element",
"in",
"a",
"list",
"of",
"element",
"types"
] | train | https://github.com/camunda/camunda-xml-model/blob/85b3f879e26d063f71c94cfd21ac17d9ff6baf4d/src/main/java/org/camunda/bpm/model/xml/impl/util/ModelUtil.java#L191-L204 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/util/ScriptUtil.java | ScriptUtil.getScriptFromResource | public static ExecutableScript getScriptFromResource(String language, String resource, ExpressionManager expressionManager, ScriptFactory scriptFactory) {
"""
Creates a new {@link ExecutableScript} from a resource. It excepts static and dynamic resources.
Dynamic means that the resource is an expression which wil... | java | public static ExecutableScript getScriptFromResource(String language, String resource, ExpressionManager expressionManager, ScriptFactory scriptFactory) {
ensureNotEmpty(NotValidException.class, "Script language", language);
ensureNotEmpty(NotValidException.class, "Script resource", resource);
if (isDynamic... | [
"public",
"static",
"ExecutableScript",
"getScriptFromResource",
"(",
"String",
"language",
",",
"String",
"resource",
",",
"ExpressionManager",
"expressionManager",
",",
"ScriptFactory",
"scriptFactory",
")",
"{",
"ensureNotEmpty",
"(",
"NotValidException",
".",
"class",... | Creates a new {@link ExecutableScript} from a resource. It excepts static and dynamic resources.
Dynamic means that the resource is an expression which will be evaluated during execution.
@param language the language of the script
@param resource the resource path of the script code or an expression which evaluates to... | [
"Creates",
"a",
"new",
"{",
"@link",
"ExecutableScript",
"}",
"from",
"a",
"resource",
".",
"It",
"excepts",
"static",
"and",
"dynamic",
"resources",
".",
"Dynamic",
"means",
"that",
"the",
"resource",
"is",
"an",
"expression",
"which",
"will",
"be",
"evalua... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/ScriptUtil.java#L142-L152 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java | ComputeNodeOperations.listComputeNodes | public PagedList<ComputeNode> listComputeNodes(String poolId) throws BatchErrorException, IOException {
"""
Lists the {@link ComputeNode compute nodes} of the specified pool.
@param poolId The ID of the pool.
@return A list of {@link ComputeNode} objects.
@throws BatchErrorException Exception thrown when an e... | java | public PagedList<ComputeNode> listComputeNodes(String poolId) throws BatchErrorException, IOException {
return listComputeNodes(poolId, null, null);
} | [
"public",
"PagedList",
"<",
"ComputeNode",
">",
"listComputeNodes",
"(",
"String",
"poolId",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"return",
"listComputeNodes",
"(",
"poolId",
",",
"null",
",",
"null",
")",
";",
"}"
] | Lists the {@link ComputeNode compute nodes} of the specified pool.
@param poolId The ID of the pool.
@return A list of {@link ComputeNode} objects.
@throws BatchErrorException Exception thrown when an error response is received from the Batch service.
@throws IOException Exception thrown when there is an error in seri... | [
"Lists",
"the",
"{",
"@link",
"ComputeNode",
"compute",
"nodes",
"}",
"of",
"the",
"specified",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L506-L508 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.resumeAsync | public Observable<Page<SiteInner>> resumeAsync(final String resourceGroupName, final String name) {
"""
Resume an App Service Environment.
Resume an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@th... | java | public Observable<Page<SiteInner>> resumeAsync(final String resourceGroupName, final String name) {
return resumeWithServiceResponseAsync(resourceGroupName, name)
.map(new Func1<ServiceResponse<Page<SiteInner>>, Page<SiteInner>>() {
@Override
public Page<SiteInner> ca... | [
"public",
"Observable",
"<",
"Page",
"<",
"SiteInner",
">",
">",
"resumeAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"resumeWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
"m... | Resume an App Service Environment.
Resume an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<... | [
"Resume",
"an",
"App",
"Service",
"Environment",
".",
"Resume",
"an",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L3850-L3858 |
Gagravarr/VorbisJava | core/src/main/java/org/gagravarr/ogg/IOUtils.java | IOUtils.writeUTF8WithLength | public static void writeUTF8WithLength(OutputStream out, String str) throws IOException {
"""
Writes out a 4 byte integer of the length (in bytes!) of the
String, followed by the String (as UTF-8)
"""
byte[] s = str.getBytes(UTF8);
writeInt4(out, s.length);
out.write(s);
} | java | public static void writeUTF8WithLength(OutputStream out, String str) throws IOException {
byte[] s = str.getBytes(UTF8);
writeInt4(out, s.length);
out.write(s);
} | [
"public",
"static",
"void",
"writeUTF8WithLength",
"(",
"OutputStream",
"out",
",",
"String",
"str",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"s",
"=",
"str",
".",
"getBytes",
"(",
"UTF8",
")",
";",
"writeInt4",
"(",
"out",
",",
"s",
".",
"... | Writes out a 4 byte integer of the length (in bytes!) of the
String, followed by the String (as UTF-8) | [
"Writes",
"out",
"a",
"4",
"byte",
"integer",
"of",
"the",
"length",
"(",
"in",
"bytes!",
")",
"of",
"the",
"String",
"followed",
"by",
"the",
"String",
"(",
"as",
"UTF",
"-",
"8",
")"
] | train | https://github.com/Gagravarr/VorbisJava/blob/22b4d645b00386d59d17a336a2bc9d54db08df16/core/src/main/java/org/gagravarr/ogg/IOUtils.java#L370-L374 |
Netflix/ribbon | ribbon-archaius/src/main/java/com/netflix/client/config/DefaultClientConfigImpl.java | DefaultClientConfigImpl.loadProperties | @Override
public void loadProperties(String restClientName) {
"""
Load properties for a given client. It first loads the default values for all properties,
and any properties already defined with Archaius ConfigurationManager.
"""
enableDynamicProperties = true;
setClientName(restClientNam... | java | @Override
public void loadProperties(String restClientName){
enableDynamicProperties = true;
setClientName(restClientName);
loadDefaultValues();
Configuration props = ConfigurationManager.getConfigInstance().subset(restClientName);
for (Iterator<String> keys = props.getKeys()... | [
"@",
"Override",
"public",
"void",
"loadProperties",
"(",
"String",
"restClientName",
")",
"{",
"enableDynamicProperties",
"=",
"true",
";",
"setClientName",
"(",
"restClientName",
")",
";",
"loadDefaultValues",
"(",
")",
";",
"Configuration",
"props",
"=",
"Confi... | Load properties for a given client. It first loads the default values for all properties,
and any properties already defined with Archaius ConfigurationManager. | [
"Load",
"properties",
"for",
"a",
"given",
"client",
".",
"It",
"first",
"loads",
"the",
"default",
"values",
"for",
"all",
"properties",
"and",
"any",
"properties",
"already",
"defined",
"with",
"Archaius",
"ConfigurationManager",
"."
] | train | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-archaius/src/main/java/com/netflix/client/config/DefaultClientConfigImpl.java#L625-L643 |
lucee/Lucee | core/src/main/java/lucee/runtime/text/xml/XMLCaster.java | XMLCaster.writeTo | public static void writeTo(Node node, Resource file) throws PageException {
"""
write a xml Dom to a file
@param node
@param file
@throws PageException
"""
OutputStream os = null;
try {
os = IOUtil.toBufferedOutputStream(file.getOutputStream());
writeTo(node, new StreamResult(os), false, false... | java | public static void writeTo(Node node, Resource file) throws PageException {
OutputStream os = null;
try {
os = IOUtil.toBufferedOutputStream(file.getOutputStream());
writeTo(node, new StreamResult(os), false, false, null, null, null);
}
catch (IOException ioe) {
throw Caster.toPageException(ioe);
}
... | [
"public",
"static",
"void",
"writeTo",
"(",
"Node",
"node",
",",
"Resource",
"file",
")",
"throws",
"PageException",
"{",
"OutputStream",
"os",
"=",
"null",
";",
"try",
"{",
"os",
"=",
"IOUtil",
".",
"toBufferedOutputStream",
"(",
"file",
".",
"getOutputStre... | write a xml Dom to a file
@param node
@param file
@throws PageException | [
"write",
"a",
"xml",
"Dom",
"to",
"a",
"file"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/text/xml/XMLCaster.java#L518-L530 |
Crab2died/Excel4J | src/main/java/com/github/crab2died/ExcelUtils.java | ExcelUtils.exportObjects2Excel | public void exportObjects2Excel(String templatePath, List<?> data, Class clazz, String targetPath)
throws Excel4JException {
"""
基于Excel模板与注解{@link com.github.crab2died.annotation.ExcelField}导出Excel
@param templatePath Excel模板路径
@param data 待导出数据的集合
@param clazz 映射对象Class
@param ta... | java | public void exportObjects2Excel(String templatePath, List<?> data, Class clazz, String targetPath)
throws Excel4JException {
exportObjects2Excel(templatePath, 0, data, null, clazz, true, targetPath);
} | [
"public",
"void",
"exportObjects2Excel",
"(",
"String",
"templatePath",
",",
"List",
"<",
"?",
">",
"data",
",",
"Class",
"clazz",
",",
"String",
"targetPath",
")",
"throws",
"Excel4JException",
"{",
"exportObjects2Excel",
"(",
"templatePath",
",",
"0",
",",
"... | 基于Excel模板与注解{@link com.github.crab2died.annotation.ExcelField}导出Excel
@param templatePath Excel模板路径
@param data 待导出数据的集合
@param clazz 映射对象Class
@param targetPath 生成的Excel输出全路径
@throws Excel4JException 异常
@author Crab2Died | [
"基于Excel模板与注解",
"{",
"@link",
"com",
".",
"github",
".",
"crab2died",
".",
"annotation",
".",
"ExcelField",
"}",
"导出Excel"
] | train | https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L590-L594 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java | CoverageDataCore.getValue | public Double getValue(GriddedTile griddedTile, int unsignedPixelValue) {
"""
Get the coverage data value for the unsigned short pixel value
@param griddedTile
gridded tile
@param unsignedPixelValue
pixel value as an unsigned 16 bit integer
@return coverage data value
"""
Double value = null;
if (!... | java | public Double getValue(GriddedTile griddedTile, int unsignedPixelValue) {
Double value = null;
if (!isDataNull(unsignedPixelValue)) {
value = pixelValueToValue(griddedTile, new Double(
unsignedPixelValue));
}
return value;
} | [
"public",
"Double",
"getValue",
"(",
"GriddedTile",
"griddedTile",
",",
"int",
"unsignedPixelValue",
")",
"{",
"Double",
"value",
"=",
"null",
";",
"if",
"(",
"!",
"isDataNull",
"(",
"unsignedPixelValue",
")",
")",
"{",
"value",
"=",
"pixelValueToValue",
"(",
... | Get the coverage data value for the unsigned short pixel value
@param griddedTile
gridded tile
@param unsignedPixelValue
pixel value as an unsigned 16 bit integer
@return coverage data value | [
"Get",
"the",
"coverage",
"data",
"value",
"for",
"the",
"unsigned",
"short",
"pixel",
"value"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java#L1432-L1441 |
eclipse/xtext-core | org.eclipse.xtext.util/src/org/eclipse/xtext/util/OnChangeEvictingCache.java | OnChangeEvictingCache.execWithTemporaryCaching | public <Result, Param extends Resource> Result execWithTemporaryCaching(Param resource, IUnitOfWork<Result, Param> transaction) throws WrappedException {
"""
The transaction will be executed with caching enabled. However, all newly cached values will be discarded as soon
as the transaction is over.
@since 2.1
... | java | public <Result, Param extends Resource> Result execWithTemporaryCaching(Param resource, IUnitOfWork<Result, Param> transaction) throws WrappedException {
CacheAdapter cacheAdapter = getOrCreate(resource);
IgnoreValuesMemento memento = cacheAdapter.ignoreNewValues();
try {
return transaction.exec(resource);
}... | [
"public",
"<",
"Result",
",",
"Param",
"extends",
"Resource",
">",
"Result",
"execWithTemporaryCaching",
"(",
"Param",
"resource",
",",
"IUnitOfWork",
"<",
"Result",
",",
"Param",
">",
"transaction",
")",
"throws",
"WrappedException",
"{",
"CacheAdapter",
"cacheAd... | The transaction will be executed with caching enabled. However, all newly cached values will be discarded as soon
as the transaction is over.
@since 2.1 | [
"The",
"transaction",
"will",
"be",
"executed",
"with",
"caching",
"enabled",
".",
"However",
"all",
"newly",
"cached",
"values",
"will",
"be",
"discarded",
"as",
"soon",
"as",
"the",
"transaction",
"is",
"over",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.util/src/org/eclipse/xtext/util/OnChangeEvictingCache.java#L143-L153 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/range/YearMonthRangeRandomizer.java | YearMonthRangeRandomizer.aNewYearMonthRangeRandomizer | public static YearMonthRangeRandomizer aNewYearMonthRangeRandomizer(final YearMonth min, final YearMonth max, final long seed) {
"""
Create a new {@link YearMonthRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link YearMonthRangeRandomizer}.
"""
... | java | public static YearMonthRangeRandomizer aNewYearMonthRangeRandomizer(final YearMonth min, final YearMonth max, final long seed) {
return new YearMonthRangeRandomizer(min, max, seed);
} | [
"public",
"static",
"YearMonthRangeRandomizer",
"aNewYearMonthRangeRandomizer",
"(",
"final",
"YearMonth",
"min",
",",
"final",
"YearMonth",
"max",
",",
"final",
"long",
"seed",
")",
"{",
"return",
"new",
"YearMonthRangeRandomizer",
"(",
"min",
",",
"max",
",",
"s... | Create a new {@link YearMonthRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link YearMonthRangeRandomizer}. | [
"Create",
"a",
"new",
"{",
"@link",
"YearMonthRangeRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/range/YearMonthRangeRandomizer.java#L77-L79 |
jenkinsci/jenkins | core/src/main/java/hudson/diagnosis/OldDataMonitor.java | OldDataMonitor.report | public static void report(Saveable obj, String version) {
"""
Inform monitor that some data in a deprecated format has been loaded,
and converted in-memory to a new structure.
@param obj Saveable object; calling save() on this object will persist
the data in its new format to disk.
@param version Hudson releas... | java | public static void report(Saveable obj, String version) {
OldDataMonitor odm = get(Jenkins.getInstance());
try {
SaveableReference ref = referTo(obj);
while (true) {
VersionRange vr = odm.data.get(ref);
if (vr != null && odm.data.replace(ref, vr, n... | [
"public",
"static",
"void",
"report",
"(",
"Saveable",
"obj",
",",
"String",
"version",
")",
"{",
"OldDataMonitor",
"odm",
"=",
"get",
"(",
"Jenkins",
".",
"getInstance",
"(",
")",
")",
";",
"try",
"{",
"SaveableReference",
"ref",
"=",
"referTo",
"(",
"o... | Inform monitor that some data in a deprecated format has been loaded,
and converted in-memory to a new structure.
@param obj Saveable object; calling save() on this object will persist
the data in its new format to disk.
@param version Hudson release when the data structure changed. | [
"Inform",
"monitor",
"that",
"some",
"data",
"in",
"a",
"deprecated",
"format",
"has",
"been",
"loaded",
"and",
"converted",
"in",
"-",
"memory",
"to",
"a",
"new",
"structure",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/diagnosis/OldDataMonitor.java#L168-L183 |
jayantk/jklol | src/com/jayantkrish/jklol/util/PairCountAccumulator.java | PairCountAccumulator.incrementOutcome | public void incrementOutcome(A first, B second, double amount) {
"""
Increments the count of outcome (first, second) by {@code amount}.
"""
if (!counts.containsKey(first)) {
counts.put(first, Maps.<B, Double> newHashMap());
}
if (!counts.get(first).containsKey(second)) {
counts.get(firs... | java | public void incrementOutcome(A first, B second, double amount) {
if (!counts.containsKey(first)) {
counts.put(first, Maps.<B, Double> newHashMap());
}
if (!counts.get(first).containsKey(second)) {
counts.get(first).put(second, 0.0);
}
counts.get(first).put(second, amount + counts.get(fir... | [
"public",
"void",
"incrementOutcome",
"(",
"A",
"first",
",",
"B",
"second",
",",
"double",
"amount",
")",
"{",
"if",
"(",
"!",
"counts",
".",
"containsKey",
"(",
"first",
")",
")",
"{",
"counts",
".",
"put",
"(",
"first",
",",
"Maps",
".",
"<",
"B... | Increments the count of outcome (first, second) by {@code amount}. | [
"Increments",
"the",
"count",
"of",
"outcome",
"(",
"first",
"second",
")",
"by",
"{"
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/PairCountAccumulator.java#L49-L59 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.openTagHtmlContent | public static String openTagHtmlContent(String tag, String clazz, String style, String... content) {
"""
Build a String containing a HTML opening tag with given CSS class and/or
style and concatenates the given HTML content.
@param tag String name of HTML tag
@param clazz CSS class of the tag
@param style st... | java | public static String openTagHtmlContent(String tag, String clazz, String style, String... content) {
return openTag(tag, clazz, style, true, content);
} | [
"public",
"static",
"String",
"openTagHtmlContent",
"(",
"String",
"tag",
",",
"String",
"clazz",
",",
"String",
"style",
",",
"String",
"...",
"content",
")",
"{",
"return",
"openTag",
"(",
"tag",
",",
"clazz",
",",
"style",
",",
"true",
",",
"content",
... | Build a String containing a HTML opening tag with given CSS class and/or
style and concatenates the given HTML content.
@param tag String name of HTML tag
@param clazz CSS class of the tag
@param style style for tag (plain CSS)
@param content content string
@return HTML tag element as string | [
"Build",
"a",
"String",
"containing",
"a",
"HTML",
"opening",
"tag",
"with",
"given",
"CSS",
"class",
"and",
"/",
"or",
"style",
"and",
"concatenates",
"the",
"given",
"HTML",
"content",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L404-L406 |
google/closure-compiler | src/com/google/javascript/jscomp/parsing/JsDocInfoParser.java | JsDocInfoParser.extractBlockComment | private ExtractionInfo extractBlockComment(JsDocToken token) {
"""
Extracts the top-level block comment from the JsDoc comment, if any.
This method differs from the extractMultilineTextualBlock in that it
terminates under different conditions (it doesn't have the same
prechecks), it does not first read in the r... | java | private ExtractionInfo extractBlockComment(JsDocToken token) {
return extractMultilineComment(token, getWhitespaceOption(WhitespaceOption.TRIM), false, false);
} | [
"private",
"ExtractionInfo",
"extractBlockComment",
"(",
"JsDocToken",
"token",
")",
"{",
"return",
"extractMultilineComment",
"(",
"token",
",",
"getWhitespaceOption",
"(",
"WhitespaceOption",
".",
"TRIM",
")",
",",
"false",
",",
"false",
")",
";",
"}"
] | Extracts the top-level block comment from the JsDoc comment, if any.
This method differs from the extractMultilineTextualBlock in that it
terminates under different conditions (it doesn't have the same
prechecks), it does not first read in the remaining of the current
line and its conditions for ignoring the "*" (STAR)... | [
"Extracts",
"the",
"top",
"-",
"level",
"block",
"comment",
"from",
"the",
"JsDoc",
"comment",
"if",
"any",
".",
"This",
"method",
"differs",
"from",
"the",
"extractMultilineTextualBlock",
"in",
"that",
"it",
"terminates",
"under",
"different",
"conditions",
"("... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/JsDocInfoParser.java#L1753-L1755 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitUnknownInlineTag | @Override
public R visitUnknownInlineTag(UnknownInlineTagTree 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 visitUnknownInlineTag(UnknownInlineTagTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitUnknownInlineTag",
"(",
"UnknownInlineTagTree",
"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#L441-L444 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/ModelControllerLock.java | ModelControllerLock.lockInterruptibly | boolean lockInterruptibly(final Integer permit, final long timeout, final TimeUnit unit) throws InterruptedException {
"""
Acquire the exclusive lock, with a max wait timeout to acquire.
@param permit - the permit Integer for this operation. May not be {@code null}.
@param timeout - the timeout scalar quantity.
... | java | boolean lockInterruptibly(final Integer permit, final long timeout, final TimeUnit unit) throws InterruptedException {
if (permit == null) {
throw new IllegalArgumentException();
}
return sync.tryAcquireNanos(permit, unit.toNanos(timeout));
} | [
"boolean",
"lockInterruptibly",
"(",
"final",
"Integer",
"permit",
",",
"final",
"long",
"timeout",
",",
"final",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"permit",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentExcepti... | Acquire the exclusive lock, with a max wait timeout to acquire.
@param permit - the permit Integer for this operation. May not be {@code null}.
@param timeout - the timeout scalar quantity.
@param unit - see {@code TimeUnit} for quantities.
@return {@code boolean} true on successful acquire.
@throws InterruptedExceptio... | [
"Acquire",
"the",
"exclusive",
"lock",
"with",
"a",
"max",
"wait",
"timeout",
"to",
"acquire",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/ModelControllerLock.java#L135-L140 |
riversun/bigdoc | src/main/java/org/riversun/bigdoc/bin/BigFileSearcher.java | BigFileSearcher.searchBigFile | public List<Long> searchBigFile(File f, byte[] searchBytes) {
"""
Search bytes from big file faster in a concurrent processing with
progress callback
@param f
target file
@param searchBytes
sequence of bytes you want to search
@return
"""
return searchBigFile(f, searchBytes, null);
} | java | public List<Long> searchBigFile(File f, byte[] searchBytes) {
return searchBigFile(f, searchBytes, null);
} | [
"public",
"List",
"<",
"Long",
">",
"searchBigFile",
"(",
"File",
"f",
",",
"byte",
"[",
"]",
"searchBytes",
")",
"{",
"return",
"searchBigFile",
"(",
"f",
",",
"searchBytes",
",",
"null",
")",
";",
"}"
] | Search bytes from big file faster in a concurrent processing with
progress callback
@param f
target file
@param searchBytes
sequence of bytes you want to search
@return | [
"Search",
"bytes",
"from",
"big",
"file",
"faster",
"in",
"a",
"concurrent",
"processing",
"with",
"progress",
"callback"
] | train | https://github.com/riversun/bigdoc/blob/46bd7c9a8667be23acdb1ad8286027e4b08cff3a/src/main/java/org/riversun/bigdoc/bin/BigFileSearcher.java#L271-L273 |
btc-ag/redg | redg-generator/src/main/java/com/btc/redg/generator/extractor/DatabaseManager.java | DatabaseManager.crawlDatabase | public static Catalog crawlDatabase(final Connection connection, final InclusionRule schemaRule, final InclusionRule tableRule) throws SchemaCrawlerException {
"""
Starts the schema crawler and lets it crawl the given JDBC connection.
@param connection The JDBC connection
@param schemaRule The {@link Inclusion... | java | public static Catalog crawlDatabase(final Connection connection, final InclusionRule schemaRule, final InclusionRule tableRule) throws SchemaCrawlerException {
final SchemaCrawlerOptions options = SchemaCrawlerOptionsBuilder.builder()
.withSchemaInfoLevel(SchemaInfoLevelBuilder.standard().setR... | [
"public",
"static",
"Catalog",
"crawlDatabase",
"(",
"final",
"Connection",
"connection",
",",
"final",
"InclusionRule",
"schemaRule",
",",
"final",
"InclusionRule",
"tableRule",
")",
"throws",
"SchemaCrawlerException",
"{",
"final",
"SchemaCrawlerOptions",
"options",
"... | Starts the schema crawler and lets it crawl the given JDBC connection.
@param connection The JDBC connection
@param schemaRule The {@link InclusionRule} to be passed to SchemaCrawler that specifies which schemas should be analyzed
@param tableRule The {@link InclusionRule} to be passed to SchemaCrawler that specifies... | [
"Starts",
"the",
"schema",
"crawler",
"and",
"lets",
"it",
"crawl",
"the",
"given",
"JDBC",
"connection",
"."
] | train | https://github.com/btc-ag/redg/blob/416a68639d002512cabfebff09afd2e1909e27df/redg-generator/src/main/java/com/btc/redg/generator/extractor/DatabaseManager.java#L146-L160 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java | CommerceNotificationQueueEntryPersistenceImpl.findByGroupId | @Override
public List<CommerceNotificationQueueEntry> findByGroupId(long groupId,
int start, int end) {
"""
Returns a range of all the commerce notification queue entries where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> an... | java | @Override
public List<CommerceNotificationQueueEntry> findByGroupId(long groupId,
int start, int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationQueueEntry",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
... | Returns a range of all the commerce notification queue entries where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first r... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"notification",
"queue",
"entries",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java#L145-L149 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java | HttpBuilder.patchAsync | public <T> CompletableFuture<T> patchAsync(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) {
"""
Executes asynchronous PATCH request on the configured URI (alias for the `patch(Class, Closure)` method), with additional configuration provided by
the configuration closure. The result will... | java | public <T> CompletableFuture<T> patchAsync(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) {
return CompletableFuture.supplyAsync(() -> patch(type, closure), getExecutor());
} | [
"public",
"<",
"T",
">",
"CompletableFuture",
"<",
"T",
">",
"patchAsync",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"@",
"DelegatesTo",
"(",
"HttpConfig",
".",
"class",
")",
"final",
"Closure",
"closure",
")",
"{",
"return",
"CompletableFuture",
... | Executes asynchronous PATCH request on the configured URI (alias for the `patch(Class, Closure)` method), with additional configuration provided by
the configuration closure. The result will be cast to the specified `type`.
[source,groovy]
----
def http = HttpBuilder.configure {
request.uri = 'http://localhost:10101'
... | [
"Executes",
"asynchronous",
"PATCH",
"request",
"on",
"the",
"configured",
"URI",
"(",
"alias",
"for",
"the",
"patch",
"(",
"Class",
"Closure",
")",
"method",
")",
"with",
"additional",
"configuration",
"provided",
"by",
"the",
"configuration",
"closure",
".",
... | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L1716-L1718 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.saferL2Normalize | public static <E, C extends Counter<E>> C saferL2Normalize(C c) {
"""
L2 normalize a counter, using the "safer" L2 normalizer.
@param c
The {@link Counter} to be L2 normalized. This counter is not
modified.
@return A new l2-normalized Counter based on c.
"""
return scale(c, 1.0 / saferL2Norm(c));
... | java | public static <E, C extends Counter<E>> C saferL2Normalize(C c) {
return scale(c, 1.0 / saferL2Norm(c));
} | [
"public",
"static",
"<",
"E",
",",
"C",
"extends",
"Counter",
"<",
"E",
">",
">",
"C",
"saferL2Normalize",
"(",
"C",
"c",
")",
"{",
"return",
"scale",
"(",
"c",
",",
"1.0",
"/",
"saferL2Norm",
"(",
"c",
")",
")",
";",
"}"
] | L2 normalize a counter, using the "safer" L2 normalizer.
@param c
The {@link Counter} to be L2 normalized. This counter is not
modified.
@return A new l2-normalized Counter based on c. | [
"L2",
"normalize",
"a",
"counter",
"using",
"the",
"safer",
"L2",
"normalizer",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1348-L1350 |
diffplug/durian | src/com/diffplug/common/base/TreeComparison.java | TreeComparison.isEqualBasedOn | public boolean isEqualBasedOn(BiPredicate<? super E, ? super A> compareFunc) {
"""
Returns true if the two trees are equal, based on the given {@link BiPredicate}.
"""
return equals(expectedDef, expectedRoot, actualDef, actualRoot, compareFunc);
} | java | public boolean isEqualBasedOn(BiPredicate<? super E, ? super A> compareFunc) {
return equals(expectedDef, expectedRoot, actualDef, actualRoot, compareFunc);
} | [
"public",
"boolean",
"isEqualBasedOn",
"(",
"BiPredicate",
"<",
"?",
"super",
"E",
",",
"?",
"super",
"A",
">",
"compareFunc",
")",
"{",
"return",
"equals",
"(",
"expectedDef",
",",
"expectedRoot",
",",
"actualDef",
",",
"actualRoot",
",",
"compareFunc",
")"... | Returns true if the two trees are equal, based on the given {@link BiPredicate}. | [
"Returns",
"true",
"if",
"the",
"two",
"trees",
"are",
"equal",
"based",
"on",
"the",
"given",
"{"
] | train | https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/TreeComparison.java#L52-L54 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SubsystemSuspensionLevels.java | SubsystemSuspensionLevels.setLevels | public void setLevels(Map<Integer, Long> levels) {
"""
Sets the suspension time in milliseconds for the corresponding infraction count.
@param levels The map of infraction counts to suspension times.
"""
SystemAssert.requireArgument(levels != null, "Levels cannot be null");
this.levels.cle... | java | public void setLevels(Map<Integer, Long> levels) {
SystemAssert.requireArgument(levels != null, "Levels cannot be null");
this.levels.clear();
this.levels.putAll(levels);
} | [
"public",
"void",
"setLevels",
"(",
"Map",
"<",
"Integer",
",",
"Long",
">",
"levels",
")",
"{",
"SystemAssert",
".",
"requireArgument",
"(",
"levels",
"!=",
"null",
",",
"\"Levels cannot be null\"",
")",
";",
"this",
".",
"levels",
".",
"clear",
"(",
")",... | Sets the suspension time in milliseconds for the corresponding infraction count.
@param levels The map of infraction counts to suspension times. | [
"Sets",
"the",
"suspension",
"time",
"in",
"milliseconds",
"for",
"the",
"corresponding",
"infraction",
"count",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SubsystemSuspensionLevels.java#L195-L199 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java | GeneratedDConnectionDaoImpl.queryByExpireTime | public Iterable<DConnection> queryByExpireTime(java.util.Date expireTime) {
"""
query-by method for field expireTime
@param expireTime the specified attribute
@return an Iterable of DConnections for the specified expireTime
"""
return queryByField(null, DConnectionMapper.Field.EXPIRETIME.getFieldName(), ... | java | public Iterable<DConnection> queryByExpireTime(java.util.Date expireTime) {
return queryByField(null, DConnectionMapper.Field.EXPIRETIME.getFieldName(), expireTime);
} | [
"public",
"Iterable",
"<",
"DConnection",
">",
"queryByExpireTime",
"(",
"java",
".",
"util",
".",
"Date",
"expireTime",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DConnectionMapper",
".",
"Field",
".",
"EXPIRETIME",
".",
"getFieldName",
"(",
")",
... | query-by method for field expireTime
@param expireTime the specified attribute
@return an Iterable of DConnections for the specified expireTime | [
"query",
"-",
"by",
"method",
"for",
"field",
"expireTime"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java#L88-L90 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/AbstractExtensionDependency.java | AbstractExtensionDependency.setProperties | public void setProperties(Map<String, Object> properties) {
"""
Replace existing properties with provided properties.
@param properties the properties
"""
this.properties.clear();
this.properties.putAll(properties);
} | java | public void setProperties(Map<String, Object> properties)
{
this.properties.clear();
this.properties.putAll(properties);
} | [
"public",
"void",
"setProperties",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"this",
".",
"properties",
".",
"clear",
"(",
")",
";",
"this",
".",
"properties",
".",
"putAll",
"(",
"properties",
")",
";",
"}"
] | Replace existing properties with provided properties.
@param properties the properties | [
"Replace",
"existing",
"properties",
"with",
"provided",
"properties",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/AbstractExtensionDependency.java#L258-L262 |
dihedron/dihedron-commons | src/main/java/org/dihedron/patterns/visitor/VisitorHelper.java | VisitorHelper.getName | public static String getName(String name, String path) {
"""
Returns the OGNL name of the node.
@param name
the name of the property.
@param path
the object graph navigation path so far.
@return
the OGNL name of the node.
"""
logger.trace("getting OGNL name for node '{}' at path '{}'", name, path);
... | java | public static String getName(String name, String path) {
logger.trace("getting OGNL name for node '{}' at path '{}'", name, path);
StringBuilder buffer = new StringBuilder();
if(path != null) {
buffer.append(path);
}
if(buffer.length() != 0 && name != null && !name.startsWith("[")) {
buffer.append(".");... | [
"public",
"static",
"String",
"getName",
"(",
"String",
"name",
",",
"String",
"path",
")",
"{",
"logger",
".",
"trace",
"(",
"\"getting OGNL name for node '{}' at path '{}'\"",
",",
"name",
",",
"path",
")",
";",
"StringBuilder",
"buffer",
"=",
"new",
"StringBu... | Returns the OGNL name of the node.
@param name
the name of the property.
@param path
the object graph navigation path so far.
@return
the OGNL name of the node. | [
"Returns",
"the",
"OGNL",
"name",
"of",
"the",
"node",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/patterns/visitor/VisitorHelper.java#L38-L50 |
rundeck/rundeck | rundeck-storage/rundeck-storage-filesys/src/main/java/org/rundeck/storage/data/file/LockingTree.java | LockingTree.synchStream | protected HasInputStream synchStream(final Path path, final HasInputStream stream) {
"""
Return a {@link HasInputStream} where all read access to the underlying data is synchronized around the path
@param path path
@param stream stream
@return synchronized stream access
"""
return new HasInputSt... | java | protected HasInputStream synchStream(final Path path, final HasInputStream stream) {
return new HasInputStream() {
@Override
public InputStream getInputStream() throws IOException {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
writeContent(by... | [
"protected",
"HasInputStream",
"synchStream",
"(",
"final",
"Path",
"path",
",",
"final",
"HasInputStream",
"stream",
")",
"{",
"return",
"new",
"HasInputStream",
"(",
")",
"{",
"@",
"Override",
"public",
"InputStream",
"getInputStream",
"(",
")",
"throws",
"IOE... | Return a {@link HasInputStream} where all read access to the underlying data is synchronized around the path
@param path path
@param stream stream
@return synchronized stream access | [
"Return",
"a",
"{",
"@link",
"HasInputStream",
"}",
"where",
"all",
"read",
"access",
"to",
"the",
"underlying",
"data",
"is",
"synchronized",
"around",
"the",
"path"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/rundeck-storage/rundeck-storage-filesys/src/main/java/org/rundeck/storage/data/file/LockingTree.java#L61-L78 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/host_device.java | host_device.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
host_device_responses result = (host_device_responses) service.get_payl... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
host_device_responses result = (host_device_responses) service.get_payload_formatter().string_to_resource(host_device_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode =... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"host_device_responses",
"result",
"=",
"(",
"host_device_responses",
")",
"service",
".",
"get_payload_format... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/host_device.java#L333-L350 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/replication/ConfigBasedDatasetsFinder.java | ConfigBasedDatasetsFinder.getValidDatasetURIs | protected Set<URI> getValidDatasetURIs(Path datasetCommonRoot) {
"""
Semantic of black/whitelist:
- Whitelist always respect blacklist.
- Job-level blacklist is reponsible for dataset filtering instead of dataset discovery. i.e.
There's no implementation of job-level whitelist currently.
"""
Collection<... | java | protected Set<URI> getValidDatasetURIs(Path datasetCommonRoot) {
Collection<URI> allDatasetURIs;
Set<URI> disabledURISet = new HashSet();
// This try block basically populate the Valid dataset URI set.
try {
allDatasetURIs = configClient.getImportedBy(new URI(whitelistTag.toString()), true);
... | [
"protected",
"Set",
"<",
"URI",
">",
"getValidDatasetURIs",
"(",
"Path",
"datasetCommonRoot",
")",
"{",
"Collection",
"<",
"URI",
">",
"allDatasetURIs",
";",
"Set",
"<",
"URI",
">",
"disabledURISet",
"=",
"new",
"HashSet",
"(",
")",
";",
"// This try block bas... | Semantic of black/whitelist:
- Whitelist always respect blacklist.
- Job-level blacklist is reponsible for dataset filtering instead of dataset discovery. i.e.
There's no implementation of job-level whitelist currently. | [
"Semantic",
"of",
"black",
"/",
"whitelist",
":",
"-",
"Whitelist",
"always",
"respect",
"blacklist",
".",
"-",
"Job",
"-",
"level",
"blacklist",
"is",
"reponsible",
"for",
"dataset",
"filtering",
"instead",
"of",
"dataset",
"discovery",
".",
"i",
".",
"e",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/replication/ConfigBasedDatasetsFinder.java#L168-L182 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java | DomHelper.applyElementSize | private void applyElementSize(Element element, int width, int height, boolean addCoordSize) {
"""
Apply a size on an element.
@param element
The element that needs sizing.
@param width
The new width to apply on the element.
@param height
The new height to apply on the element.
@param addCoordSize
Should ... | java | private void applyElementSize(Element element, int width, int height, boolean addCoordSize) {
if (width >= 0 && height >= 0) {
if (addCoordSize) {
Dom.setElementAttribute(element, "coordsize", width + " " + height);
}
Dom.setStyleAttribute(element, "width", width + "px");
Dom.setStyleAttribute(element... | [
"private",
"void",
"applyElementSize",
"(",
"Element",
"element",
",",
"int",
"width",
",",
"int",
"height",
",",
"boolean",
"addCoordSize",
")",
"{",
"if",
"(",
"width",
">=",
"0",
"&&",
"height",
">=",
"0",
")",
"{",
"if",
"(",
"addCoordSize",
")",
"... | Apply a size on an element.
@param element
The element that needs sizing.
@param width
The new width to apply on the element.
@param height
The new height to apply on the element.
@param addCoordSize
Should a coordsize attribute be added as well? | [
"Apply",
"a",
"size",
"on",
"an",
"element",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java#L510-L518 |
WiQuery/wiquery | wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java | Tabs.setAjaxLoadEvent | public Tabs setAjaxLoadEvent(ITabsAjaxEvent loadEvent) {
"""
Sets the call-back for the AJAX Load event.
@param loadEvent
The ITabsAjaxEvent.
"""
this.ajaxEvents.put(TabEvent.load, loadEvent);
setLoadEvent(new TabsAjaxJsScopeUiEvent(this, TabEvent.load));
return this;
} | java | public Tabs setAjaxLoadEvent(ITabsAjaxEvent loadEvent)
{
this.ajaxEvents.put(TabEvent.load, loadEvent);
setLoadEvent(new TabsAjaxJsScopeUiEvent(this, TabEvent.load));
return this;
} | [
"public",
"Tabs",
"setAjaxLoadEvent",
"(",
"ITabsAjaxEvent",
"loadEvent",
")",
"{",
"this",
".",
"ajaxEvents",
".",
"put",
"(",
"TabEvent",
".",
"load",
",",
"loadEvent",
")",
";",
"setLoadEvent",
"(",
"new",
"TabsAjaxJsScopeUiEvent",
"(",
"this",
",",
"TabEve... | Sets the call-back for the AJAX Load event.
@param loadEvent
The ITabsAjaxEvent. | [
"Sets",
"the",
"call",
"-",
"back",
"for",
"the",
"AJAX",
"Load",
"event",
"."
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java#L589-L594 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L93_L4 | @Pure
public static Point2d L93_L4(double x, double y) {
"""
This function convert France Lambert 93 coordinate to
France Lambert IV coordinate.
@param x is the coordinate in France Lambert 93
@param y is the coordinate in France Lambert 93
@return the France Lambert IV coordinate.
"""
final Point2d n... | java | @Pure
public static Point2d L93_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_... | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L93_L4",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_93_N",
",",
"LAMBERT_93_C",
",",
"LAMBERT_93_XS",
",... | This function convert France Lambert 93 coordinate to
France Lambert IV coordinate.
@param x is the coordinate in France Lambert 93
@param y is the coordinate in France Lambert 93
@return the France Lambert IV coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"93",
"coordinate",
"to",
"France",
"Lambert",
"IV",
"coordinate",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L915-L928 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmModelCompleter.java | JvmModelCompleter.replaceVariables | protected String replaceVariables(String commentForGenerated, JvmDeclaredType jvmType) {
"""
Replace the variables contained in the comment to be written to the <code>@Generated</code> annotation.
"""
String result = commentForGenerated;
if (result.contains(GENERATED_COMMENT_VAR_SOURCE_FILE)) {
Resource... | java | protected String replaceVariables(String commentForGenerated, JvmDeclaredType jvmType) {
String result = commentForGenerated;
if (result.contains(GENERATED_COMMENT_VAR_SOURCE_FILE)) {
Resource resource = jvmType.eResource();
if (resource != null) {
URI uri = resource.getURI();
if (uri != null) {
... | [
"protected",
"String",
"replaceVariables",
"(",
"String",
"commentForGenerated",
",",
"JvmDeclaredType",
"jvmType",
")",
"{",
"String",
"result",
"=",
"commentForGenerated",
";",
"if",
"(",
"result",
".",
"contains",
"(",
"GENERATED_COMMENT_VAR_SOURCE_FILE",
")",
")",... | Replace the variables contained in the comment to be written to the <code>@Generated</code> annotation. | [
"Replace",
"the",
"variables",
"contained",
"in",
"the",
"comment",
"to",
"be",
"written",
"to",
"the",
"<code",
">"
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmModelCompleter.java#L275-L290 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java | JBBPOut.BeginBin | public static JBBPOut BeginBin(final JBBPByteOrder byteOrder, final JBBPBitOrder bitOrder) {
"""
Start a DSL session for defined both byte outOrder and bit outOrder parameters.
@param byteOrder the byte outOrder to be used for the session
@param bitOrder the bit outOrder to be used for the session
@return th... | java | public static JBBPOut BeginBin(final JBBPByteOrder byteOrder, final JBBPBitOrder bitOrder) {
return new JBBPOut(new ByteArrayOutputStream(), byteOrder, bitOrder);
} | [
"public",
"static",
"JBBPOut",
"BeginBin",
"(",
"final",
"JBBPByteOrder",
"byteOrder",
",",
"final",
"JBBPBitOrder",
"bitOrder",
")",
"{",
"return",
"new",
"JBBPOut",
"(",
"new",
"ByteArrayOutputStream",
"(",
")",
",",
"byteOrder",
",",
"bitOrder",
")",
";",
"... | Start a DSL session for defined both byte outOrder and bit outOrder parameters.
@param byteOrder the byte outOrder to be used for the session
@param bitOrder the bit outOrder to be used for the session
@return the new DSL session generated with the parameters and inside byte
array stream. | [
"Start",
"a",
"DSL",
"session",
"for",
"defined",
"both",
"byte",
"outOrder",
"and",
"bit",
"outOrder",
"parameters",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java#L107-L109 |
sarl/sarl | products/sarlc/src/main/java/io/sarl/lang/sarlc/configs/subconfigs/ValidatorConfig.java | ValidatorConfig.setWarningLevels | @BQConfigProperty("Specify the levels of specific warnings")
public void setWarningLevels(Map<String, Severity> levels) {
"""
Change the specific warning levels.
@param levels the warnings levels.
"""
if (levels == null) {
this.warningLevels = new HashMap<>();
} else {
this.warningLevels = levels... | java | @BQConfigProperty("Specify the levels of specific warnings")
public void setWarningLevels(Map<String, Severity> levels) {
if (levels == null) {
this.warningLevels = new HashMap<>();
} else {
this.warningLevels = levels;
}
} | [
"@",
"BQConfigProperty",
"(",
"\"Specify the levels of specific warnings\"",
")",
"public",
"void",
"setWarningLevels",
"(",
"Map",
"<",
"String",
",",
"Severity",
">",
"levels",
")",
"{",
"if",
"(",
"levels",
"==",
"null",
")",
"{",
"this",
".",
"warningLevels"... | Change the specific warning levels.
@param levels the warnings levels. | [
"Change",
"the",
"specific",
"warning",
"levels",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/products/sarlc/src/main/java/io/sarl/lang/sarlc/configs/subconfigs/ValidatorConfig.java#L90-L97 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java | EnvironmentSettingsInner.publishAsync | public Observable<Void> publishAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) {
"""
Provisions/deprovisions required resources for an environment setting based on current state of the lab/environment setting.
@param resourceGroupName The name of the resourc... | java | public Observable<Void> publishAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) {
return publishWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
... | [
"public",
"Observable",
"<",
"Void",
">",
"publishAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"environmentSettingName",
")",
"{",
"return",
"publishWithServiceResponseAsync",
"(",
"resourceGroupNa... | Provisions/deprovisions required resources for an environment setting based on current state of the lab/environment setting.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param environmentSettingName The name of the envi... | [
"Provisions",
"/",
"deprovisions",
"required",
"resources",
"for",
"an",
"environment",
"setting",
"based",
"on",
"current",
"state",
"of",
"the",
"lab",
"/",
"environment",
"setting",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java#L1232-L1239 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.security/src/com/ibm/websphere/security/audit/AuditEvent.java | AuditEvent.isAuditRequired | public static boolean isAuditRequired(String eventType, String outcome) throws AuditServiceUnavailableException {
"""
Check to see if auditing is required for an event type and outcome.
@param eventType SECURITY_AUTHN, SECURITY_AUTHZ, etc
@param outcome OUTCOME_SUCCESS, OUTCOME_DENIED, etc.
@return true - eve... | java | public static boolean isAuditRequired(String eventType, String outcome) throws AuditServiceUnavailableException {
AuditService auditService = SecurityUtils.getAuditService();
if (auditService != null) {
return auditService.isAuditRequired(eventType, outcome);
} else {
thr... | [
"public",
"static",
"boolean",
"isAuditRequired",
"(",
"String",
"eventType",
",",
"String",
"outcome",
")",
"throws",
"AuditServiceUnavailableException",
"{",
"AuditService",
"auditService",
"=",
"SecurityUtils",
".",
"getAuditService",
"(",
")",
";",
"if",
"(",
"a... | Check to see if auditing is required for an event type and outcome.
@param eventType SECURITY_AUTHN, SECURITY_AUTHZ, etc
@param outcome OUTCOME_SUCCESS, OUTCOME_DENIED, etc.
@return true - events with the type/outcome should be audited
false - events with the type/outcome should not be audited
@throws AuditServiceUna... | [
"Check",
"to",
"see",
"if",
"auditing",
"is",
"required",
"for",
"an",
"event",
"type",
"and",
"outcome",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.security/src/com/ibm/websphere/security/audit/AuditEvent.java#L595-L602 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/Expression.java | Expression.checkTypes | static void checkTypes(ImmutableList<Type> types, Iterable<? extends Expression> exprs) {
"""
Checks that the given expressions are compatible with the given types.
"""
int size = Iterables.size(exprs);
checkArgument(
size == types.size(),
"Supplied the wrong number of parameters. Expec... | java | static void checkTypes(ImmutableList<Type> types, Iterable<? extends Expression> exprs) {
int size = Iterables.size(exprs);
checkArgument(
size == types.size(),
"Supplied the wrong number of parameters. Expected %s, got %s",
types.size(),
size);
// checkIsAssignableTo is an n... | [
"static",
"void",
"checkTypes",
"(",
"ImmutableList",
"<",
"Type",
">",
"types",
",",
"Iterable",
"<",
"?",
"extends",
"Expression",
">",
"exprs",
")",
"{",
"int",
"size",
"=",
"Iterables",
".",
"size",
"(",
"exprs",
")",
";",
"checkArgument",
"(",
"size... | Checks that the given expressions are compatible with the given types. | [
"Checks",
"that",
"the",
"given",
"expressions",
"are",
"compatible",
"with",
"the",
"given",
"types",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/Expression.java#L167-L182 |
molgenis/molgenis | molgenis-data-index/src/main/java/org/molgenis/data/index/job/IndexJobService.java | IndexJobService.performAction | private boolean performAction(Progress progress, int progressCount, IndexAction indexAction) {
"""
Performs a single IndexAction
@param progress {@link Progress} to report progress to
@param progressCount the progress count for this IndexAction
@param indexAction Entity of type IndexActionMetaData
@return bo... | java | private boolean performAction(Progress progress, int progressCount, IndexAction indexAction) {
requireNonNull(indexAction);
String entityTypeId = indexAction.getEntityTypeId();
updateIndexActionStatus(indexAction, IndexActionMetadata.IndexStatus.STARTED);
try {
if (dataService.hasEntityType(entity... | [
"private",
"boolean",
"performAction",
"(",
"Progress",
"progress",
",",
"int",
"progressCount",
",",
"IndexAction",
"indexAction",
")",
"{",
"requireNonNull",
"(",
"indexAction",
")",
";",
"String",
"entityTypeId",
"=",
"indexAction",
".",
"getEntityTypeId",
"(",
... | Performs a single IndexAction
@param progress {@link Progress} to report progress to
@param progressCount the progress count for this IndexAction
@param indexAction Entity of type IndexActionMetaData
@return boolean indicating success or failure | [
"Performs",
"a",
"single",
"IndexAction"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data-index/src/main/java/org/molgenis/data/index/job/IndexJobService.java#L107-L145 |
AKSW/RDFUnit | rdfunit-model/src/main/java/org/aksw/rdfunit/model/shacl/ShaclModel.java | ShaclModel.getExplicitShapeTargets | public Map<Shape, Set<ShapeTarget>> getExplicitShapeTargets(Collection<Shape> shapes) {
"""
/*
public Set<TestCase> generateTestCasesOld() {
ImmutableSet.Builder<TestCase> builder = ImmutableSet.builder();
getShapes().forEach( shape -> // for every shape
shape.getTargets().forEach(target -> // for every tar... | java | public Map<Shape, Set<ShapeTarget>> getExplicitShapeTargets(Collection<Shape> shapes) {
Map<Shape, Set<ShapeTarget>> targets = new HashMap<>();
shapes.forEach( s -> {
Set<ShapeTarget> trgs = BatchShapeTargetReader.create().read(s.getElement());
if (!trgs.isEmpty()) {
... | [
"public",
"Map",
"<",
"Shape",
",",
"Set",
"<",
"ShapeTarget",
">",
">",
"getExplicitShapeTargets",
"(",
"Collection",
"<",
"Shape",
">",
"shapes",
")",
"{",
"Map",
"<",
"Shape",
",",
"Set",
"<",
"ShapeTarget",
">",
">",
"targets",
"=",
"new",
"HashMap",... | /*
public Set<TestCase> generateTestCasesOld() {
ImmutableSet.Builder<TestCase> builder = ImmutableSet.builder();
getShapes().forEach( shape -> // for every shape
shape.getTargets().forEach(target -> // for every target (skip if none)
shape.getPropertyConstraintGroups().forEach( ppg ->
ppg.getPropertyConstraints().fo... | [
"/",
"*",
"public",
"Set<TestCase",
">",
"generateTestCasesOld",
"()",
"{",
"ImmutableSet",
".",
"Builder<TestCase",
">",
"builder",
"=",
"ImmutableSet",
".",
"builder",
"()",
";"
] | train | https://github.com/AKSW/RDFUnit/blob/083f18ebda4ad790b1fbb4cfe1c9dd1762d51384/rdfunit-model/src/main/java/org/aksw/rdfunit/model/shacl/ShaclModel.java#L119-L128 |
jbundle/jbundle | base/message/trx/src/main/java/org/jbundle/base/message/trx/processor/BaseMessageProcessor.java | BaseMessageProcessor.getMessageProcessor | public static BaseMessageProcessor getMessageProcessor(Task taskParent, BaseMessage externalTrxMessage, String strDefaultProcessorClass) {
"""
Given the message (code) name, get the message processor.
@param taskParent Task to pass to new process.
@param recordMain Record to pass to the new process.
@param prop... | java | public static BaseMessageProcessor getMessageProcessor(Task taskParent, BaseMessage externalTrxMessage, String strDefaultProcessorClass)
{
BaseMessageProcessor messageProcessor = null;
String strClass = null;
if (externalTrxMessage != null)
strClass = (String)((TrxMessageHeader)e... | [
"public",
"static",
"BaseMessageProcessor",
"getMessageProcessor",
"(",
"Task",
"taskParent",
",",
"BaseMessage",
"externalTrxMessage",
",",
"String",
"strDefaultProcessorClass",
")",
"{",
"BaseMessageProcessor",
"messageProcessor",
"=",
"null",
";",
"String",
"strClass",
... | Given the message (code) name, get the message processor.
@param taskParent Task to pass to new process.
@param recordMain Record to pass to the new process.
@param properties Properties to pass to the new process.
@param strMessageName The name of the message to get the processor from (the message code or ID in the Me... | [
"Given",
"the",
"message",
"(",
"code",
")",
"name",
"get",
"the",
"message",
"processor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/trx/src/main/java/org/jbundle/base/message/trx/processor/BaseMessageProcessor.java#L113-L131 |
Netflix/astyanax | astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java | CompositeEntityMapper.toColumnName | private ByteBuffer toColumnName(Object obj) {
"""
Return the column name byte buffer for this entity
@param obj
@return
"""
SimpleCompositeBuilder composite = new SimpleCompositeBuilder(bufferSize, Equality.EQUAL);
// Iterate through each component and add to a CompositeType structure
... | java | private ByteBuffer toColumnName(Object obj) {
SimpleCompositeBuilder composite = new SimpleCompositeBuilder(bufferSize, Equality.EQUAL);
// Iterate through each component and add to a CompositeType structure
for (FieldMapper<?> mapper : components) {
try {
composite.... | [
"private",
"ByteBuffer",
"toColumnName",
"(",
"Object",
"obj",
")",
"{",
"SimpleCompositeBuilder",
"composite",
"=",
"new",
"SimpleCompositeBuilder",
"(",
"bufferSize",
",",
"Equality",
".",
"EQUAL",
")",
";",
"// Iterate through each component and add to a CompositeType st... | Return the column name byte buffer for this entity
@param obj
@return | [
"Return",
"the",
"column",
"name",
"byte",
"buffer",
"for",
"this",
"entity"
] | train | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java#L226-L239 |
stripe/stripe-android | stripe/src/main/java/com/stripe/android/view/DateUtils.java | DateUtils.convertTwoDigitYearToFour | @IntRange(from = 1000, to = 9999)
static int convertTwoDigitYearToFour(@IntRange(from = 0, to = 99) int inputYear) {
"""
Converts a two-digit input year to a four-digit year. As the current calendar year
approaches a century, we assume small values to mean the next century. For instance, if
the current year ... | java | @IntRange(from = 1000, to = 9999)
static int convertTwoDigitYearToFour(@IntRange(from = 0, to = 99) int inputYear) {
return convertTwoDigitYearToFour(inputYear, Calendar.getInstance());
} | [
"@",
"IntRange",
"(",
"from",
"=",
"1000",
",",
"to",
"=",
"9999",
")",
"static",
"int",
"convertTwoDigitYearToFour",
"(",
"@",
"IntRange",
"(",
"from",
"=",
"0",
",",
"to",
"=",
"99",
")",
"int",
"inputYear",
")",
"{",
"return",
"convertTwoDigitYearToFo... | Converts a two-digit input year to a four-digit year. As the current calendar year
approaches a century, we assume small values to mean the next century. For instance, if
the current year is 2090, and the input value is "18", the user probably means 2118,
not 2018. However, in 2017, the input "18" probably means 2018. ... | [
"Converts",
"a",
"two",
"-",
"digit",
"input",
"year",
"to",
"a",
"four",
"-",
"digit",
"year",
".",
"As",
"the",
"current",
"calendar",
"year",
"approaches",
"a",
"century",
"we",
"assume",
"small",
"values",
"to",
"mean",
"the",
"next",
"century",
".",... | train | https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/DateUtils.java#L143-L146 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java | PackageSummaryBuilder.buildPackageDoc | public void buildPackageDoc(XMLNode node, Content contentTree) throws DocletException {
"""
Build the package documentation.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the documentation will be added
@throws DocletException if there is ... | java | public void buildPackageDoc(XMLNode node, Content contentTree) throws DocletException {
contentTree = packageWriter.getPackageHeader(utils.getPackageName(packageElement));
buildChildren(node, contentTree);
packageWriter.addPackageFooter(contentTree);
packageWriter.printDocument(contentTr... | [
"public",
"void",
"buildPackageDoc",
"(",
"XMLNode",
"node",
",",
"Content",
"contentTree",
")",
"throws",
"DocletException",
"{",
"contentTree",
"=",
"packageWriter",
".",
"getPackageHeader",
"(",
"utils",
".",
"getPackageName",
"(",
"packageElement",
")",
")",
"... | Build the package documentation.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the documentation will be added
@throws DocletException if there is a problem while building the documentation | [
"Build",
"the",
"package",
"documentation",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java#L133-L139 |
apereo/cas | support/cas-server-support-saml-mdui/src/main/java/org/apereo/cas/support/saml/mdui/web/flow/SamlMetadataUIParserAction.java | SamlMetadataUIParserAction.getRegisteredServiceFromRequest | protected RegisteredService getRegisteredServiceFromRequest(final RequestContext requestContext, final String entityId) {
"""
Gets registered service from request.
@param requestContext the request context
@param entityId the entity id
@return the registered service from request
"""
val curr... | java | protected RegisteredService getRegisteredServiceFromRequest(final RequestContext requestContext, final String entityId) {
val currentService = WebUtils.getService(requestContext);
val service = this.serviceFactory.createService(entityId);
var registeredService = this.servicesManager.findServiceB... | [
"protected",
"RegisteredService",
"getRegisteredServiceFromRequest",
"(",
"final",
"RequestContext",
"requestContext",
",",
"final",
"String",
"entityId",
")",
"{",
"val",
"currentService",
"=",
"WebUtils",
".",
"getService",
"(",
"requestContext",
")",
";",
"val",
"s... | Gets registered service from request.
@param requestContext the request context
@param entityId the entity id
@return the registered service from request | [
"Gets",
"registered",
"service",
"from",
"request",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-mdui/src/main/java/org/apereo/cas/support/saml/mdui/web/flow/SamlMetadataUIParserAction.java#L106-L116 |
bignerdranch/expandable-recycler-view | sampleapp/src/main/java/com/bignerdranch/expandablerecyclerviewsample/linear/horizontal/HorizontalExpandableAdapter.java | HorizontalExpandableAdapter.onCreateParentViewHolder | @UiThread
@NonNull
@Override
public HorizontalParentViewHolder onCreateParentViewHolder(@NonNull ViewGroup parent, int viewType) {
"""
OnCreateViewHolder implementation for parent items. The desired ParentViewHolder should
be inflated here
@param parent for inflating the View
@return the user's cu... | java | @UiThread
@NonNull
@Override
public HorizontalParentViewHolder onCreateParentViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = mInflater.inflate(R.layout.list_item_parent_horizontal, parent, false);
return new HorizontalParentViewHolder(view);
} | [
"@",
"UiThread",
"@",
"NonNull",
"@",
"Override",
"public",
"HorizontalParentViewHolder",
"onCreateParentViewHolder",
"(",
"@",
"NonNull",
"ViewGroup",
"parent",
",",
"int",
"viewType",
")",
"{",
"View",
"view",
"=",
"mInflater",
".",
"inflate",
"(",
"R",
".",
... | OnCreateViewHolder implementation for parent items. The desired ParentViewHolder should
be inflated here
@param parent for inflating the View
@return the user's custom parent ViewHolder that must extend ParentViewHolder | [
"OnCreateViewHolder",
"implementation",
"for",
"parent",
"items",
".",
"The",
"desired",
"ParentViewHolder",
"should",
"be",
"inflated",
"here"
] | train | https://github.com/bignerdranch/expandable-recycler-view/blob/930912510620894c531d236856fa79d646e2f1ed/sampleapp/src/main/java/com/bignerdranch/expandablerecyclerviewsample/linear/horizontal/HorizontalExpandableAdapter.java#L41-L47 |
btaz/data-util | src/main/java/com/btaz/util/xml/diff/DefaultReport.java | DefaultReport.trimNonXmlElements | @SuppressWarnings("RedundantStringConstructorCall") // avoid String substring memory leak in JDK 1.6
private String trimNonXmlElements(String path) {
"""
/*
This method trims non XML element data from the end of a path
e.g. <float name="score">12.34567 would become <float name="score">, 12.34567 would be str... | java | @SuppressWarnings("RedundantStringConstructorCall") // avoid String substring memory leak in JDK 1.6
private String trimNonXmlElements(String path) {
if(path != null && path.length() > 0) {
int pos = path.lastIndexOf(">");
if(pos > -1) {
path = new String(path.substri... | [
"@",
"SuppressWarnings",
"(",
"\"RedundantStringConstructorCall\"",
")",
"// avoid String substring memory leak in JDK 1.6",
"private",
"String",
"trimNonXmlElements",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"path",
"!=",
"null",
"&&",
"path",
".",
"length",
"(",
... | /*
This method trims non XML element data from the end of a path
e.g. <float name="score">12.34567 would become <float name="score">, 12.34567 would be stripped out | [
"/",
"*",
"This",
"method",
"trims",
"non",
"XML",
"element",
"data",
"from",
"the",
"end",
"of",
"a",
"path",
"e",
".",
"g",
".",
"<float",
"name",
"=",
"score",
">",
"12",
".",
"34567",
"would",
"become",
"<float",
"name",
"=",
"score",
">",
"12"... | train | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/xml/diff/DefaultReport.java#L71-L80 |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/adt/ADT.java | ADT.replaceNode | public void replaceNode(final ADTNode<S, I, O> oldNode, final ADTNode<S, I, O> newNode) {
"""
Replaces an existing node in the tree with a new one and updates the references of parent/child nodes
accordingly.
@param oldNode
the node to replace
@param newNode
the replacement
"""
if (this.root.eq... | java | public void replaceNode(final ADTNode<S, I, O> oldNode, final ADTNode<S, I, O> newNode) {
if (this.root.equals(oldNode)) {
this.root = newNode;
} else if (ADTUtil.isResetNode(oldNode)) {
final ADTNode<S, I, O> endOfPreviousADS = oldNode.getParent();
final O outputToR... | [
"public",
"void",
"replaceNode",
"(",
"final",
"ADTNode",
"<",
"S",
",",
"I",
",",
"O",
">",
"oldNode",
",",
"final",
"ADTNode",
"<",
"S",
",",
"I",
",",
"O",
">",
"newNode",
")",
"{",
"if",
"(",
"this",
".",
"root",
".",
"equals",
"(",
"oldNode"... | Replaces an existing node in the tree with a new one and updates the references of parent/child nodes
accordingly.
@param oldNode
the node to replace
@param newNode
the replacement | [
"Replaces",
"an",
"existing",
"node",
"in",
"the",
"tree",
"with",
"a",
"new",
"one",
"and",
"updates",
"the",
"references",
"of",
"parent",
"/",
"child",
"nodes",
"accordingly",
"."
] | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/adt/ADT.java#L83-L106 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java | Bytes.toShort | public static short toShort(byte[] bytes, int offset, final int length) {
"""
Converts a byte array to a short value.
@param bytes byte array
@param offset offset into array
@param length length, has to be {@link #SIZEOF_SHORT}
@return the short value
@throws IllegalArgumentException if length is not {@link #... | java | public static short toShort(byte[] bytes, int offset, final int length) {
if (length != SIZEOF_SHORT || offset + length > bytes.length) {
throw explainWrongLengthOrOffset(bytes, offset, length, SIZEOF_SHORT);
}
short n = 0;
n ^= bytes[offset] & 0xFF;
n <<= 8;
n ^= bytes[offset + 1] & 0xFF;... | [
"public",
"static",
"short",
"toShort",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"final",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"!=",
"SIZEOF_SHORT",
"||",
"offset",
"+",
"length",
">",
"bytes",
".",
"length",
")",
"{",
"t... | Converts a byte array to a short value.
@param bytes byte array
@param offset offset into array
@param length length, has to be {@link #SIZEOF_SHORT}
@return the short value
@throws IllegalArgumentException if length is not {@link #SIZEOF_SHORT}
or if there's not enough room in the array at the offset indicated. | [
"Converts",
"a",
"byte",
"array",
"to",
"a",
"short",
"value",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java#L642-L651 |
joniles/mpxj | src/main/java/net/sf/mpxj/reader/ProjectReaderUtility.java | ProjectReaderUtility.getProjectReader | public static ProjectReader getProjectReader(String name) throws MPXJException {
"""
Retrieves a ProjectReader instance which can read a file of the
type specified by the supplied file name.
@param name file name
@return ProjectReader instance
"""
int index = name.lastIndexOf('.');
if (index =... | java | public static ProjectReader getProjectReader(String name) throws MPXJException
{
int index = name.lastIndexOf('.');
if (index == -1)
{
throw new IllegalArgumentException("Filename has no extension: " + name);
}
String extension = name.substring(index + 1).toUpperCase();
... | [
"public",
"static",
"ProjectReader",
"getProjectReader",
"(",
"String",
"name",
")",
"throws",
"MPXJException",
"{",
"int",
"index",
"=",
"name",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"throw",
"new",
... | Retrieves a ProjectReader instance which can read a file of the
type specified by the supplied file name.
@param name file name
@return ProjectReader instance | [
"Retrieves",
"a",
"ProjectReader",
"instance",
"which",
"can",
"read",
"a",
"file",
"of",
"the",
"type",
"specified",
"by",
"the",
"supplied",
"file",
"name",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/reader/ProjectReaderUtility.java#L66-L92 |
alkacon/opencms-core | src/org/opencms/loader/CmsJspLoader.java | CmsJspLoader.readJspResource | protected CmsResource readJspResource(CmsFlexController controller, String jspName) throws CmsException {
"""
Returns the jsp resource identified by the given name, using the controllers cms context.<p>
@param controller the flex controller
@param jspName the name of the jsp
@return an OpenCms resource
@... | java | protected CmsResource readJspResource(CmsFlexController controller, String jspName) throws CmsException {
// create an OpenCms user context that operates in the root site
CmsObject cms = OpenCms.initCmsObject(controller.getCmsObject());
// we only need to change the site, but not the project,
... | [
"protected",
"CmsResource",
"readJspResource",
"(",
"CmsFlexController",
"controller",
",",
"String",
"jspName",
")",
"throws",
"CmsException",
"{",
"// create an OpenCms user context that operates in the root site",
"CmsObject",
"cms",
"=",
"OpenCms",
".",
"initCmsObject",
"... | Returns the jsp resource identified by the given name, using the controllers cms context.<p>
@param controller the flex controller
@param jspName the name of the jsp
@return an OpenCms resource
@throws CmsException if something goes wrong | [
"Returns",
"the",
"jsp",
"resource",
"identified",
"by",
"the",
"given",
"name",
"using",
"the",
"controllers",
"cms",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsJspLoader.java#L1601-L1610 |
code4everything/util | src/main/java/com/zhazhapan/util/Checker.java | Checker.checkNull | public static Date checkNull(Date value, Date elseValue) {
"""
检测日期是否为NULL
@param value 需要检测的日期
@param elseValue 为null染返回的值
@return {@link Date}
@since 1.0.8
"""
return isNull(value) ? elseValue : value;
} | java | public static Date checkNull(Date value, Date elseValue) {
return isNull(value) ? elseValue : value;
} | [
"public",
"static",
"Date",
"checkNull",
"(",
"Date",
"value",
",",
"Date",
"elseValue",
")",
"{",
"return",
"isNull",
"(",
"value",
")",
"?",
"elseValue",
":",
"value",
";",
"}"
] | 检测日期是否为NULL
@param value 需要检测的日期
@param elseValue 为null染返回的值
@return {@link Date}
@since 1.0.8 | [
"检测日期是否为NULL"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Checker.java#L1544-L1546 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueFeatureHandler.java | KeyValueFeatureHandler.helloRequest | private FullBinaryMemcacheRequest helloRequest(int connId) throws Exception {
"""
Creates the HELLO request to ask for certain supported features.
@param connId the connection id
@return the request to send over the wire
"""
byte[] key = generateAgentJson(
ctx.environment().userAgent(),... | java | private FullBinaryMemcacheRequest helloRequest(int connId) throws Exception {
byte[] key = generateAgentJson(
ctx.environment().userAgent(),
ctx.coreId(),
connId
);
short keyLength = (short) key.length;
ByteBuf wanted = Unpooled.buffer(features.size()... | [
"private",
"FullBinaryMemcacheRequest",
"helloRequest",
"(",
"int",
"connId",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]",
"key",
"=",
"generateAgentJson",
"(",
"ctx",
".",
"environment",
"(",
")",
".",
"userAgent",
"(",
")",
",",
"ctx",
".",
"coreId",... | Creates the HELLO request to ask for certain supported features.
@param connId the connection id
@return the request to send over the wire | [
"Creates",
"the",
"HELLO",
"request",
"to",
"ask",
"for",
"certain",
"supported",
"features",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueFeatureHandler.java#L130-L149 |
google/closure-compiler | src/com/google/javascript/jscomp/MinimizeExitPoints.java | MinimizeExitPoints.tryMinimizeSwitchCaseExits | void tryMinimizeSwitchCaseExits(Node n, Token exitType, @Nullable String labelName) {
"""
Attempt to remove explicit exits from switch cases that also occur implicitly
after the switch.
"""
checkState(NodeUtil.isSwitchCase(n));
checkState(n != n.getParent().getLastChild());
Node block = n.getLast... | java | void tryMinimizeSwitchCaseExits(Node n, Token exitType, @Nullable String labelName) {
checkState(NodeUtil.isSwitchCase(n));
checkState(n != n.getParent().getLastChild());
Node block = n.getLastChild();
Node maybeBreak = block.getLastChild();
if (maybeBreak == null || !maybeBreak.isBreak() || maybeB... | [
"void",
"tryMinimizeSwitchCaseExits",
"(",
"Node",
"n",
",",
"Token",
"exitType",
",",
"@",
"Nullable",
"String",
"labelName",
")",
"{",
"checkState",
"(",
"NodeUtil",
".",
"isSwitchCase",
"(",
"n",
")",
")",
";",
"checkState",
"(",
"n",
"!=",
"n",
".",
... | Attempt to remove explicit exits from switch cases that also occur implicitly
after the switch. | [
"Attempt",
"to",
"remove",
"explicit",
"exits",
"from",
"switch",
"cases",
"that",
"also",
"occur",
"implicitly",
"after",
"the",
"switch",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/MinimizeExitPoints.java#L219-L242 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionFormulaConfig.java | CollisionFormulaConfig.createCollision | public static CollisionFormula createCollision(Xml node) {
"""
Create a collision formula from its node.
@param node The collision formula node (must not be <code>null</code>).
@return The tile collision formula instance.
@throws LionEngineException If error when reading data.
"""
Check.notNull(n... | java | public static CollisionFormula createCollision(Xml node)
{
Check.notNull(node);
final String name = node.readString(ATT_NAME);
final CollisionRange range = CollisionRangeConfig.imports(node.getChild(CollisionRangeConfig.NODE_RANGE));
final CollisionFunction function = Collisio... | [
"public",
"static",
"CollisionFormula",
"createCollision",
"(",
"Xml",
"node",
")",
"{",
"Check",
".",
"notNull",
"(",
"node",
")",
";",
"final",
"String",
"name",
"=",
"node",
".",
"readString",
"(",
"ATT_NAME",
")",
";",
"final",
"CollisionRange",
"range",... | Create a collision formula from its node.
@param node The collision formula node (must not be <code>null</code>).
@return The tile collision formula instance.
@throws LionEngineException If error when reading data. | [
"Create",
"a",
"collision",
"formula",
"from",
"its",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionFormulaConfig.java#L98-L108 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/json/JsonDriverFunction.java | JsonDriverFunction.exportTable | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
"""
Save a table or a query to JSON file
@param connection
@param tableReference
@param fileName
@param progress
@param encoding
@th... | java | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
JsonWriteDriver jsonDriver = new JsonWriteDriver(connection);
jsonDriver.write(progress,tableReference, fileName, encoding);
... | [
"@",
"Override",
"public",
"void",
"exportTable",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
",",
"File",
"fileName",
",",
"ProgressVisitor",
"progress",
",",
"String",
"encoding",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"Jso... | Save a table or a query to JSON file
@param connection
@param tableReference
@param fileName
@param progress
@param encoding
@throws SQLException
@throws IOException | [
"Save",
"a",
"table",
"or",
"a",
"query",
"to",
"JSON",
"file"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/json/JsonDriverFunction.java#L81-L85 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/style/MasterPageStyle.java | MasterPageStyle.appendXMLToMasterStyle | public void appendXMLToMasterStyle(final XMLUtil util, final Appendable appendable)
throws IOException {
"""
Return the master-style informations for this PageStyle.
@param util a util for XML writing
@param appendable where to write
@throws IOException If an I/O error occurs
"""
... | java | public void appendXMLToMasterStyle(final XMLUtil util, final Appendable appendable)
throws IOException {
appendable.append("<style:master-page");
util.appendEAttribute(appendable, "style:name", this.name);
util.appendEAttribute(appendable, "style:page-layout-name", this.layoutName);
... | [
"public",
"void",
"appendXMLToMasterStyle",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"Appendable",
"appendable",
")",
"throws",
"IOException",
"{",
"appendable",
".",
"append",
"(",
"\"<style:master-page\"",
")",
";",
"util",
".",
"appendEAttribute",
"(",
"a... | Return the master-style informations for this PageStyle.
@param util a util for XML writing
@param appendable where to write
@throws IOException If an I/O error occurs | [
"Return",
"the",
"master",
"-",
"style",
"informations",
"for",
"this",
"PageStyle",
"."
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/style/MasterPageStyle.java#L88-L106 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/WsLocationAdminImpl.java | WsLocationAdminImpl.createLocations | public static WsLocationAdminImpl createLocations(final Map<String, Object> initProps) {
"""
Construct the WsLocationAdminService singleton based on a set of initial
properties provided by bootstrap or other initialization code (e.g. an
initializer in a test environment).
@param initProps
@return WsLocationA... | java | public static WsLocationAdminImpl createLocations(final Map<String, Object> initProps) {
if (instance.get() == null) {
SymbolRegistry.getRegistry().clear();
Callable<WsLocationAdminImpl> initializer = new Callable<WsLocationAdminImpl>() {
@Override
public ... | [
"public",
"static",
"WsLocationAdminImpl",
"createLocations",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"initProps",
")",
"{",
"if",
"(",
"instance",
".",
"get",
"(",
")",
"==",
"null",
")",
"{",
"SymbolRegistry",
".",
"getRegistry",
"(",
")"... | Construct the WsLocationAdminService singleton based on a set of initial
properties provided by bootstrap or other initialization code (e.g. an
initializer in a test environment).
@param initProps
@return WsLocationAdmin | [
"Construct",
"the",
"WsLocationAdminService",
"singleton",
"based",
"on",
"a",
"set",
"of",
"initial",
"properties",
"provided",
"by",
"bootstrap",
"or",
"other",
"initialization",
"code",
"(",
"e",
".",
"g",
".",
"an",
"initializer",
"in",
"a",
"test",
"envir... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/WsLocationAdminImpl.java#L81-L94 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/renderer/AbstractBundleLinkRenderer.java | AbstractBundleLinkRenderer.renderGlobalBundleLinks | protected void renderGlobalBundleLinks(BundleRendererContext ctx, Writer out, boolean debugOn) throws IOException {
"""
Renders the links for the global bundles
@param ctx
the context
@param out
the writer
@param debugOn
the debug flag
@throws IOException
if an IOException occurs.
"""
if (debugOn)... | java | protected void renderGlobalBundleLinks(BundleRendererContext ctx, Writer out, boolean debugOn) throws IOException {
if (debugOn) {
addComment("Start adding global members.", out);
}
performGlobalBundleLinksRendering(ctx, out, debugOn);
ctx.setGlobalBundleAdded(true);
if (debugOn) {
addComment("Finish... | [
"protected",
"void",
"renderGlobalBundleLinks",
"(",
"BundleRendererContext",
"ctx",
",",
"Writer",
"out",
",",
"boolean",
"debugOn",
")",
"throws",
"IOException",
"{",
"if",
"(",
"debugOn",
")",
"{",
"addComment",
"(",
"\"Start adding global members.\"",
",",
"out"... | Renders the links for the global bundles
@param ctx
the context
@param out
the writer
@param debugOn
the debug flag
@throws IOException
if an IOException occurs. | [
"Renders",
"the",
"links",
"for",
"the",
"global",
"bundles"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/renderer/AbstractBundleLinkRenderer.java#L195-L207 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java | StylesheetHandler.pushSpaceHandling | void pushSpaceHandling(Attributes attrs)
throws org.xml.sax.SAXParseException {
"""
Push boolean value on to the spacePreserve stack depending on the value
of xml:space=default/preserve.
@param attrs list of attributes that were passed to startElement.
"""
String value = attrs.getValue("xml:spa... | java | void pushSpaceHandling(Attributes attrs)
throws org.xml.sax.SAXParseException
{
String value = attrs.getValue("xml:space");
if(null == value)
{
m_spacePreserveStack.push(m_spacePreserveStack.peekOrFalse());
}
else if(value.equals("preserve"))
{
m_spacePreserveStack.push(tru... | [
"void",
"pushSpaceHandling",
"(",
"Attributes",
"attrs",
")",
"throws",
"org",
".",
"xml",
".",
"sax",
".",
"SAXParseException",
"{",
"String",
"value",
"=",
"attrs",
".",
"getValue",
"(",
"\"xml:space\"",
")",
";",
"if",
"(",
"null",
"==",
"value",
")",
... | Push boolean value on to the spacePreserve stack depending on the value
of xml:space=default/preserve.
@param attrs list of attributes that were passed to startElement. | [
"Push",
"boolean",
"value",
"on",
"to",
"the",
"spacePreserve",
"stack",
"depending",
"on",
"the",
"value",
"of",
"xml",
":",
"space",
"=",
"default",
"/",
"preserve",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L1646-L1677 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_game_ipOnGame_rule_GET | public ArrayList<Long> ip_game_ipOnGame_rule_GET(String ip, String ipOnGame) throws IOException {
"""
IDs of rules configured for this IP
REST: GET /ip/{ip}/game/{ipOnGame}/rule
@param ip [required]
@param ipOnGame [required]
"""
String qPath = "/ip/{ip}/game/{ipOnGame}/rule";
StringBuilder sb = path(... | java | public ArrayList<Long> ip_game_ipOnGame_rule_GET(String ip, String ipOnGame) throws IOException {
String qPath = "/ip/{ip}/game/{ipOnGame}/rule";
StringBuilder sb = path(qPath, ip, ipOnGame);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t1);
} | [
"public",
"ArrayList",
"<",
"Long",
">",
"ip_game_ipOnGame_rule_GET",
"(",
"String",
"ip",
",",
"String",
"ipOnGame",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/game/{ipOnGame}/rule\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPa... | IDs of rules configured for this IP
REST: GET /ip/{ip}/game/{ipOnGame}/rule
@param ip [required]
@param ipOnGame [required] | [
"IDs",
"of",
"rules",
"configured",
"for",
"this",
"IP"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L358-L363 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/ComparatorCompat.java | ComparatorCompat.nullsLast | @NotNull
public static <T> ComparatorCompat<T> nullsLast(@Nullable Comparator<? super T> comparator) {
"""
Returns a comparator that considers {@code null} to be greater than non-null.
If the specified comparator is {@code null}, then the returned
comparator considers all non-null values to be equal.
@par... | java | @NotNull
public static <T> ComparatorCompat<T> nullsLast(@Nullable Comparator<? super T> comparator) {
return nullsComparator(false, comparator);
} | [
"@",
"NotNull",
"public",
"static",
"<",
"T",
">",
"ComparatorCompat",
"<",
"T",
">",
"nullsLast",
"(",
"@",
"Nullable",
"Comparator",
"<",
"?",
"super",
"T",
">",
"comparator",
")",
"{",
"return",
"nullsComparator",
"(",
"false",
",",
"comparator",
")",
... | Returns a comparator that considers {@code null} to be greater than non-null.
If the specified comparator is {@code null}, then the returned
comparator considers all non-null values to be equal.
@param <T> the type of the objects compared by the comparator
@param comparator a comparator for comparing non-null values
... | [
"Returns",
"a",
"comparator",
"that",
"considers",
"{",
"@code",
"null",
"}",
"to",
"be",
"greater",
"than",
"non",
"-",
"null",
".",
"If",
"the",
"specified",
"comparator",
"is",
"{",
"@code",
"null",
"}",
"then",
"the",
"returned",
"comparator",
"conside... | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/ComparatorCompat.java#L272-L275 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata/model/volatilities/AbstractVolatilitySurfaceParametric.java | AbstractVolatilitySurfaceParametric.getCloneCalibrated | public AbstractVolatilitySurfaceParametric getCloneCalibrated(final AnalyticModel calibrationModel, final Vector<AnalyticProduct> calibrationProducts, final List<Double> calibrationTargetValues, Map<String,Object> calibrationParameters, final ParameterTransformation parameterTransformation, OptimizerFactory optimizerFa... | java | public AbstractVolatilitySurfaceParametric getCloneCalibrated(final AnalyticModel calibrationModel, final Vector<AnalyticProduct> calibrationProducts, final List<Double> calibrationTargetValues, Map<String,Object> calibrationParameters, final ParameterTransformation parameterTransformation, OptimizerFactory optimizerFa... | [
"public",
"AbstractVolatilitySurfaceParametric",
"getCloneCalibrated",
"(",
"final",
"AnalyticModel",
"calibrationModel",
",",
"final",
"Vector",
"<",
"AnalyticProduct",
">",
"calibrationProducts",
",",
"final",
"List",
"<",
"Double",
">",
"calibrationTargetValues",
",",
... | Create a clone of this volatility surface using a generic calibration
of its parameters to given market data.
@param calibrationModel The model used during calibration (contains additional objects required during valuation, e.g. curves).
@param calibrationProducts The calibration products.
@param calibrationTargetValu... | [
"Create",
"a",
"clone",
"of",
"this",
"volatility",
"surface",
"using",
"a",
"generic",
"calibration",
"of",
"its",
"parameters",
"to",
"given",
"market",
"data",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/volatilities/AbstractVolatilitySurfaceParametric.java#L81-L110 |
pressgang-ccms/PressGangCCMSDatasourceProviders | rest-provider/src/main/java/org/jboss/pressgang/ccms/provider/RESTPropertyTagProvider.java | RESTPropertyTagProvider.getRESTPropertyTagRevisions | public RESTPropertyTagCollectionV1 getRESTPropertyTagRevisions(int id, Integer revision) {
"""
/*@Override
public UpdateableCollectionWrapper<PropertyCategoryWrapper> getPropertyTagCategories(int id, final Integer revision) {
try {
RESTPropertyTagV1 propertyTag = null;
Check the cache first
if (getRESTEntityC... | java | public RESTPropertyTagCollectionV1 getRESTPropertyTagRevisions(int id, Integer revision) {
try {
RESTPropertyTagV1 propertyTag = null;
if (getRESTEntityCache().containsKeyValue(RESTPropertyTagV1.class, id, revision)) {
propertyTag = getRESTEntityCache().get(RESTPropertyTa... | [
"public",
"RESTPropertyTagCollectionV1",
"getRESTPropertyTagRevisions",
"(",
"int",
"id",
",",
"Integer",
"revision",
")",
"{",
"try",
"{",
"RESTPropertyTagV1",
"propertyTag",
"=",
"null",
";",
"if",
"(",
"getRESTEntityCache",
"(",
")",
".",
"containsKeyValue",
"(",... | /*@Override
public UpdateableCollectionWrapper<PropertyCategoryWrapper> getPropertyTagCategories(int id, final Integer revision) {
try {
RESTPropertyTagV1 propertyTag = null;
Check the cache first
if (getRESTEntityCache().containsKeyValue(RESTPropertyTagV1.class, id, revision)) {
propertyTag = getRESTEntityCache().get(... | [
"/",
"*",
"@Override",
"public",
"UpdateableCollectionWrapper<PropertyCategoryWrapper",
">",
"getPropertyTagCategories",
"(",
"int",
"id",
"final",
"Integer",
"revision",
")",
"{",
"try",
"{",
"RESTPropertyTagV1",
"propertyTag",
"=",
"null",
";",
"Check",
"the",
"cach... | train | https://github.com/pressgang-ccms/PressGangCCMSDatasourceProviders/blob/e47588adad0dcd55608b197b37825a512bc8fd25/rest-provider/src/main/java/org/jboss/pressgang/ccms/provider/RESTPropertyTagProvider.java#L135-L164 |
konmik/solid | collections/src/main/java/solid/collectors/ToSolidMap.java | ToSolidMap.toSolidMap | public static <T, K> Func1<Iterable<T>, SolidMap<K, T>> toSolidMap(final Func1<T, K> keyExtractor) {
"""
Returns a function that converts a stream into {@link SolidMap} using a given key extractor method.
"""
return toSolidMap(keyExtractor, new Func1<T, T>() {
@Override
public T... | java | public static <T, K> Func1<Iterable<T>, SolidMap<K, T>> toSolidMap(final Func1<T, K> keyExtractor) {
return toSolidMap(keyExtractor, new Func1<T, T>() {
@Override
public T call(T value) {
return value;
}
});
} | [
"public",
"static",
"<",
"T",
",",
"K",
">",
"Func1",
"<",
"Iterable",
"<",
"T",
">",
",",
"SolidMap",
"<",
"K",
",",
"T",
">",
">",
"toSolidMap",
"(",
"final",
"Func1",
"<",
"T",
",",
"K",
">",
"keyExtractor",
")",
"{",
"return",
"toSolidMap",
"... | Returns a function that converts a stream into {@link SolidMap} using a given key extractor method. | [
"Returns",
"a",
"function",
"that",
"converts",
"a",
"stream",
"into",
"{"
] | train | https://github.com/konmik/solid/blob/3d6c452ef3219fd843547f3590b3d2e1ad3f1d17/collections/src/main/java/solid/collectors/ToSolidMap.java#L34-L41 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ExperimentsInner.java | ExperimentsInner.getAsync | public Observable<ExperimentInner> getAsync(String resourceGroupName, String workspaceName, String experimentName) {
"""
Gets information about an Experiment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can o... | java | public Observable<ExperimentInner> getAsync(String resourceGroupName, String workspaceName, String experimentName) {
return getWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName).map(new Func1<ServiceResponse<ExperimentInner>, ExperimentInner>() {
@Override
public ... | [
"public",
"Observable",
"<",
"ExperimentInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workspaceName",
",",
"String",
"experimentName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workspaceName",
",",
... | Gets information about an Experiment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 c... | [
"Gets",
"information",
"about",
"an",
"Experiment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ExperimentsInner.java#L722-L729 |
icode/ameba-utils | src/main/java/ameba/util/IOUtils.java | IOUtils.getJarManifestValue | public static String getJarManifestValue(Class clazz, String attrName) {
"""
<p>getJarManifestValue.</p>
@param clazz a {@link java.lang.Class} object.
@param attrName a {@link java.lang.String} object.
@return a {@link java.lang.String} object.
"""
URL url = getResource("/" + clazz.getName().r... | java | public static String getJarManifestValue(Class clazz, String attrName) {
URL url = getResource("/" + clazz.getName().replace('.', '/')
+ ".class");
if (url != null)
try {
URLConnection uc = url.openConnection();
if (uc instanceof java.net.JarUR... | [
"public",
"static",
"String",
"getJarManifestValue",
"(",
"Class",
"clazz",
",",
"String",
"attrName",
")",
"{",
"URL",
"url",
"=",
"getResource",
"(",
"\"/\"",
"+",
"clazz",
".",
"getName",
"(",
")",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
... | <p>getJarManifestValue.</p>
@param clazz a {@link java.lang.Class} object.
@param attrName a {@link java.lang.String} object.
@return a {@link java.lang.String} object. | [
"<p",
">",
"getJarManifestValue",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba-utils/blob/1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35/src/main/java/ameba/util/IOUtils.java#L325-L340 |
apache/incubator-zipkin | zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/internal/JsonReaders.java | JsonReaders.enterPath | @Nullable
public static JsonReader enterPath(JsonReader reader, String path1, String path2)
throws IOException {
"""
This saves you from having to define nested types to read a single value
<p>Instead of defining two types like this, and double-checking null..
<pre>{@code
class Response {
Message m... | java | @Nullable
public static JsonReader enterPath(JsonReader reader, String path1, String path2)
throws IOException {
return enterPath(reader, path1) != null ? enterPath(reader, path2) : null;
} | [
"@",
"Nullable",
"public",
"static",
"JsonReader",
"enterPath",
"(",
"JsonReader",
"reader",
",",
"String",
"path1",
",",
"String",
"path2",
")",
"throws",
"IOException",
"{",
"return",
"enterPath",
"(",
"reader",
",",
"path1",
")",
"!=",
"null",
"?",
"enter... | This saves you from having to define nested types to read a single value
<p>Instead of defining two types like this, and double-checking null..
<pre>{@code
class Response {
Message message;
}
class Message {
String status;
}
JsonAdapter<Response> adapter = moshi.adapter(Response.class);
Message message = adapter.from... | [
"This",
"saves",
"you",
"from",
"having",
"to",
"define",
"nested",
"types",
"to",
"read",
"a",
"single",
"value"
] | train | https://github.com/apache/incubator-zipkin/blob/89b2fab983fc626b3be32ce9d7cf64b3f01f1a87/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/internal/JsonReaders.java#L54-L58 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/KafkaSpec.java | KafkaSpec.sendAMessage | @When("^I send a message '(.+?)' to the kafka topic named '(.+?)'")
public void sendAMessage(String message, String topic_name) throws Exception {
"""
Sending a message in a Kafka topic.
@param topic_name topic name
@param message string that you send to topic
"""
commonspec.getKafkaUtils().... | java | @When("^I send a message '(.+?)' to the kafka topic named '(.+?)'")
public void sendAMessage(String message, String topic_name) throws Exception {
commonspec.getKafkaUtils().sendMessage(message, topic_name);
} | [
"@",
"When",
"(",
"\"^I send a message '(.+?)' to the kafka topic named '(.+?)'\"",
")",
"public",
"void",
"sendAMessage",
"(",
"String",
"message",
",",
"String",
"topic_name",
")",
"throws",
"Exception",
"{",
"commonspec",
".",
"getKafkaUtils",
"(",
")",
".",
"sendM... | Sending a message in a Kafka topic.
@param topic_name topic name
@param message string that you send to topic | [
"Sending",
"a",
"message",
"in",
"a",
"Kafka",
"topic",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/KafkaSpec.java#L108-L111 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cdn_webstorage_serviceName_traffic_GET | public OvhOrder cdn_webstorage_serviceName_traffic_GET(String serviceName, OvhOrderTrafficEnum bandwidth) throws IOException {
"""
Get prices and contracts information
REST: GET /order/cdn/webstorage/{serviceName}/traffic
@param bandwidth [required] Traffic in TB that will be added to the cdn.webstorage servic... | java | public OvhOrder cdn_webstorage_serviceName_traffic_GET(String serviceName, OvhOrderTrafficEnum bandwidth) throws IOException {
String qPath = "/order/cdn/webstorage/{serviceName}/traffic";
StringBuilder sb = path(qPath, serviceName);
query(sb, "bandwidth", bandwidth);
String resp = exec(qPath, "GET", sb.toStrin... | [
"public",
"OvhOrder",
"cdn_webstorage_serviceName_traffic_GET",
"(",
"String",
"serviceName",
",",
"OvhOrderTrafficEnum",
"bandwidth",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cdn/webstorage/{serviceName}/traffic\"",
";",
"StringBuilder",
"sb",
"="... | Get prices and contracts information
REST: GET /order/cdn/webstorage/{serviceName}/traffic
@param bandwidth [required] Traffic in TB that will be added to the cdn.webstorage service
@param serviceName [required] The internal name of your CDN Static offer | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5435-L5441 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.security/src/com/ibm/ws/security/filemonitor/SecurityFileMonitor.java | SecurityFileMonitor.isActionNeeded | private Boolean isActionNeeded(Collection<File> createdFiles, Collection<File> modifiedFiles) {
"""
Action is needed if a file is modified or if it is recreated after it was deleted.
@param modifiedFiles
"""
boolean actionNeeded = false;
for (File createdFile : createdFiles) {
i... | java | private Boolean isActionNeeded(Collection<File> createdFiles, Collection<File> modifiedFiles) {
boolean actionNeeded = false;
for (File createdFile : createdFiles) {
if (currentlyDeletedFiles.contains(createdFile)) {
currentlyDeletedFiles.remove(createdFile);
... | [
"private",
"Boolean",
"isActionNeeded",
"(",
"Collection",
"<",
"File",
">",
"createdFiles",
",",
"Collection",
"<",
"File",
">",
"modifiedFiles",
")",
"{",
"boolean",
"actionNeeded",
"=",
"false",
";",
"for",
"(",
"File",
"createdFile",
":",
"createdFiles",
"... | Action is needed if a file is modified or if it is recreated after it was deleted.
@param modifiedFiles | [
"Action",
"is",
"needed",
"if",
"a",
"file",
"is",
"modified",
"or",
"if",
"it",
"is",
"recreated",
"after",
"it",
"was",
"deleted",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.security/src/com/ibm/ws/security/filemonitor/SecurityFileMonitor.java#L121-L135 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/TextEnterer.java | TextEnterer.typeText | public void typeText(final EditText editText, final String text) {
"""
Types text in an {@code EditText}
@param index the index of the {@code EditText}
@param text the text that should be typed
"""
if(editText != null){
inst.runOnMainSync(new Runnable()
{
public void run()
{
editText.s... | java | public void typeText(final EditText editText, final String text){
if(editText != null){
inst.runOnMainSync(new Runnable()
{
public void run()
{
editText.setInputType(InputType.TYPE_NULL);
}
});
clicker.clickOnScreen(editText, false, 0);
dialogUtils.hideSoftKeyboard(editText, true, true... | [
"public",
"void",
"typeText",
"(",
"final",
"EditText",
"editText",
",",
"final",
"String",
"text",
")",
"{",
"if",
"(",
"editText",
"!=",
"null",
")",
"{",
"inst",
".",
"runOnMainSync",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"... | Types text in an {@code EditText}
@param index the index of the {@code EditText}
@param text the text that should be typed | [
"Types",
"text",
"in",
"an",
"{",
"@code",
"EditText",
"}"
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/TextEnterer.java#L73-L102 |
liuyukuai/commons | commons-core/src/main/java/com/itxiaoer/commons/core/beans/ProcessUtils.java | ProcessUtils.processObject | public static <T, R> void processObject(R r, T src) {
"""
拷贝单个对象
@param r 目标对象
@param src 原对象
@param <T> 原数据类型
@param <R> 目标数据类型
"""
processObject(r, src, (r1, src1) -> {
});
} | java | public static <T, R> void processObject(R r, T src) {
processObject(r, src, (r1, src1) -> {
});
} | [
"public",
"static",
"<",
"T",
",",
"R",
">",
"void",
"processObject",
"(",
"R",
"r",
",",
"T",
"src",
")",
"{",
"processObject",
"(",
"r",
",",
"src",
",",
"(",
"r1",
",",
"src1",
")",
"->",
"{",
"}",
")",
";",
"}"
] | 拷贝单个对象
@param r 目标对象
@param src 原对象
@param <T> 原数据类型
@param <R> 目标数据类型 | [
"拷贝单个对象"
] | train | https://github.com/liuyukuai/commons/blob/ba67eddb542446b12f419f1866dbaa82e47fbf35/commons-core/src/main/java/com/itxiaoer/commons/core/beans/ProcessUtils.java#L115-L118 |
ziccardi/jnrpe | jcheck_nrpe/src/main/java/it/jnrpe/client/JNRPEClient.java | JNRPEClient.sendCommand | public final ReturnValue sendCommand(final String sCommandName, final String... arguments) throws JNRPEClientException {
"""
Inovoke a command installed in JNRPE.
@param sCommandName
The name of the command to be invoked
@param arguments
The arguments to pass to the command (will substitute the
$ARGSx$ para... | java | public final ReturnValue sendCommand(final String sCommandName, final String... arguments) throws JNRPEClientException {
return sendRequest(new JNRPERequest(sCommandName, arguments));
} | [
"public",
"final",
"ReturnValue",
"sendCommand",
"(",
"final",
"String",
"sCommandName",
",",
"final",
"String",
"...",
"arguments",
")",
"throws",
"JNRPEClientException",
"{",
"return",
"sendRequest",
"(",
"new",
"JNRPERequest",
"(",
"sCommandName",
",",
"arguments... | Inovoke a command installed in JNRPE.
@param sCommandName
The name of the command to be invoked
@param arguments
The arguments to pass to the command (will substitute the
$ARGSx$ parameters)
@return The value returned by the server
@throws JNRPEClientException
Thrown on any communication error. | [
"Inovoke",
"a",
"command",
"installed",
"in",
"JNRPE",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jcheck_nrpe/src/main/java/it/jnrpe/client/JNRPEClient.java#L226-L228 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java | ServiceBuilder.withDataLogFactory | public ServiceBuilder withDataLogFactory(Function<ComponentSetup, DurableDataLogFactory> dataLogFactoryCreator) {
"""
Attaches the given DurableDataLogFactory creator to this ServiceBuilder. The given Function will only not be invoked
right away; it will be called when needed.
@param dataLogFactoryCreator The ... | java | public ServiceBuilder withDataLogFactory(Function<ComponentSetup, DurableDataLogFactory> dataLogFactoryCreator) {
Preconditions.checkNotNull(dataLogFactoryCreator, "dataLogFactoryCreator");
this.dataLogFactoryCreator = dataLogFactoryCreator;
return this;
} | [
"public",
"ServiceBuilder",
"withDataLogFactory",
"(",
"Function",
"<",
"ComponentSetup",
",",
"DurableDataLogFactory",
">",
"dataLogFactoryCreator",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"dataLogFactoryCreator",
",",
"\"dataLogFactoryCreator\"",
")",
";",
... | Attaches the given DurableDataLogFactory creator to this ServiceBuilder. The given Function will only not be invoked
right away; it will be called when needed.
@param dataLogFactoryCreator The Function to attach.
@return This ServiceBuilder. | [
"Attaches",
"the",
"given",
"DurableDataLogFactory",
"creator",
"to",
"this",
"ServiceBuilder",
".",
"The",
"given",
"Function",
"will",
"only",
"not",
"be",
"invoked",
"right",
"away",
";",
"it",
"will",
"be",
"called",
"when",
"needed",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java#L170-L174 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.getDisplayScript | public static String getDisplayScript(String localeID, String displayLocaleID) {
"""
<strong>[icu]</strong> Returns a locale's script localized for display in the provided locale.
This is a cover for the ICU4C API.
@param localeID the id of the locale whose script will be displayed
@param displayLocaleID the id... | java | public static String getDisplayScript(String localeID, String displayLocaleID) {
return getDisplayScriptInternal(new ULocale(localeID), new ULocale(displayLocaleID));
} | [
"public",
"static",
"String",
"getDisplayScript",
"(",
"String",
"localeID",
",",
"String",
"displayLocaleID",
")",
"{",
"return",
"getDisplayScriptInternal",
"(",
"new",
"ULocale",
"(",
"localeID",
")",
",",
"new",
"ULocale",
"(",
"displayLocaleID",
")",
")",
"... | <strong>[icu]</strong> Returns a locale's script localized for display in the provided locale.
This is a cover for the ICU4C API.
@param localeID the id of the locale whose script will be displayed
@param displayLocaleID the id of the locale in which to display the name.
@return the localized script name. | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Returns",
"a",
"locale",
"s",
"script",
"localized",
"for",
"display",
"in",
"the",
"provided",
"locale",
".",
"This",
"is",
"a",
"cover",
"for",
"the",
"ICU4C",
"API",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1510-L1512 |
hexagonframework/spring-data-ebean | src/main/java/org/springframework/data/ebean/repository/query/StringQuery.java | StringQuery.getBindingFor | public ParameterBinding getBindingFor(int position) {
"""
Returns the {@link ParameterBinding} for the given position.
@param position
@return
"""
for (ParameterBinding binding : bindings) {
if (binding.hasPosition(position)) {
return binding;
}
... | java | public ParameterBinding getBindingFor(int position) {
for (ParameterBinding binding : bindings) {
if (binding.hasPosition(position)) {
return binding;
}
}
throw new IllegalArgumentException(String.format("No parameter binding found for position %... | [
"public",
"ParameterBinding",
"getBindingFor",
"(",
"int",
"position",
")",
"{",
"for",
"(",
"ParameterBinding",
"binding",
":",
"bindings",
")",
"{",
"if",
"(",
"binding",
".",
"hasPosition",
"(",
"position",
")",
")",
"{",
"return",
"binding",
";",
"}",
... | Returns the {@link ParameterBinding} for the given position.
@param position
@return | [
"Returns",
"the",
"{",
"@link",
"ParameterBinding",
"}",
"for",
"the",
"given",
"position",
"."
] | train | https://github.com/hexagonframework/spring-data-ebean/blob/dd11b97654982403b50dd1d5369cadad71fce410/src/main/java/org/springframework/data/ebean/repository/query/StringQuery.java#L114-L123 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.Canberra | public static double Canberra(IntPoint p, IntPoint q) {
"""
Gets the Canberra distance between two points.
@param p IntPoint with X and Y axis coordinates.
@param q IntPoint with X and Y axis coordinates.
@return The Canberra distance between x and y.
"""
return Canberra(p.x, p.y, q.x, q.y);
} | java | public static double Canberra(IntPoint p, IntPoint q) {
return Canberra(p.x, p.y, q.x, q.y);
} | [
"public",
"static",
"double",
"Canberra",
"(",
"IntPoint",
"p",
",",
"IntPoint",
"q",
")",
"{",
"return",
"Canberra",
"(",
"p",
".",
"x",
",",
"p",
".",
"y",
",",
"q",
".",
"x",
",",
"q",
".",
"y",
")",
";",
"}"
] | Gets the Canberra distance between two points.
@param p IntPoint with X and Y axis coordinates.
@param q IntPoint with X and Y axis coordinates.
@return The Canberra distance between x and y. | [
"Gets",
"the",
"Canberra",
"distance",
"between",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L167-L169 |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EDBModelObject.java | EDBModelObject.getCorrespondingModel | public OpenEngSBModel getCorrespondingModel() throws EKBException {
"""
Returns the corresponding model object for the EDBModelObject
"""
ModelDescription description = getModelDescription();
try {
Class<?> modelClass = modelRegistry.loadModel(description);
return (OpenE... | java | public OpenEngSBModel getCorrespondingModel() throws EKBException {
ModelDescription description = getModelDescription();
try {
Class<?> modelClass = modelRegistry.loadModel(description);
return (OpenEngSBModel) edbConverter.convertEDBObjectToModel(modelClass, object);
} ... | [
"public",
"OpenEngSBModel",
"getCorrespondingModel",
"(",
")",
"throws",
"EKBException",
"{",
"ModelDescription",
"description",
"=",
"getModelDescription",
"(",
")",
";",
"try",
"{",
"Class",
"<",
"?",
">",
"modelClass",
"=",
"modelRegistry",
".",
"loadModel",
"(... | Returns the corresponding model object for the EDBModelObject | [
"Returns",
"the",
"corresponding",
"model",
"object",
"for",
"the",
"EDBModelObject"
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EDBModelObject.java#L55-L63 |
apache/groovy | subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java | Sql.executeUpdate | public int executeUpdate(Map params, String sql) throws SQLException {
"""
A variant of {@link #executeUpdate(String, java.util.List)}
useful when providing the named parameters as named arguments.
@param params a map containing the named parameters
@param sql the SQL statement
@return the number of rows ... | java | public int executeUpdate(Map params, String sql) throws SQLException {
return executeUpdate(sql, singletonList(params));
} | [
"public",
"int",
"executeUpdate",
"(",
"Map",
"params",
",",
"String",
"sql",
")",
"throws",
"SQLException",
"{",
"return",
"executeUpdate",
"(",
"sql",
",",
"singletonList",
"(",
"params",
")",
")",
";",
"}"
] | A variant of {@link #executeUpdate(String, java.util.List)}
useful when providing the named parameters as named arguments.
@param params a map containing the named parameters
@param sql the SQL statement
@return the number of rows updated or 0 for SQL statements that return nothing
@throws SQLException if a databas... | [
"A",
"variant",
"of",
"{",
"@link",
"#executeUpdate",
"(",
"String",
"java",
".",
"util",
".",
"List",
")",
"}",
"useful",
"when",
"providing",
"the",
"named",
"parameters",
"as",
"named",
"arguments",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L2944-L2946 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/ResourceUtils.java | ResourceUtils.getReader | public static Reader getReader(final URL url, String encoding) throws IOException {
"""
Returns a Reader for reading the specified url.
@param url the url
@param encoding the encoding
@return the reader instance
@throws IOException if an error occurred when reading resources using any I/O operations
"""
... | java | public static Reader getReader(final URL url, String encoding) throws IOException {
InputStream stream;
try {
stream = AccessController.doPrivileged(
new PrivilegedExceptionAction<InputStream>() {
@Override
public InputStrea... | [
"public",
"static",
"Reader",
"getReader",
"(",
"final",
"URL",
"url",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"InputStream",
"stream",
";",
"try",
"{",
"stream",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedExceptio... | Returns a Reader for reading the specified url.
@param url the url
@param encoding the encoding
@return the reader instance
@throws IOException if an error occurred when reading resources using any I/O operations | [
"Returns",
"a",
"Reader",
"for",
"reading",
"the",
"specified",
"url",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/ResourceUtils.java#L326-L357 |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/FacebookBatcher.java | FacebookBatcher.getAppAccessToken | public static String getAppAccessToken(String clientId, String clientSecret) {
"""
Get the app access token from Facebook.
see https://developers.facebook.com/docs/authentication/
"""
return getAccessToken(clientId, clientSecret, null, null);
} | java | public static String getAppAccessToken(String clientId, String clientSecret) {
return getAccessToken(clientId, clientSecret, null, null);
} | [
"public",
"static",
"String",
"getAppAccessToken",
"(",
"String",
"clientId",
",",
"String",
"clientSecret",
")",
"{",
"return",
"getAccessToken",
"(",
"clientId",
",",
"clientSecret",
",",
"null",
",",
"null",
")",
";",
"}"
] | Get the app access token from Facebook.
see https://developers.facebook.com/docs/authentication/ | [
"Get",
"the",
"app",
"access",
"token",
"from",
"Facebook",
"."
] | train | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/FacebookBatcher.java#L69-L71 |
elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/scaling/LinearScaling.java | LinearScaling.fromMinMax | public static LinearScaling fromMinMax(double min, double max) {
"""
Make a linear scaling from a given minimum and maximum. The minimum will be
mapped to zero, the maximum to one.
@param min Minimum
@param max Maximum
@return New linear scaling.
"""
double zoom = 1.0 / (max - min);
return new Li... | java | public static LinearScaling fromMinMax(double min, double max) {
double zoom = 1.0 / (max - min);
return new LinearScaling(zoom, -min * zoom);
} | [
"public",
"static",
"LinearScaling",
"fromMinMax",
"(",
"double",
"min",
",",
"double",
"max",
")",
"{",
"double",
"zoom",
"=",
"1.0",
"/",
"(",
"max",
"-",
"min",
")",
";",
"return",
"new",
"LinearScaling",
"(",
"zoom",
",",
"-",
"min",
"*",
"zoom",
... | Make a linear scaling from a given minimum and maximum. The minimum will be
mapped to zero, the maximum to one.
@param min Minimum
@param max Maximum
@return New linear scaling. | [
"Make",
"a",
"linear",
"scaling",
"from",
"a",
"given",
"minimum",
"and",
"maximum",
".",
"The",
"minimum",
"will",
"be",
"mapped",
"to",
"zero",
"the",
"maximum",
"to",
"one",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/scaling/LinearScaling.java#L102-L105 |
apache/flink | flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCInputFormat.java | JDBCInputFormat.nextRecord | @Override
public Row nextRecord(Row row) throws IOException {
"""
Stores the next resultSet row in a tuple.
@param row row to be reused.
@return row containing next {@link Row}
@throws java.io.IOException
"""
try {
if (!hasNext) {
return null;
}
for (int pos = 0; pos < row.getArity(); pos+... | java | @Override
public Row nextRecord(Row row) throws IOException {
try {
if (!hasNext) {
return null;
}
for (int pos = 0; pos < row.getArity(); pos++) {
row.setField(pos, resultSet.getObject(pos + 1));
}
//update hasNext after we've read the record
hasNext = resultSet.next();
return row;
} ... | [
"@",
"Override",
"public",
"Row",
"nextRecord",
"(",
"Row",
"row",
")",
"throws",
"IOException",
"{",
"try",
"{",
"if",
"(",
"!",
"hasNext",
")",
"{",
"return",
"null",
";",
"}",
"for",
"(",
"int",
"pos",
"=",
"0",
";",
"pos",
"<",
"row",
".",
"g... | Stores the next resultSet row in a tuple.
@param row row to be reused.
@return row containing next {@link Row}
@throws java.io.IOException | [
"Stores",
"the",
"next",
"resultSet",
"row",
"in",
"a",
"tuple",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCInputFormat.java#L289-L306 |
skuzzle/jeve | jeve/src/main/java/de/skuzzle/jeve/providers/EventStackImpl.java | EventStackImpl.popEvent | public <L extends Listener> void popEvent(Event<?, L> expected) {
"""
Pops the top event off the current event stack. This action has to be
performed immediately after the event has been dispatched to all
listeners.
@param <L> Type of the listener.
@param expected The Event which is expected at the top of th... | java | public <L extends Listener> void popEvent(Event<?, L> expected) {
synchronized (this.stack) {
final Event<?, ?> actual = this.stack.pop();
if (actual != expected) {
throw new IllegalStateException(String.format(
"Unbalanced pop: expected '%s' but e... | [
"public",
"<",
"L",
"extends",
"Listener",
">",
"void",
"popEvent",
"(",
"Event",
"<",
"?",
",",
"L",
">",
"expected",
")",
"{",
"synchronized",
"(",
"this",
".",
"stack",
")",
"{",
"final",
"Event",
"<",
"?",
",",
"?",
">",
"actual",
"=",
"this",
... | Pops the top event off the current event stack. This action has to be
performed immediately after the event has been dispatched to all
listeners.
@param <L> Type of the listener.
@param expected The Event which is expected at the top of the stack.
@see #pushEvent(Event) | [
"Pops",
"the",
"top",
"event",
"off",
"the",
"current",
"event",
"stack",
".",
"This",
"action",
"has",
"to",
"be",
"performed",
"immediately",
"after",
"the",
"event",
"has",
"been",
"dispatched",
"to",
"all",
"listeners",
"."
] | train | https://github.com/skuzzle/jeve/blob/42cc18947c9c8596c34410336e4e375e9fcd7c47/jeve/src/main/java/de/skuzzle/jeve/providers/EventStackImpl.java#L114-L123 |
sporniket/core | sporniket-core-io/src/main/java/com/sporniket/libre/io/FileTools.java | FileTools.createReaderForInputStream | public static Reader createReaderForInputStream(InputStream source, Encoding encoding)
throws FileNotFoundException, UnsupportedEncodingException {
"""
Instanciate a Reader for a InputStream using the given encoding.
@param source
source stream.
@param encoding
can be <code>null</code>
@return the reader... | java | public static Reader createReaderForInputStream(InputStream source, Encoding encoding)
throws FileNotFoundException, UnsupportedEncodingException
{
return (null == encoding) ? new InputStreamReader(source) : new InputStreamReader(source, encoding.getSunOldIoName());
} | [
"public",
"static",
"Reader",
"createReaderForInputStream",
"(",
"InputStream",
"source",
",",
"Encoding",
"encoding",
")",
"throws",
"FileNotFoundException",
",",
"UnsupportedEncodingException",
"{",
"return",
"(",
"null",
"==",
"encoding",
")",
"?",
"new",
"InputStr... | Instanciate a Reader for a InputStream using the given encoding.
@param source
source stream.
@param encoding
can be <code>null</code>
@return the reader.
@throws FileNotFoundException
if there is a problem to deal with.
@throws UnsupportedEncodingException
if there is a problem to deal with.
@since 12.06.01 | [
"Instanciate",
"a",
"Reader",
"for",
"a",
"InputStream",
"using",
"the",
"given",
"encoding",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-io/src/main/java/com/sporniket/libre/io/FileTools.java#L171-L175 |
lawloretienne/ImageGallery | library/src/main/java/com/etiennelawlor/imagegallery/library/ui/TouchImageView.java | TouchImageView.setZoom | public void setZoom(float scale, float focusX, float focusY, ScaleType scaleType) {
"""
Set zoom to the specified scale. Image will be centered around the point
(focusX, focusY). These floats range from 0 to 1 and denote the focus point
as a fraction from the left and top of the view. For example, the top left
... | java | public void setZoom(float scale, float focusX, float focusY, ScaleType scaleType) {
//
// setZoom can be called before the image is on the screen, but at this point,
// image and view sizes have not yet been calculated in onMeasure. Thus, we should
// delay calling setZoom until the view... | [
"public",
"void",
"setZoom",
"(",
"float",
"scale",
",",
"float",
"focusX",
",",
"float",
"focusY",
",",
"ScaleType",
"scaleType",
")",
"{",
"//",
"// setZoom can be called before the image is on the screen, but at this point,",
"// image and view sizes have not yet been calcul... | Set zoom to the specified scale. Image will be centered around the point
(focusX, focusY). These floats range from 0 to 1 and denote the focus point
as a fraction from the left and top of the view. For example, the top left
corner of the image would be (0, 0). And the bottom right corner would be (1, 1).
@param scale
... | [
"Set",
"zoom",
"to",
"the",
"specified",
"scale",
".",
"Image",
"will",
"be",
"centered",
"around",
"the",
"point",
"(",
"focusX",
"focusY",
")",
".",
"These",
"floats",
"range",
"from",
"0",
"to",
"1",
"and",
"denote",
"the",
"focus",
"point",
"as",
"... | train | https://github.com/lawloretienne/ImageGallery/blob/960d68dfb2b81d05322a576723ac4f090e10eda7/library/src/main/java/com/etiennelawlor/imagegallery/library/ui/TouchImageView.java#L389-L411 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java | DateUtil.getEndValue | public static int getEndValue(Calendar calendar, int dateField) {
"""
获取指定日期字段的最大值,例如分钟的最小值是59
@param calendar {@link Calendar}
@param dateField {@link DateField}
@return 字段最大值
@since 4.5.7
@see Calendar#getActualMaximum(int)
"""
if(Calendar.DAY_OF_WEEK == dateField) {
return (calendar.getFirstDa... | java | public static int getEndValue(Calendar calendar, int dateField) {
if(Calendar.DAY_OF_WEEK == dateField) {
return (calendar.getFirstDayOfWeek() + 6) % 7;
}
return calendar.getActualMaximum(dateField);
} | [
"public",
"static",
"int",
"getEndValue",
"(",
"Calendar",
"calendar",
",",
"int",
"dateField",
")",
"{",
"if",
"(",
"Calendar",
".",
"DAY_OF_WEEK",
"==",
"dateField",
")",
"{",
"return",
"(",
"calendar",
".",
"getFirstDayOfWeek",
"(",
")",
"+",
"6",
")",
... | 获取指定日期字段的最大值,例如分钟的最小值是59
@param calendar {@link Calendar}
@param dateField {@link DateField}
@return 字段最大值
@since 4.5.7
@see Calendar#getActualMaximum(int) | [
"获取指定日期字段的最大值,例如分钟的最小值是59"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L1696-L1701 |
alkacon/opencms-core | src-setup/org/opencms/setup/db/CmsUpdateDBManager.java | CmsUpdateDBManager.getOracleTablespaces | protected void getOracleTablespaces(Map<String, String> dbPoolData) {
"""
Retrieves the oracle tablespace names.<p>
@param dbPoolData the database pool data
"""
String dataTablespace = "users";
String indexTablespace = "users";
CmsSetupDb setupDb = new CmsSetupDb(null);
try... | java | protected void getOracleTablespaces(Map<String, String> dbPoolData) {
String dataTablespace = "users";
String indexTablespace = "users";
CmsSetupDb setupDb = new CmsSetupDb(null);
try {
setupDb.setConnection(
dbPoolData.get("driver"),
dbPoolD... | [
"protected",
"void",
"getOracleTablespaces",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"dbPoolData",
")",
"{",
"String",
"dataTablespace",
"=",
"\"users\"",
";",
"String",
"indexTablespace",
"=",
"\"users\"",
";",
"CmsSetupDb",
"setupDb",
"=",
"new",
"CmsSe... | Retrieves the oracle tablespace names.<p>
@param dbPoolData the database pool data | [
"Retrieves",
"the",
"oracle",
"tablespace",
"names",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/CmsUpdateDBManager.java#L424-L472 |
baratine/baratine | web/src/main/java/com/caucho/v5/util/PeriodUtil.java | PeriodUtil.periodEnd | public static long periodEnd(long now, long period) {
"""
Calculates the next period end. The calculation is in local time.
@param now the current time in GMT ms since the epoch
@return the time of the next period in GMT ms since the epoch
"""
LocalDateTime time = LocalDateTime.ofEpochSecond(now / 1... | java | public static long periodEnd(long now, long period)
{
LocalDateTime time = LocalDateTime.ofEpochSecond(now / 1000, 0, ZoneOffset.UTC);
//QDate localCalendar = QDate.allocateLocalDate();
long endTime = periodEnd(now, period, time);
//QDate.freeLocalDate(localCalendar);
return endTime... | [
"public",
"static",
"long",
"periodEnd",
"(",
"long",
"now",
",",
"long",
"period",
")",
"{",
"LocalDateTime",
"time",
"=",
"LocalDateTime",
".",
"ofEpochSecond",
"(",
"now",
"/",
"1000",
",",
"0",
",",
"ZoneOffset",
".",
"UTC",
")",
";",
"//QDate localCal... | Calculates the next period end. The calculation is in local time.
@param now the current time in GMT ms since the epoch
@return the time of the next period in GMT ms since the epoch | [
"Calculates",
"the",
"next",
"period",
"end",
".",
"The",
"calculation",
"is",
"in",
"local",
"time",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/util/PeriodUtil.java#L218-L228 |
gosu-lang/gosu-lang | gosu-core/src/main/java/gw/internal/gosu/ir/transform/GosuClassTransformer.java | GosuClassTransformer.compileJavaInteropBridgeConstructor | private void compileJavaInteropBridgeConstructor( DynamicFunctionSymbol dfs ) {
"""
Add constructor so Java can use the Gosu generic class without explicitly passing in type arguments.
Note this constructor forwards to the given constructor with default type arguments.
"""
DynamicFunctionSymbol copy = n... | java | private void compileJavaInteropBridgeConstructor( DynamicFunctionSymbol dfs )
{
DynamicFunctionSymbol copy = new DynamicFunctionSymbol( dfs );
copy.setValue( null );
copy.setInitializer( null );
ConstructorStatement fs = new ConstructorStatement( true );
fs.setDynamicFunctionSymbol( copy );
fs... | [
"private",
"void",
"compileJavaInteropBridgeConstructor",
"(",
"DynamicFunctionSymbol",
"dfs",
")",
"{",
"DynamicFunctionSymbol",
"copy",
"=",
"new",
"DynamicFunctionSymbol",
"(",
"dfs",
")",
";",
"copy",
".",
"setValue",
"(",
"null",
")",
";",
"copy",
".",
"setIn... | Add constructor so Java can use the Gosu generic class without explicitly passing in type arguments.
Note this constructor forwards to the given constructor with default type arguments. | [
"Add",
"constructor",
"so",
"Java",
"can",
"use",
"the",
"Gosu",
"generic",
"class",
"without",
"explicitly",
"passing",
"in",
"type",
"arguments",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core/src/main/java/gw/internal/gosu/ir/transform/GosuClassTransformer.java#L565-L626 |
leancloud/java-sdk-all | core/src/main/java/cn/leancloud/AVObject.java | AVObject.hasCircleReference | public boolean hasCircleReference(Map<AVObject, Boolean> markMap) {
"""
judge operations' value include circle reference or not.
notice: internal used, pls not invoke it.
@param markMap
@return
"""
if (null == markMap) {
return false;
}
markMap.put(this, true);
boolean rst = false;... | java | public boolean hasCircleReference(Map<AVObject, Boolean> markMap) {
if (null == markMap) {
return false;
}
markMap.put(this, true);
boolean rst = false;
for (ObjectFieldOperation op: operations.values()) {
rst = rst || op.checkCircleReference(markMap);
}
return rst;
} | [
"public",
"boolean",
"hasCircleReference",
"(",
"Map",
"<",
"AVObject",
",",
"Boolean",
">",
"markMap",
")",
"{",
"if",
"(",
"null",
"==",
"markMap",
")",
"{",
"return",
"false",
";",
"}",
"markMap",
".",
"put",
"(",
"this",
",",
"true",
")",
";",
"b... | judge operations' value include circle reference or not.
notice: internal used, pls not invoke it.
@param markMap
@return | [
"judge",
"operations",
"value",
"include",
"circle",
"reference",
"or",
"not",
"."
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/core/src/main/java/cn/leancloud/AVObject.java#L621-L631 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.