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 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/ui/components/CmsResourceIcon.java | CmsResourceIcon.getIconInnerHTML | private static String getIconInnerHTML(
CmsResourceUtil resUtil,
CmsResourceState state,
boolean showLocks,
boolean showDetailIcon) {
"""
Returns the icon inner HTML.<p>
@param resUtil the resource util for the resource
@param state the resource state
@param showLocks <code>tru... | java | private static String getIconInnerHTML(
CmsResourceUtil resUtil,
CmsResourceState state,
boolean showLocks,
boolean showDetailIcon) {
Resource iconResource = resUtil.getBigIconResource();
return getIconInnerHTML(resUtil, iconResource, state, showLocks, showDetailIcon);
... | [
"private",
"static",
"String",
"getIconInnerHTML",
"(",
"CmsResourceUtil",
"resUtil",
",",
"CmsResourceState",
"state",
",",
"boolean",
"showLocks",
",",
"boolean",
"showDetailIcon",
")",
"{",
"Resource",
"iconResource",
"=",
"resUtil",
".",
"getBigIconResource",
"(",... | Returns the icon inner HTML.<p>
@param resUtil the resource util for the resource
@param state the resource state
@param showLocks <code>true</code> to show lock state overlay
@param showDetailIcon <code>true</code> to show the detail icon overlay
@return the icon inner HTML | [
"Returns",
"the",
"icon",
"inner",
"HTML",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsResourceIcon.java#L302-L311 |
emilsjolander/sprinkles | library/src/main/java/se/emilsjolander/sprinkles/ManyQuery.java | ManyQuery.getAsync | public int getAsync(android.support.v4.app.LoaderManager lm, ResultHandler<T> handler, Class<? extends Model>... respondsToUpdatedOf) {
"""
Execute the query asynchronously
@param lm
The loader manager to use for loading the data
@param handler
The ResultHandler to notify of the query result and any update... | java | public int getAsync(android.support.v4.app.LoaderManager lm, ResultHandler<T> handler, Class<? extends Model>... respondsToUpdatedOf) {
if (Model.class.isAssignableFrom(resultClass)) {
respondsToUpdatedOf = Utils.concatArrays(respondsToUpdatedOf, new Class[]{resultClass});
}
final int load... | [
"public",
"int",
"getAsync",
"(",
"android",
".",
"support",
".",
"v4",
".",
"app",
".",
"LoaderManager",
"lm",
",",
"ResultHandler",
"<",
"T",
">",
"handler",
",",
"Class",
"<",
"?",
"extends",
"Model",
">",
"...",
"respondsToUpdatedOf",
")",
"{",
"if",... | Execute the query asynchronously
@param lm
The loader manager to use for loading the data
@param handler
The ResultHandler to notify of the query result and any updates to that result.
@param respondsToUpdatedOf
A list of models excluding the queried model that should also trigger a update to the result if they chan... | [
"Execute",
"the",
"query",
"asynchronously"
] | train | https://github.com/emilsjolander/sprinkles/blob/3a666f18ee5158db6fe3b4f4346b470481559606/library/src/main/java/se/emilsjolander/sprinkles/ManyQuery.java#L94-L101 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java | ExpressionUtils.eq | public static <D> Predicate eq(Expression<D> left, Expression<? extends D> right) {
"""
Create a {@code left == right} expression
@param <D> type of expressions
@param left lhs of expression
@param right rhs of expression
@return left == right
"""
return predicate(Ops.EQ, left, right);
} | java | public static <D> Predicate eq(Expression<D> left, Expression<? extends D> right) {
return predicate(Ops.EQ, left, right);
} | [
"public",
"static",
"<",
"D",
">",
"Predicate",
"eq",
"(",
"Expression",
"<",
"D",
">",
"left",
",",
"Expression",
"<",
"?",
"extends",
"D",
">",
"right",
")",
"{",
"return",
"predicate",
"(",
"Ops",
".",
"EQ",
",",
"left",
",",
"right",
")",
";",
... | Create a {@code left == right} expression
@param <D> type of expressions
@param left lhs of expression
@param right rhs of expression
@return left == right | [
"Create",
"a",
"{",
"@code",
"left",
"==",
"right",
"}",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java#L481-L483 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java | RedisInner.beginImportData | public void beginImportData(String resourceGroupName, String name, ImportRDBParameters parameters) {
"""
Import data into Redis cache.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters for Redis import operation.
@throws IllegalArgu... | java | public void beginImportData(String resourceGroupName, String name, ImportRDBParameters parameters) {
beginImportDataWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().body();
} | [
"public",
"void",
"beginImportData",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"ImportRDBParameters",
"parameters",
")",
"{",
"beginImportDataWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
"parameters",
")",
".",
"toBlocking... | Import data into Redis cache.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters for Redis import operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by ... | [
"Import",
"data",
"into",
"Redis",
"cache",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java#L1413-L1415 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateNotEmpty | public static <T> T validateNotEmpty(T value, String errorMsg) throws ValidateException {
"""
验证是否为非空,为空时抛出异常<br>
对于String类型判定是否为empty(null 或 "")<br>
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值,验证通过返回此值,非空值
@throws ValidateException 验证异常
"""
if (isEmpty(value)) {
throw new ValidateExcept... | java | public static <T> T validateNotEmpty(T value, String errorMsg) throws ValidateException {
if (isEmpty(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"validateNotEmpty",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"isEmpty",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"ValidateException",
"(",
"errorMsg",
")",... | 验证是否为非空,为空时抛出异常<br>
对于String类型判定是否为empty(null 或 "")<br>
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值,验证通过返回此值,非空值
@throws ValidateException 验证异常 | [
"验证是否为非空,为空时抛出异常<br",
">",
"对于String类型判定是否为empty",
"(",
"null",
"或",
")",
"<br",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L220-L225 |
sriharshachilakapati/WebGL4J | webgl4j/src/main/java/com/shc/webgl4j/client/WebGL10.java | WebGL10.glBindTexture | public static void glBindTexture(int target, int textureID) {
"""
<p>{@code glBindTexture} lets you create or use a named texture. Calling {@code glBindTexture} with target set to
{@link #GL_TEXTURE_2D}, {@link #GL_TEXTURE_CUBE_MAP}, and texture set to the name of the new texture binds the
texture name to the ta... | java | public static void glBindTexture(int target, int textureID)
{
checkContextCompatibility();
nglBindTexture(target, WebGLObjectMap.get().toTexture(textureID));
} | [
"public",
"static",
"void",
"glBindTexture",
"(",
"int",
"target",
",",
"int",
"textureID",
")",
"{",
"checkContextCompatibility",
"(",
")",
";",
"nglBindTexture",
"(",
"target",
",",
"WebGLObjectMap",
".",
"get",
"(",
")",
".",
"toTexture",
"(",
"textureID",
... | <p>{@code glBindTexture} lets you create or use a named texture. Calling {@code glBindTexture} with target set to
{@link #GL_TEXTURE_2D}, {@link #GL_TEXTURE_CUBE_MAP}, and texture set to the name of the new texture binds the
texture name to the target. When a texture is bound to a target, the previous binding for that ... | [
"<p",
">",
"{",
"@code",
"glBindTexture",
"}",
"lets",
"you",
"create",
"or",
"use",
"a",
"named",
"texture",
".",
"Calling",
"{",
"@code",
"glBindTexture",
"}",
"with",
"target",
"set",
"to",
"{",
"@link",
"#GL_TEXTURE_2D",
"}",
"{",
"@link",
"#GL_TEXTURE... | train | https://github.com/sriharshachilakapati/WebGL4J/blob/7daa425300b08b338b50cef2935289849c92d415/webgl4j/src/main/java/com/shc/webgl4j/client/WebGL10.java#L642-L646 |
cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java | ElmBaseVisitor.visitTupleElementDefinition | public T visitTupleElementDefinition(TupleElementDefinition elm, C context) {
"""
Visit a TupleElementDefinition. This method will be called for
every node in the tree that is a TupleElementDefinition.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result
... | java | public T visitTupleElementDefinition(TupleElementDefinition elm, C context) {
visitElement(elm.getType(), context);
return null;
} | [
"public",
"T",
"visitTupleElementDefinition",
"(",
"TupleElementDefinition",
"elm",
",",
"C",
"context",
")",
"{",
"visitElement",
"(",
"elm",
".",
"getType",
"(",
")",
",",
"context",
")",
";",
"return",
"null",
";",
"}"
] | Visit a TupleElementDefinition. This method will be called for
every node in the tree that is a TupleElementDefinition.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"a",
"TupleElementDefinition",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"TupleElementDefinition",
"."
] | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L97-L100 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/WatchQuery.java | WatchQuery.watch | @Override
public void watch(DatabaseWatch watch,
Result<Cancel> result,
Object... args) {
"""
/*
@Override
public int partitionHash(Object[] args)
{
if (_keyExpr == null) {
return -1;
}
return _keyExpr.partitionHash(args);
}
"""
TableKelp tableKelp = _t... | java | @Override
public void watch(DatabaseWatch watch,
Result<Cancel> result,
Object... args)
{
TableKelp tableKelp = _table.getTableKelp();
RowCursor minCursor = tableKelp.cursor();
RowCursor maxCursor = tableKelp.cursor();
minCursor.clear();
maxCur... | [
"@",
"Override",
"public",
"void",
"watch",
"(",
"DatabaseWatch",
"watch",
",",
"Result",
"<",
"Cancel",
">",
"result",
",",
"Object",
"...",
"args",
")",
"{",
"TableKelp",
"tableKelp",
"=",
"_table",
".",
"getTableKelp",
"(",
")",
";",
"RowCursor",
"minCu... | /*
@Override
public int partitionHash(Object[] args)
{
if (_keyExpr == null) {
return -1;
}
return _keyExpr.partitionHash(args);
} | [
"/",
"*",
"@Override",
"public",
"int",
"partitionHash",
"(",
"Object",
"[]",
"args",
")",
"{",
"if",
"(",
"_keyExpr",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}"
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/WatchQuery.java#L89-L115 |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java | Validators.validSSLContext | public static Validator validSSLContext() {
"""
Validator is used to ensure that the TrustManagerFactory Algorithm specified is valid.
@return
"""
return (s, o) -> {
if (!(o instanceof String)) {
throw new ConfigException(s, o, "Must be a string.");
}
String keyStoreType = o.toS... | java | public static Validator validSSLContext() {
return (s, o) -> {
if (!(o instanceof String)) {
throw new ConfigException(s, o, "Must be a string.");
}
String keyStoreType = o.toString();
try {
SSLContext.getInstance(keyStoreType);
} catch (NoSuchAlgorithmException e) {
... | [
"public",
"static",
"Validator",
"validSSLContext",
"(",
")",
"{",
"return",
"(",
"s",
",",
"o",
")",
"->",
"{",
"if",
"(",
"!",
"(",
"o",
"instanceof",
"String",
")",
")",
"{",
"throw",
"new",
"ConfigException",
"(",
"s",
",",
"o",
",",
"\"Must be a... | Validator is used to ensure that the TrustManagerFactory Algorithm specified is valid.
@return | [
"Validator",
"is",
"used",
"to",
"ensure",
"that",
"the",
"TrustManagerFactory",
"Algorithm",
"specified",
"is",
"valid",
"."
] | train | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java#L253-L268 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java | MapComposedElement.containsPoint | @Pure
public boolean containsPoint(Point2D<?, ?> point, int groupIndex) {
"""
Check if point p is contained in this coordinates collections.
@param point the point to compare with this coordinates
@param groupIndex into look for
@return true if p is already part of coordinates
"""
final int grpCount = ... | java | @Pure
public boolean containsPoint(Point2D<?, ?> point, int groupIndex) {
final int grpCount = getGroupCount();
if (groupIndex < 0) {
throw new IndexOutOfBoundsException(groupIndex + "<0"); //$NON-NLS-1$
}
if (groupIndex > grpCount) {
throw new IndexOutOfBoundsException(groupIndex + ">" + grpCount); //$N... | [
"@",
"Pure",
"public",
"boolean",
"containsPoint",
"(",
"Point2D",
"<",
"?",
",",
"?",
">",
"point",
",",
"int",
"groupIndex",
")",
"{",
"final",
"int",
"grpCount",
"=",
"getGroupCount",
"(",
")",
";",
"if",
"(",
"groupIndex",
"<",
"0",
")",
"{",
"th... | Check if point p is contained in this coordinates collections.
@param point the point to compare with this coordinates
@param groupIndex into look for
@return true if p is already part of coordinates | [
"Check",
"if",
"point",
"p",
"is",
"contained",
"in",
"this",
"coordinates",
"collections",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java#L295-L315 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/MbeanImplCodeGen.java | MbeanImplCodeGen.writeImport | @Override
public void writeImport(Definition def, Writer out) throws IOException {
"""
Output class import
@param def definition
@param out Writer
@throws IOException ioException
"""
out.write("package " + def.getRaPackage() + ".mbean;\n\n");
out.write("import javax.management.MBeanServer;\... | java | @Override
public void writeImport(Definition def, Writer out) throws IOException
{
out.write("package " + def.getRaPackage() + ".mbean;\n\n");
out.write("import javax.management.MBeanServer;\n");
out.write("import javax.management.ObjectName;\n");
out.write("import javax.naming.InitialCont... | [
"@",
"Override",
"public",
"void",
"writeImport",
"(",
"Definition",
"def",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"\"package \"",
"+",
"def",
".",
"getRaPackage",
"(",
")",
"+",
"\".mbean;\\n\\n\"",
")",
";",
"o... | Output class import
@param def definition
@param out Writer
@throws IOException ioException | [
"Output",
"class",
"import"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/MbeanImplCodeGen.java#L92-L102 |
alkacon/opencms-core | src/org/opencms/util/CmsFileUtil.java | CmsFileUtil.readFully | public static byte[] readFully(InputStream in, boolean closeInputStream) throws IOException {
"""
Reads all bytes from the given input stream, conditionally closes the given input stream
and returns the result in an array.<p>
@param in the input stream to read the bytes from
@return the byte content of the in... | java | public static byte[] readFully(InputStream in, boolean closeInputStream) throws IOException {
if (in instanceof ByteArrayInputStream) {
// content can be read in one pass
return readFully(in, in.available(), closeInputStream);
}
// copy buffer
byte[] xfer = new ... | [
"public",
"static",
"byte",
"[",
"]",
"readFully",
"(",
"InputStream",
"in",
",",
"boolean",
"closeInputStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"in",
"instanceof",
"ByteArrayInputStream",
")",
"{",
"// content can be read in one pass",
"return",
"read... | Reads all bytes from the given input stream, conditionally closes the given input stream
and returns the result in an array.<p>
@param in the input stream to read the bytes from
@return the byte content of the input stream
@param closeInputStream if true the given stream will be closed afterwards
@throws IOException ... | [
"Reads",
"all",
"bytes",
"from",
"the",
"given",
"input",
"stream",
"conditionally",
"closes",
"the",
"given",
"input",
"stream",
"and",
"returns",
"the",
"result",
"in",
"an",
"array",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsFileUtil.java#L657-L680 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java | Widget.findChildByNameInAllGroups | private static Widget findChildByNameInAllGroups(final String name,
List<Widget> groups) {
"""
Performs a breadth-first search of the {@link GroupWidget GroupWidgets}
in {@code groups} for a {@link Widget} with the specified
{@link Widget#getName() name}.
@... | java | private static Widget findChildByNameInAllGroups(final String name,
List<Widget> groups) {
if (groups.isEmpty()) {
return null;
}
ArrayList<Widget> groupChildren = new ArrayList<>();
Widget result;
for (Widget grou... | [
"private",
"static",
"Widget",
"findChildByNameInAllGroups",
"(",
"final",
"String",
"name",
",",
"List",
"<",
"Widget",
">",
"groups",
")",
"{",
"if",
"(",
"groups",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"ArrayList",
"<",
"Widg... | Performs a breadth-first search of the {@link GroupWidget GroupWidgets}
in {@code groups} for a {@link Widget} with the specified
{@link Widget#getName() name}.
@param name
The name of the {@code Widget} to find.
@param groups
The {@code GroupWidgets} to search.
@return The first {@code Widget} with the specified name... | [
"Performs",
"a",
"breadth",
"-",
"first",
"search",
"of",
"the",
"{",
"@link",
"GroupWidget",
"GroupWidgets",
"}",
"in",
"{",
"@code",
"groups",
"}",
"for",
"a",
"{",
"@link",
"Widget",
"}",
"with",
"the",
"specified",
"{",
"@link",
"Widget#getName",
"()",... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java#L2634-L2653 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/JobExecutionState.java | JobExecutionState.awaitForStatePredicate | public void awaitForStatePredicate(Predicate<JobExecutionState> predicate, long timeoutMs)
throws InterruptedException, TimeoutException {
"""
Waits till a predicate on {@link #getRunningState()} becomes true or timeout is reached.
@param predicate the predicate to evaluate. Note that eve... | java | public void awaitForStatePredicate(Predicate<JobExecutionState> predicate, long timeoutMs)
throws InterruptedException, TimeoutException {
Preconditions.checkArgument(timeoutMs >= 0);
if (0 == timeoutMs) {
timeoutMs = Long.MAX_VALUE;
}
long startTimeMs = System.currentTimeMillis();
l... | [
"public",
"void",
"awaitForStatePredicate",
"(",
"Predicate",
"<",
"JobExecutionState",
">",
"predicate",
",",
"long",
"timeoutMs",
")",
"throws",
"InterruptedException",
",",
"TimeoutException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"timeoutMs",
">=",
"0",... | Waits till a predicate on {@link #getRunningState()} becomes true or timeout is reached.
@param predicate the predicate to evaluate. Note that even though the predicate
is applied on the entire object, it will be evaluated only when
the running state changes.
@param timeoutMs the number of ... | [
"Waits",
"till",
"a",
"predicate",
"on",
"{",
"@link",
"#getRunningState",
"()",
"}",
"becomes",
"true",
"or",
"timeout",
"is",
"reached",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/JobExecutionState.java#L257-L283 |
davidcarboni-archive/httpino | src/main/java/com/github/davidcarboni/httpino/Http.java | Http.deserialiseResponseMessage | protected <T> T deserialiseResponseMessage(CloseableHttpResponse response, Type type) throws IOException {
"""
Deserialises the given {@link CloseableHttpResponse} to the specified type.
@param response The response.
@param type The type to deserialise to. This can be null, in which case {@link EntityUtils... | java | protected <T> T deserialiseResponseMessage(CloseableHttpResponse response, Type type) throws IOException {
T body = null;
HttpEntity entity = response.getEntity();
if (entity != null && type != null) {
try (InputStream inputStream = entity.getContent()) {
try {
... | [
"protected",
"<",
"T",
">",
"T",
"deserialiseResponseMessage",
"(",
"CloseableHttpResponse",
"response",
",",
"Type",
"type",
")",
"throws",
"IOException",
"{",
"T",
"body",
"=",
"null",
";",
"HttpEntity",
"entity",
"=",
"response",
".",
"getEntity",
"(",
")",... | Deserialises the given {@link CloseableHttpResponse} to the specified type.
@param response The response.
@param type The type to deserialise to. This can be null, in which case {@link EntityUtils#consume(HttpEntity)} will be used to consume the response body (if any).
@param <T> The type to deserialise to.
@... | [
"Deserialises",
"the",
"given",
"{",
"@link",
"CloseableHttpResponse",
"}",
"to",
"the",
"specified",
"type",
"."
] | train | https://github.com/davidcarboni-archive/httpino/blob/a78c91874e6d9b2e452cf3aa68d4fea804d977ca/src/main/java/com/github/davidcarboni/httpino/Http.java#L505-L525 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/dbinfo/DINameSpace.java | DINameSpace.classForMethodFQN | Class classForMethodFQN(String fqn) {
"""
Retrieves the declaring <code>Class</code> object for the specified
fully qualified method name, using (if possible) the classLoader
attribute of this object's database. <p>
@param fqn the fully qualified name of the method for which to
retrieve the declaring <code>C... | java | Class classForMethodFQN(String fqn) {
try {
return classForName(fqn.substring(0, fqn.lastIndexOf('.')));
} catch (Exception e) {
return null;
}
} | [
"Class",
"classForMethodFQN",
"(",
"String",
"fqn",
")",
"{",
"try",
"{",
"return",
"classForName",
"(",
"fqn",
".",
"substring",
"(",
"0",
",",
"fqn",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
... | Retrieves the declaring <code>Class</code> object for the specified
fully qualified method name, using (if possible) the classLoader
attribute of this object's database. <p>
@param fqn the fully qualified name of the method for which to
retrieve the declaring <code>Class</code> object.
@return the declaring <code>Clas... | [
"Retrieves",
"the",
"declaring",
"<code",
">",
"Class<",
"/",
"code",
">",
"object",
"for",
"the",
"specified",
"fully",
"qualified",
"method",
"name",
"using",
"(",
"if",
"possible",
")",
"the",
"classLoader",
"attribute",
"of",
"this",
"object",
"s",
"data... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/dbinfo/DINameSpace.java#L116-L123 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.addCrossBlacklist | public ResponseWrapper addCrossBlacklist(String username, CrossBlacklist[] blacklists)
throws APIConnectionException, APIRequestException {
"""
Add blacklist whose users belong to another app to a given user.
@param username The owner of the blacklist
@param blacklists CrossBlacklist array
@return N... | java | public ResponseWrapper addCrossBlacklist(String username, CrossBlacklist[] blacklists)
throws APIConnectionException, APIRequestException {
return _crossAppClient.addCrossBlacklist(username, blacklists);
} | [
"public",
"ResponseWrapper",
"addCrossBlacklist",
"(",
"String",
"username",
",",
"CrossBlacklist",
"[",
"]",
"blacklists",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_crossAppClient",
".",
"addCrossBlacklist",
"(",
"username",
... | Add blacklist whose users belong to another app to a given user.
@param username The owner of the blacklist
@param blacklists CrossBlacklist array
@return No Content
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Add",
"blacklist",
"whose",
"users",
"belong",
"to",
"another",
"app",
"to",
"a",
"given",
"user",
"."
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L619-L622 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java | ClassUtil.invoke | public static <T> T invoke(String className, String methodName, Object[] args) {
"""
执行方法<br>
可执行Private方法,也可执行static方法<br>
执行非static方法时,必须满足对象有默认构造方法<br>
非单例模式,如果是非静态方法,每次创建一个新对象
@param <T> 对象类型
@param className 类名,完整类路径
@param methodName 方法名
@param args 参数,必须严格对应指定方法的参数类型和数量
@return 返回结果
"""
ret... | java | public static <T> T invoke(String className, String methodName, Object[] args) {
return invoke(className, methodName, false, args);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"invoke",
"(",
"String",
"className",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"return",
"invoke",
"(",
"className",
",",
"methodName",
",",
"false",
",",
"args",
")",
";",
"}"
] | 执行方法<br>
可执行Private方法,也可执行static方法<br>
执行非static方法时,必须满足对象有默认构造方法<br>
非单例模式,如果是非静态方法,每次创建一个新对象
@param <T> 对象类型
@param className 类名,完整类路径
@param methodName 方法名
@param args 参数,必须严格对应指定方法的参数类型和数量
@return 返回结果 | [
"执行方法<br",
">",
"可执行Private方法,也可执行static方法<br",
">",
"执行非static方法时,必须满足对象有默认构造方法<br",
">",
"非单例模式,如果是非静态方法,每次创建一个新对象"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L665-L667 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/ocr/AipOcr.java | AipOcr.generalUrl | public JSONObject generalUrl(String url, HashMap<String, String> options) {
"""
通用文字识别(含位置信息版)接口
用户向服务请求识别某张图中的所有文字,并返回文字在图中的位置信息。
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
options - optio... | java | public JSONObject generalUrl(String url, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("url", url);
if (options != null) {
request.addBody(options);
}
request.setUri(OcrConsts.GENERAL)... | [
"public",
"JSONObject",
"generalUrl",
"(",
"String",
"url",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",
".",
... | 通用文字识别(含位置信息版)接口
用户向服务请求识别某张图中的所有文字,并返回文字在图中的位置信息。
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
options - options列表:
recognize_granularity 是否定位单字符位置,big:不定位单字符位置,默认值;small:定位单字符位置
language_type 识别语言类型,... | [
"通用文字识别(含位置信息版)接口",
"用户向服务请求识别某张图中的所有文字,并返回文字在图中的位置信息。"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/ocr/AipOcr.java#L224-L235 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.index | public Iterable<Integer> index() {
"""
Returns a read-only Iterable on the keys of the Dataframe.
@return
"""
return () -> new Iterator<Integer>() {
private final Iterator<Integer> it = data.records.keySet().iterator();
/** {@inheritDoc} */
@Override
... | java | public Iterable<Integer> index() {
return () -> new Iterator<Integer>() {
private final Iterator<Integer> it = data.records.keySet().iterator();
/** {@inheritDoc} */
@Override
public boolean hasNext() {
return it.hasNext();
}
... | [
"public",
"Iterable",
"<",
"Integer",
">",
"index",
"(",
")",
"{",
"return",
"(",
")",
"->",
"new",
"Iterator",
"<",
"Integer",
">",
"(",
")",
"{",
"private",
"final",
"Iterator",
"<",
"Integer",
">",
"it",
"=",
"data",
".",
"records",
".",
"keySet",... | Returns a read-only Iterable on the keys of the Dataframe.
@return | [
"Returns",
"a",
"read",
"-",
"only",
"Iterable",
"on",
"the",
"keys",
"of",
"the",
"Dataframe",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L804-L826 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/component/ComponentStateHelper.java | ComponentStateHelper.saveState | public Object saveState(FacesContext context) {
"""
One and only implementation of
save-state - makes all other implementations
unnecessary.
@param context
@return the saved state
"""
if (context == null) {
throw new NullPointerException();
}
if(component.initialStateM... | java | public Object saveState(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
if(component.initialStateMarked()) {
return saveMap(context, deltaMap);
}
else {
return saveMap(context, defaultMap);
}
} | [
"public",
"Object",
"saveState",
"(",
"FacesContext",
"context",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"if",
"(",
"component",
".",
"initialStateMarked",
"(",
")",
")",
"{",
"r... | One and only implementation of
save-state - makes all other implementations
unnecessary.
@param context
@return the saved state | [
"One",
"and",
"only",
"implementation",
"of",
"save",
"-",
"state",
"-",
"makes",
"all",
"other",
"implementations",
"unnecessary",
"."
] | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/ComponentStateHelper.java#L251-L261 |
qiujuer/Genius-Android | caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/EditText.java | EditText.checkShowTitle | private void checkShowTitle(Editable s, boolean skipChange) {
"""
Check show hint title
@param s The text, if the have same string we should move hint
@param skipChange on showed we not refresh ui, but skipChange=true,
we can skip the check
"""
// in this we can check width
if (is... | java | private void checkShowTitle(Editable s, boolean skipChange) {
// in this we can check width
if (isShowTitle() && getWidth() > 0) {
boolean have = s != null && s.length() > 0;
if (have != isHaveText || (have && skipChange)) {
isHaveText = have;
anim... | [
"private",
"void",
"checkShowTitle",
"(",
"Editable",
"s",
",",
"boolean",
"skipChange",
")",
"{",
"// in this we can check width",
"if",
"(",
"isShowTitle",
"(",
")",
"&&",
"getWidth",
"(",
")",
">",
"0",
")",
"{",
"boolean",
"have",
"=",
"s",
"!=",
"null... | Check show hint title
@param s The text, if the have same string we should move hint
@param skipChange on showed we not refresh ui, but skipChange=true,
we can skip the check | [
"Check",
"show",
"hint",
"title"
] | train | https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/EditText.java#L282-L291 |
JDBDT/jdbdt | src/main/java/org/jdbdt/DataSource.java | DataSource.executeQuery | final DataSet executeQuery(CallInfo callInfo, boolean takeSnapshot) {
"""
Execute query.
@param callInfo Call info.
@param takeSnapshot Indicates that a snapshot should be taken.
@return Result of query.
"""
DataSet data = new DataSet(this);
return db.access(callInfo, () -> {
try (WrappedState... | java | final DataSet executeQuery(CallInfo callInfo, boolean takeSnapshot) {
DataSet data = new DataSet(this);
return db.access(callInfo, () -> {
try (WrappedStatement ws = db.compile(getSQLForQuery())) {
proceedWithQuery(ws.getStatement(), data);
if (takeSnapshot) {
setSnapshot(data);
... | [
"final",
"DataSet",
"executeQuery",
"(",
"CallInfo",
"callInfo",
",",
"boolean",
"takeSnapshot",
")",
"{",
"DataSet",
"data",
"=",
"new",
"DataSet",
"(",
"this",
")",
";",
"return",
"db",
".",
"access",
"(",
"callInfo",
",",
"(",
")",
"->",
"{",
"try",
... | Execute query.
@param callInfo Call info.
@param takeSnapshot Indicates that a snapshot should be taken.
@return Result of query. | [
"Execute",
"query",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DataSource.java#L226-L240 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/Config.java | Config.setQueueConfigs | public Config setQueueConfigs(Map<String, QueueConfig> queueConfigs) {
"""
Sets the map of {@link com.hazelcast.core.IQueue} configurations,
mapped by config name. The config name may be a pattern with which the
configuration will be obtained in the future.
@param queueConfigs the queue configuration map to s... | java | public Config setQueueConfigs(Map<String, QueueConfig> queueConfigs) {
this.queueConfigs.clear();
this.queueConfigs.putAll(queueConfigs);
for (Entry<String, QueueConfig> entry : queueConfigs.entrySet()) {
entry.getValue().setName(entry.getKey());
}
return this;
} | [
"public",
"Config",
"setQueueConfigs",
"(",
"Map",
"<",
"String",
",",
"QueueConfig",
">",
"queueConfigs",
")",
"{",
"this",
".",
"queueConfigs",
".",
"clear",
"(",
")",
";",
"this",
".",
"queueConfigs",
".",
"putAll",
"(",
"queueConfigs",
")",
";",
"for",... | Sets the map of {@link com.hazelcast.core.IQueue} configurations,
mapped by config name. The config name may be a pattern with which the
configuration will be obtained in the future.
@param queueConfigs the queue configuration map to set
@return this config instance | [
"Sets",
"the",
"map",
"of",
"{",
"@link",
"com",
".",
"hazelcast",
".",
"core",
".",
"IQueue",
"}",
"configurations",
"mapped",
"by",
"config",
"name",
".",
"The",
"config",
"name",
"may",
"be",
"a",
"pattern",
"with",
"which",
"the",
"configuration",
"w... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/Config.java#L706-L713 |
tvesalainen/util | util/src/main/java/org/vesalainen/util/OrderedList.java | OrderedList.tailIterator | public Iterator<T> tailIterator(T key, boolean inclusive) {
"""
Returns iterator from key to end
@param key
@param inclusive
@return
"""
int point = point(key, inclusive);
return subList(point, size()).iterator();
} | java | public Iterator<T> tailIterator(T key, boolean inclusive)
{
int point = point(key, inclusive);
return subList(point, size()).iterator();
} | [
"public",
"Iterator",
"<",
"T",
">",
"tailIterator",
"(",
"T",
"key",
",",
"boolean",
"inclusive",
")",
"{",
"int",
"point",
"=",
"point",
"(",
"key",
",",
"inclusive",
")",
";",
"return",
"subList",
"(",
"point",
",",
"size",
"(",
")",
")",
".",
"... | Returns iterator from key to end
@param key
@param inclusive
@return | [
"Returns",
"iterator",
"from",
"key",
"to",
"end"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/OrderedList.java#L136-L140 |
lessthanoptimal/ddogleg | src/org/ddogleg/optimization/quasinewton/QuasiNewtonBFGS.java | QuasiNewtonBFGS.setFunction | public void setFunction( GradientLineFunction function , double funcMinValue ) {
"""
Specify the function being optimized
@param function Function to optimize
@param funcMinValue Minimum possible function value. E.g. 0 for least squares.
"""
this.function = function;
this.funcMinValue = funcMinValue;
... | java | public void setFunction( GradientLineFunction function , double funcMinValue ) {
this.function = function;
this.funcMinValue = funcMinValue;
lineSearch.setFunction(function,funcMinValue);
N = function.getN();
B = new DMatrixRMaj(N,N);
searchVector = new DMatrixRMaj(N,1);
g = new DMatrixRMaj(N,1);
s = ... | [
"public",
"void",
"setFunction",
"(",
"GradientLineFunction",
"function",
",",
"double",
"funcMinValue",
")",
"{",
"this",
".",
"function",
"=",
"function",
";",
"this",
".",
"funcMinValue",
"=",
"funcMinValue",
";",
"lineSearch",
".",
"setFunction",
"(",
"funct... | Specify the function being optimized
@param function Function to optimize
@param funcMinValue Minimum possible function value. E.g. 0 for least squares. | [
"Specify",
"the",
"function",
"being",
"optimized"
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/optimization/quasinewton/QuasiNewtonBFGS.java#L122-L138 |
srikalyc/Sql4D | Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/DruidNodeAccessor.java | DruidNodeAccessor.postJson | public CloseableHttpResponse postJson(String url, String json, Map<String, String> reqHeaders) throws IOException {
"""
Convenient method for POSTing json strings. It is the responsibility of the
caller to call returnClient() to ensure clean state of the pool.
@param url
@param json
@param reqHeaders
@return
... | java | public CloseableHttpResponse postJson(String url, String json, Map<String, String> reqHeaders) throws IOException {
CloseableHttpClient req = getClient();
CloseableHttpResponse resp = null;
HttpPost post = new HttpPost(url);
addHeaders(post, reqHeaders);
post.setHeader(json, url)... | [
"public",
"CloseableHttpResponse",
"postJson",
"(",
"String",
"url",
",",
"String",
"json",
",",
"Map",
"<",
"String",
",",
"String",
">",
"reqHeaders",
")",
"throws",
"IOException",
"{",
"CloseableHttpClient",
"req",
"=",
"getClient",
"(",
")",
";",
"Closeabl... | Convenient method for POSTing json strings. It is the responsibility of the
caller to call returnClient() to ensure clean state of the pool.
@param url
@param json
@param reqHeaders
@return
@throws IOException | [
"Convenient",
"method",
"for",
"POSTing",
"json",
"strings",
".",
"It",
"is",
"the",
"responsibility",
"of",
"the",
"caller",
"to",
"call",
"returnClient",
"()",
"to",
"ensure",
"clean",
"state",
"of",
"the",
"pool",
"."
] | train | https://github.com/srikalyc/Sql4D/blob/2c052fe60ead5a16277c798a3440de7d4f6f24f6/Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/DruidNodeAccessor.java#L133-L143 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemUtils.java | ProxiedFileSystemUtils.canProxyAs | public static boolean canProxyAs(String userNameToProxyAs, String superUserName, Path superUserKeytabLocation) {
"""
Returns true if superUserName can proxy as userNameToProxyAs using the specified superUserKeytabLocation, false
otherwise.
"""
try {
loginAndProxyAsUser(userNameToProxyAs, superUserNa... | java | public static boolean canProxyAs(String userNameToProxyAs, String superUserName, Path superUserKeytabLocation) {
try {
loginAndProxyAsUser(userNameToProxyAs, superUserName, superUserKeytabLocation);
} catch (IOException e) {
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"canProxyAs",
"(",
"String",
"userNameToProxyAs",
",",
"String",
"superUserName",
",",
"Path",
"superUserKeytabLocation",
")",
"{",
"try",
"{",
"loginAndProxyAsUser",
"(",
"userNameToProxyAs",
",",
"superUserName",
",",
"superUserKeytabLoc... | Returns true if superUserName can proxy as userNameToProxyAs using the specified superUserKeytabLocation, false
otherwise. | [
"Returns",
"true",
"if",
"superUserName",
"can",
"proxy",
"as",
"userNameToProxyAs",
"using",
"the",
"specified",
"superUserKeytabLocation",
"false",
"otherwise",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemUtils.java#L189-L196 |
structr/structr | structr-core/src/main/java/org/structr/core/entity/LinkedListNodeImpl.java | LinkedListNodeImpl.listInsertBefore | @Override
public void listInsertBefore(final T currentElement, final T newElement) throws FrameworkException {
"""
Inserts newElement before currentElement in the list defined by this
LinkedListManager.
@param currentElement the reference element
@param newElement the new element
@throws org.structr.common.... | java | @Override
public void listInsertBefore(final T currentElement, final T newElement) throws FrameworkException {
if (currentElement.getUuid().equals(newElement.getUuid())) {
throw new IllegalStateException("Cannot link a node to itself!");
}
final T previousElement = listGetPrevious(currentElement);
if (pre... | [
"@",
"Override",
"public",
"void",
"listInsertBefore",
"(",
"final",
"T",
"currentElement",
",",
"final",
"T",
"newElement",
")",
"throws",
"FrameworkException",
"{",
"if",
"(",
"currentElement",
".",
"getUuid",
"(",
")",
".",
"equals",
"(",
"newElement",
".",... | Inserts newElement before currentElement in the list defined by this
LinkedListManager.
@param currentElement the reference element
@param newElement the new element
@throws org.structr.common.error.FrameworkException | [
"Inserts",
"newElement",
"before",
"currentElement",
"in",
"the",
"list",
"defined",
"by",
"this",
"LinkedListManager",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/LinkedListNodeImpl.java#L83-L109 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java | CommerceNotificationTemplatePersistenceImpl.removeByUuid_C | @Override
public void removeByUuid_C(String uuid, long companyId) {
"""
Removes all the commerce notification templates where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID
"""
for (CommerceNotificationTemplate commerceNotificationTemplate : fi... | java | @Override
public void removeByUuid_C(String uuid, long companyId) {
for (CommerceNotificationTemplate commerceNotificationTemplate : findByUuid_C(
uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceNotificationTemplate);
}
} | [
"@",
"Override",
"public",
"void",
"removeByUuid_C",
"(",
"String",
"uuid",
",",
"long",
"companyId",
")",
"{",
"for",
"(",
"CommerceNotificationTemplate",
"commerceNotificationTemplate",
":",
"findByUuid_C",
"(",
"uuid",
",",
"companyId",
",",
"QueryUtil",
".",
"... | Removes all the commerce notification templates where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID | [
"Removes",
"all",
"the",
"commerce",
"notification",
"templates",
"where",
"uuid",
"=",
"?",
";",
"and",
"companyId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java#L1432-L1438 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WRowRenderer.java | WRowRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WButton.
@param component the WRow to paint.
@param renderContext the RenderContext to paint to.
"""
WRow row = (WRow) component;
XmlStringBuilder xml = renderContext.getWriter();... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WRow row = (WRow) component;
XmlStringBuilder xml = renderContext.getWriter();
int cols = row.getChildCount();
Size gap = row.getSpace();
String gapString = gap != null ? gap.toString() : null;
if (cols >... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WRow",
"row",
"=",
"(",
"WRow",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"renderContext",
".",
... | Paints the given WButton.
@param component the WRow to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WButton",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WRowRenderer.java#L25-L48 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/ServerRequestQueue.java | ServerRequestQueue.moveInstallOrOpenToFront | @SuppressWarnings("unused")
void moveInstallOrOpenToFront(ServerRequest request, int networkCount, Branch.BranchReferralInitListener callback) {
"""
<p>Moves any {@link ServerRequest} of type {@link ServerRequestRegisterInstall}
or {@link ServerRequestRegisterOpen} to the front of the queue.</p>
@param req... | java | @SuppressWarnings("unused")
void moveInstallOrOpenToFront(ServerRequest request, int networkCount, Branch.BranchReferralInitListener callback) {
synchronized (reqQueueLockObject) {
Iterator<ServerRequest> iter = queue.iterator();
while (iter.hasNext()) {
Serv... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"void",
"moveInstallOrOpenToFront",
"(",
"ServerRequest",
"request",
",",
"int",
"networkCount",
",",
"Branch",
".",
"BranchReferralInitListener",
"callback",
")",
"{",
"synchronized",
"(",
"reqQueueLockObject",
")",
"{... | <p>Moves any {@link ServerRequest} of type {@link ServerRequestRegisterInstall}
or {@link ServerRequestRegisterOpen} to the front of the queue.</p>
@param request A {@link ServerRequest} of type open or install which need to be moved to the front of the queue.
@param networkCount An {@link Integer} value that ind... | [
"<p",
">",
"Moves",
"any",
"{",
"@link",
"ServerRequest",
"}",
"of",
"type",
"{",
"@link",
"ServerRequestRegisterInstall",
"}",
"or",
"{",
"@link",
"ServerRequestRegisterOpen",
"}",
"to",
"the",
"front",
"of",
"the",
"queue",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/ServerRequestQueue.java#L329-L346 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_11_01/src/main/java/com/microsoft/azure/management/storage/v2018_11_01/implementation/BlobServicesInner.java | BlobServicesInner.setServicePropertiesAsync | public Observable<BlobServicePropertiesInner> setServicePropertiesAsync(String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) {
"""
Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
@... | java | public Observable<BlobServicePropertiesInner> setServicePropertiesAsync(String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) {
return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1<ServiceResponse<BlobServicePropertiesInner>... | [
"public",
"Observable",
"<",
"BlobServicePropertiesInner",
">",
"setServicePropertiesAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"BlobServicePropertiesInner",
"parameters",
")",
"{",
"return",
"setServicePropertiesWithServiceResponseAsync",
"(... | Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name of the storage account wi... | [
"Sets",
"the",
"properties",
"of",
"a",
"storage",
"account’s",
"Blob",
"service",
"including",
"properties",
"for",
"Storage",
"Analytics",
"and",
"CORS",
"(",
"Cross",
"-",
"Origin",
"Resource",
"Sharing",
")",
"rules",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_11_01/src/main/java/com/microsoft/azure/management/storage/v2018_11_01/implementation/BlobServicesInner.java#L105-L112 |
bingoohuang/excel2javabeans | src/main/java/com/github/bingoohuang/excel2beans/BeansToExcelOnTemplate.java | BeansToExcelOnTemplate.directMergeRows | private void directMergeRows(MergeRow mergeRowAnn, int fromRow, int lastRow, int col) {
"""
直接纵向合并单元格。
@param mergeRowAnn 纵向合并单元格注解。
@param fromRow 开始合并行索引。
@param lastRow 结束合并行索引。
@param col 纵向列索引。
"""
fixCellValue(mergeRowAnn, fromRow, col);
if (lastRow < fromRow) retur... | java | private void directMergeRows(MergeRow mergeRowAnn, int fromRow, int lastRow, int col) {
fixCellValue(mergeRowAnn, fromRow, col);
if (lastRow < fromRow) return;
if (lastRow == fromRow && mergeRowAnn.moreCols() == 0) return;
val c1 = new CellRangeAddress(fromRow, lastRow, col, col + merg... | [
"private",
"void",
"directMergeRows",
"(",
"MergeRow",
"mergeRowAnn",
",",
"int",
"fromRow",
",",
"int",
"lastRow",
",",
"int",
"col",
")",
"{",
"fixCellValue",
"(",
"mergeRowAnn",
",",
"fromRow",
",",
"col",
")",
";",
"if",
"(",
"lastRow",
"<",
"fromRow",... | 直接纵向合并单元格。
@param mergeRowAnn 纵向合并单元格注解。
@param fromRow 开始合并行索引。
@param lastRow 结束合并行索引。
@param col 纵向列索引。 | [
"直接纵向合并单元格。"
] | train | https://github.com/bingoohuang/excel2javabeans/blob/db136d460b93b649814366c0d84a982698b96dc3/src/main/java/com/github/bingoohuang/excel2beans/BeansToExcelOnTemplate.java#L179-L187 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SDVariable.java | SDVariable.gte | public SDVariable gte(String name, SDVariable other) {
"""
Greater than or equal to operation: elementwise {@code this >= y}<br>
If x and y arrays have equal shape, the output shape is the same as the inputs.<br>
Supports broadcasting: if x and y have different shapes and are broadcastable, the output shape is b... | java | public SDVariable gte(String name, SDVariable other){
return sameDiff.gte(name, this, other);
} | [
"public",
"SDVariable",
"gte",
"(",
"String",
"name",
",",
"SDVariable",
"other",
")",
"{",
"return",
"sameDiff",
".",
"gte",
"(",
"name",
",",
"this",
",",
"other",
")",
";",
"}"
] | Greater than or equal to operation: elementwise {@code this >= y}<br>
If x and y arrays have equal shape, the output shape is the same as the inputs.<br>
Supports broadcasting: if x and y have different shapes and are broadcastable, the output shape is broadcast.<br>
Returns an array with values 1 where condition is sa... | [
"Greater",
"than",
"or",
"equal",
"to",
"operation",
":",
"elementwise",
"{",
"@code",
"this",
">",
"=",
"y",
"}",
"<br",
">",
"If",
"x",
"and",
"y",
"arrays",
"have",
"equal",
"shape",
"the",
"output",
"shape",
"is",
"the",
"same",
"as",
"the",
"inp... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SDVariable.java#L567-L569 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java | AtomicIntegerFieldUpdater.addAndGet | public int addAndGet(T obj, int delta) {
"""
Atomically adds the given value to the current value of the field of
the given object managed by this updater.
@param obj An object whose field to get and set
@param delta the value to add
@return the updated value
"""
int prev, next;
do {
... | java | public int addAndGet(T obj, int delta) {
int prev, next;
do {
prev = get(obj);
next = prev + delta;
} while (!compareAndSet(obj, prev, next));
return next;
} | [
"public",
"int",
"addAndGet",
"(",
"T",
"obj",
",",
"int",
"delta",
")",
"{",
"int",
"prev",
",",
"next",
";",
"do",
"{",
"prev",
"=",
"get",
"(",
"obj",
")",
";",
"next",
"=",
"prev",
"+",
"delta",
";",
"}",
"while",
"(",
"!",
"compareAndSet",
... | Atomically adds the given value to the current value of the field of
the given object managed by this updater.
@param obj An object whose field to get and set
@param delta the value to add
@return the updated value | [
"Atomically",
"adds",
"the",
"given",
"value",
"to",
"the",
"current",
"value",
"of",
"the",
"field",
"of",
"the",
"given",
"object",
"managed",
"by",
"this",
"updater",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java#L265-L272 |
jbundle/jbundle | thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/ThinTableModel.java | ThinTableModel.setColumnValue | public boolean setColumnValue(int iColumnIndex, Object value, boolean bDisplay, int iMoveMode) {
"""
Set the value at the field at the column.
Since this is only used by the restore current record method,
pass dont_display and read_move when you set the data.
This is NOT a TableModel override, this is my method... | java | public boolean setColumnValue(int iColumnIndex, Object value, boolean bDisplay, int iMoveMode)
{
Convert fieldInfo = this.getFieldInfo(iColumnIndex);
if (fieldInfo != null)
{
Object dataBefore = fieldInfo.getData();
if (!(value instanceof String))
fiel... | [
"public",
"boolean",
"setColumnValue",
"(",
"int",
"iColumnIndex",
",",
"Object",
"value",
",",
"boolean",
"bDisplay",
",",
"int",
"iMoveMode",
")",
"{",
"Convert",
"fieldInfo",
"=",
"this",
".",
"getFieldInfo",
"(",
"iColumnIndex",
")",
";",
"if",
"(",
"fie... | Set the value at the field at the column.
Since this is only used by the restore current record method,
pass dont_display and read_move when you set the data.
This is NOT a TableModel override, this is my method.
@param iColumnIndex The column.
@param value The raw data value or string to set.
@return True if the value... | [
"Set",
"the",
"value",
"at",
"the",
"field",
"at",
"the",
"column",
".",
"Since",
"this",
"is",
"only",
"used",
"by",
"the",
"restore",
"current",
"record",
"method",
"pass",
"dont_display",
"and",
"read_move",
"when",
"you",
"set",
"the",
"data",
".",
"... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/ThinTableModel.java#L291-L308 |
premium-minds/pm-wicket-utils | src/main/java/com/premiumminds/webapp/wicket/bootstrap/BootstrapDatePicker.java | BootstrapDatePicker.getDateTextField | public DateTextField getDateTextField() {
"""
Gets the DateTextField inside this datepicker wrapper.
@return the date field
"""
DateTextField component = visitChildren(DateTextField.class, new IVisitor<DateTextField, DateTextField>() {
@Override
public void component(DateTextField arg0, IVisit<DateT... | java | public DateTextField getDateTextField(){
DateTextField component = visitChildren(DateTextField.class, new IVisitor<DateTextField, DateTextField>() {
@Override
public void component(DateTextField arg0, IVisit<DateTextField> arg1) {
arg1.stop(arg0);
}
});
if (component == null)
throw new WicketRunt... | [
"public",
"DateTextField",
"getDateTextField",
"(",
")",
"{",
"DateTextField",
"component",
"=",
"visitChildren",
"(",
"DateTextField",
".",
"class",
",",
"new",
"IVisitor",
"<",
"DateTextField",
",",
"DateTextField",
">",
"(",
")",
"{",
"@",
"Override",
"public... | Gets the DateTextField inside this datepicker wrapper.
@return the date field | [
"Gets",
"the",
"DateTextField",
"inside",
"this",
"datepicker",
"wrapper",
"."
] | train | https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/bootstrap/BootstrapDatePicker.java#L85-L97 |
FaritorKang/unmz-common-util | src/main/java/net/unmz/java/util/code/ImageCodeUtils.java | ImageCodeUtils.generateVerifyCode | public static String generateVerifyCode(int verifySize, String sources) {
"""
使用指定源生成验证码
@param verifySize 验证码长度
@param sources 验证码字符源
@return
"""
if(sources == null || sources.length() == 0){
sources = VERIFY_CODES;
}
int codesLen = sources.length();
Random ... | java | public static String generateVerifyCode(int verifySize, String sources){
if(sources == null || sources.length() == 0){
sources = VERIFY_CODES;
}
int codesLen = sources.length();
Random rand = new Random(System.currentTimeMillis());
StringBuilder verifyCode = new Strin... | [
"public",
"static",
"String",
"generateVerifyCode",
"(",
"int",
"verifySize",
",",
"String",
"sources",
")",
"{",
"if",
"(",
"sources",
"==",
"null",
"||",
"sources",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"sources",
"=",
"VERIFY_CODES",
";",
"}",... | 使用指定源生成验证码
@param verifySize 验证码长度
@param sources 验证码字符源
@return | [
"使用指定源生成验证码"
] | train | https://github.com/FaritorKang/unmz-common-util/blob/2912b8889b85ed910d536f85b24b6fa68035814a/src/main/java/net/unmz/java/util/code/ImageCodeUtils.java#L43-L54 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Path3d.java | Path3d.lineTo | public void lineTo(double x, double y, double z) {
"""
Adds a point to the path by drawing a straight line from the
current coordinates to the new specified coordinates
specified in double precision.
@param x the specified X coordinate
@param y the specified Y coordinate
@param z the specified Z coordinate
... | java | public void lineTo(double x, double y, double z) {
ensureSlots(true, 3);
this.types[this.numTypesProperty.get()] = PathElementType.LINE_TO;
this.numTypesProperty.set(this.numTypesProperty.get()+1);
this.coordsProperty[this.numCoordsProperty.get()].set(x);
this.numCoordsProperty.set(this.numCoordsProperty.get... | [
"public",
"void",
"lineTo",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"ensureSlots",
"(",
"true",
",",
"3",
")",
";",
"this",
".",
"types",
"[",
"this",
".",
"numTypesProperty",
".",
"get",
"(",
")",
"]",
"=",
"PathEleme... | Adds a point to the path by drawing a straight line from the
current coordinates to the new specified coordinates
specified in double precision.
@param x the specified X coordinate
@param y the specified Y coordinate
@param z the specified Z coordinate | [
"Adds",
"a",
"point",
"to",
"the",
"path",
"by",
"drawing",
"a",
"straight",
"line",
"from",
"the",
"current",
"coordinates",
"to",
"the",
"new",
"specified",
"coordinates",
"specified",
"in",
"double",
"precision",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Path3d.java#L2106-L2123 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.translationRotateMul | public Matrix4x3d translationRotateMul(double tx, double ty, double tz, Quaternionfc quat, Matrix4x3dc mat) {
"""
Set <code>this</code> matrix to <code>T * R * M</code>, where <code>T</code> is a translation by the given <code>(tx, ty, tz)</code>,
<code>R</code> is a rotation - and possibly scaling - transformati... | java | public Matrix4x3d translationRotateMul(double tx, double ty, double tz, Quaternionfc quat, Matrix4x3dc mat) {
return translationRotateMul(tx, ty, tz, quat.x(), quat.y(), quat.z(), quat.w(), mat);
} | [
"public",
"Matrix4x3d",
"translationRotateMul",
"(",
"double",
"tx",
",",
"double",
"ty",
",",
"double",
"tz",
",",
"Quaternionfc",
"quat",
",",
"Matrix4x3dc",
"mat",
")",
"{",
"return",
"translationRotateMul",
"(",
"tx",
",",
"ty",
",",
"tz",
",",
"quat",
... | Set <code>this</code> matrix to <code>T * R * M</code>, where <code>T</code> is a translation by the given <code>(tx, ty, tz)</code>,
<code>R</code> is a rotation - and possibly scaling - transformation specified by the given quaternion and <code>M</code> is the given matrix <code>mat</code>.
<p>
When transforming a ve... | [
"Set",
"<code",
">",
"this<",
"/",
"code",
">",
"matrix",
"to",
"<code",
">",
"T",
"*",
"R",
"*",
"M<",
"/",
"code",
">",
"where",
"<code",
">",
"T<",
"/",
"code",
">",
"is",
"a",
"translation",
"by",
"the",
"given",
"<code",
">",
"(",
"tx",
"t... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L5140-L5142 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/dialog/SARLAgentMainLaunchConfigurationTab.java | SARLAgentMainLaunchConfigurationTab.createLaunchOptionEditor | protected void createLaunchOptionEditor(Composite parent, String text) {
"""
Creates the widgets for configuring the launch options.
@param parent the parent composite.
@param text the label of the group.
"""
final Group group = SWTFactory.createGroup(parent, text, 1, 1, GridData.FILL_HORIZONTAL);
this... | java | protected void createLaunchOptionEditor(Composite parent, String text) {
final Group group = SWTFactory.createGroup(parent, text, 1, 1, GridData.FILL_HORIZONTAL);
this.showLogoOptionButton = createCheckButton(group, Messages.MainLaunchConfigurationTab_14);
this.showLogoOptionButton.addSelectionListener(this.defau... | [
"protected",
"void",
"createLaunchOptionEditor",
"(",
"Composite",
"parent",
",",
"String",
"text",
")",
"{",
"final",
"Group",
"group",
"=",
"SWTFactory",
".",
"createGroup",
"(",
"parent",
",",
"text",
",",
"1",
",",
"1",
",",
"GridData",
".",
"FILL_HORIZO... | Creates the widgets for configuring the launch options.
@param parent the parent composite.
@param text the label of the group. | [
"Creates",
"the",
"widgets",
"for",
"configuring",
"the",
"launch",
"options",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/dialog/SARLAgentMainLaunchConfigurationTab.java#L226-L240 |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java | IOUtils.readStringFromRaw | public static String readStringFromRaw(Context context, int resId) throws IOException {
"""
get content from a raw resource. This can only be used with resources whose value is the name of an
asset files -- that is, it can be used to open drawable, sound, and raw resources; it will fail on string and
color resou... | java | public static String readStringFromRaw(Context context, int resId) throws IOException {
if (context == null) {
return null;
}
StringBuilder s = new StringBuilder();
InputStreamReader in = new InputStreamReader(context.getResources().openRawResource(resId));
Bu... | [
"public",
"static",
"String",
"readStringFromRaw",
"(",
"Context",
"context",
",",
"int",
"resId",
")",
"throws",
"IOException",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"StringBuilder",
"s",
"=",
"new",
"StringBuilder",... | get content from a raw resource. This can only be used with resources whose value is the name of an
asset files -- that is, it can be used to open drawable, sound, and raw resources; it will fail on string and
color resources.
@param context
@param resId The resource identifier to open, as generated by the appt tool... | [
"get",
"content",
"from",
"a",
"raw",
"resource",
".",
"This",
"can",
"only",
"be",
"used",
"with",
"resources",
"whose",
"value",
"is",
"the",
"name",
"of",
"an",
"asset",
"files",
"--",
"that",
"is",
"it",
"can",
"be",
"used",
"to",
"open",
"drawable... | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java#L1086-L1099 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java | HylaFaxJob.setSenderName | public void setSenderName(String senderName) {
"""
This function sets the fax job sender name.
@param senderName
The fax job sender name
"""
try
{
this.JOB.setFromUser(senderName);
}
catch(Exception exception)
{
throw new FaxException("Error... | java | public void setSenderName(String senderName)
{
try
{
this.JOB.setFromUser(senderName);
}
catch(Exception exception)
{
throw new FaxException("Error while setting job sender name.",exception);
}
} | [
"public",
"void",
"setSenderName",
"(",
"String",
"senderName",
")",
"{",
"try",
"{",
"this",
".",
"JOB",
".",
"setFromUser",
"(",
"senderName",
")",
";",
"}",
"catch",
"(",
"Exception",
"exception",
")",
"{",
"throw",
"new",
"FaxException",
"(",
"\"Error ... | This function sets the fax job sender name.
@param senderName
The fax job sender name | [
"This",
"function",
"sets",
"the",
"fax",
"job",
"sender",
"name",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java#L246-L256 |
js-lib-com/commons | src/main/java/js/util/Params.java | Params.isFile | public static void isFile(File parameter, String name) throws IllegalArgumentException {
"""
Check if file parameter is an existing ordinary file, not a directory. This validator throws illegal argument if given
file does not exist or is not an ordinary file.
@param parameter invocation file parameter,
@param... | java | public static void isFile(File parameter, String name) throws IllegalArgumentException {
if (parameter == null || !parameter.exists() || parameter.isDirectory()) {
throw new IllegalArgumentException(String.format("%s |%s| is missing or is a directory.", name, parameter.getAbsolutePath()));
}
} | [
"public",
"static",
"void",
"isFile",
"(",
"File",
"parameter",
",",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"parameter",
"==",
"null",
"||",
"!",
"parameter",
".",
"exists",
"(",
")",
"||",
"parameter",
".",
"isDirectory... | Check if file parameter is an existing ordinary file, not a directory. This validator throws illegal argument if given
file does not exist or is not an ordinary file.
@param parameter invocation file parameter,
@param name parameter name.
@throws IllegalArgumentException if <code>parameter</code> file is null or does ... | [
"Check",
"if",
"file",
"parameter",
"is",
"an",
"existing",
"ordinary",
"file",
"not",
"a",
"directory",
".",
"This",
"validator",
"throws",
"illegal",
"argument",
"if",
"given",
"file",
"does",
"not",
"exist",
"or",
"is",
"not",
"an",
"ordinary",
"file",
... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Params.java#L176-L180 |
Axway/Grapes | utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java | GrapesClient.postBuildInfo | public void postBuildInfo(final String moduleName, final String moduleVersion, final Map<String, String> buildInfo, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
"""
Post a build info to the server
@param moduleName String
@param moduleVersion String
... | java | public void postBuildInfo(final String moduleName, final String moduleVersion, final Map<String, String> buildInfo, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
final Client client = getClient(user, password);
final WebResource resource = clien... | [
"public",
"void",
"postBuildInfo",
"(",
"final",
"String",
"moduleName",
",",
"final",
"String",
"moduleVersion",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"buildInfo",
",",
"final",
"String",
"user",
",",
"final",
"String",
"password",
")",
"t... | Post a build info to the server
@param moduleName String
@param moduleVersion String
@param buildInfo Map<String,String>
@param user String
@param password String
@throws GrapesCommunicationException
@throws javax.naming.AuthenticationException | [
"Post",
"a",
"build",
"info",
"to",
"the",
"server"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java#L130-L143 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseQuantifierExpression | private Expr parseQuantifierExpression(Token lookahead, EnclosingScope scope, boolean terminated) {
"""
Parse a quantifier expression, which is of the form:
<pre>
QuantExpr ::= ("no" | "some" | "all")
'{'
Identifier "in" Expr (',' Identifier "in" Expr)+
'|' LogicalExpr
'}'
</pre>
@param scope
The encl... | java | private Expr parseQuantifierExpression(Token lookahead, EnclosingScope scope, boolean terminated) {
int start = index - 1;
scope = scope.newEnclosingScope();
match(LeftCurly);
// Parse one or more source variables / expressions
Tuple<Decl.Variable> parameters = parseQuantifierParameters(scope);
// Parse con... | [
"private",
"Expr",
"parseQuantifierExpression",
"(",
"Token",
"lookahead",
",",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"int",
"start",
"=",
"index",
"-",
"1",
";",
"scope",
"=",
"scope",
".",
"newEnclosingScope",
"(",
")",
";",
"m... | Parse a quantifier expression, which is of the form:
<pre>
QuantExpr ::= ("no" | "some" | "all")
'{'
Identifier "in" Expr (',' Identifier "in" Expr)+
'|' LogicalExpr
'}'
</pre>
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
inden... | [
"Parse",
"a",
"quantifier",
"expression",
"which",
"is",
"of",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L1932-L1950 |
Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/utils/DimenUtils.java | DimenUtils.pixelsFromSpResource | public static float pixelsFromSpResource(Context context, @DimenRes int sizeRes) {
"""
Resolves a dimension resource that uses scaled pixels
@param context the current context
@param sizeRes the dimension resource holding an SP value
@return the text size in pixels
"""
final Resources res = contex... | java | public static float pixelsFromSpResource(Context context, @DimenRes int sizeRes) {
final Resources res = context.getResources();
return res.getDimension(sizeRes) / res.getDisplayMetrics().density;
} | [
"public",
"static",
"float",
"pixelsFromSpResource",
"(",
"Context",
"context",
",",
"@",
"DimenRes",
"int",
"sizeRes",
")",
"{",
"final",
"Resources",
"res",
"=",
"context",
".",
"getResources",
"(",
")",
";",
"return",
"res",
".",
"getDimension",
"(",
"siz... | Resolves a dimension resource that uses scaled pixels
@param context the current context
@param sizeRes the dimension resource holding an SP value
@return the text size in pixels | [
"Resolves",
"a",
"dimension",
"resource",
"that",
"uses",
"scaled",
"pixels"
] | train | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/utils/DimenUtils.java#L19-L22 |
jamesagnew/hapi-fhir | hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Capitalize.java | Capitalize.apply | @Override
public Object apply(Object value, Object... params) {
"""
/*
(Object) capitalize(input)
capitalize words in the input sentence
"""
String original = super.asString(value);
if (original.isEmpty()) {
return original;
}
char first = original.charAt(... | java | @Override
public Object apply(Object value, Object... params) {
String original = super.asString(value);
if (original.isEmpty()) {
return original;
}
char first = original.charAt(0);
return Character.toUpperCase(first) + original.substring(1);
} | [
"@",
"Override",
"public",
"Object",
"apply",
"(",
"Object",
"value",
",",
"Object",
"...",
"params",
")",
"{",
"String",
"original",
"=",
"super",
".",
"asString",
"(",
"value",
")",
";",
"if",
"(",
"original",
".",
"isEmpty",
"(",
")",
")",
"{",
"r... | /*
(Object) capitalize(input)
capitalize words in the input sentence | [
"/",
"*",
"(",
"Object",
")",
"capitalize",
"(",
"input",
")"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Capitalize.java#L10-L22 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/convert/PercentConverter.java | PercentConverter.setString | public int setString(String strValue, boolean bDisplayOption, int iMoveMode) {
"""
Convert and move string to this field.
@param strString the state to set the data to.
@param bDisplayOption Display the data on the screen if true.
@param iMoveMode INIT, SCREEN, or READ move mode.
@return The error code (or NOR... | java | public int setString(String strValue, boolean bDisplayOption, int iMoveMode)
{
NumberField numberField = (NumberField)this.getField();
if ((strValue == null) || (strValue.length() == 0))
return super.setString(strValue, bDisplayOption, iMoveMode); // Don't trip change or display
... | [
"public",
"int",
"setString",
"(",
"String",
"strValue",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"NumberField",
"numberField",
"=",
"(",
"NumberField",
")",
"this",
".",
"getField",
"(",
")",
";",
"if",
"(",
"(",
"strValue",
"=... | Convert and move string to this field.
@param strString the state to set the data to.
@param bDisplayOption Display the data on the screen if true.
@param iMoveMode INIT, SCREEN, or READ move mode.
@return The error code (or NORMAL_RETURN). | [
"Convert",
"and",
"move",
"string",
"to",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/convert/PercentConverter.java#L68-L84 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_PrecisionReducer.java | ST_PrecisionReducer.precisionReducer | public static Geometry precisionReducer(Geometry geometry, int nbDec) throws SQLException {
"""
Reduce the geometry precision. Decimal_Place is the number of decimals to
keep.
@param geometry
@param nbDec
@return
@throws SQLException
"""
if(geometry == null){
return null;
}
... | java | public static Geometry precisionReducer(Geometry geometry, int nbDec) throws SQLException {
if(geometry == null){
return null;
}
if (nbDec < 0) {
throw new SQLException("Decimal_places has to be >= 0.");
}
PrecisionModel pm = new PrecisionModel(scaleFactor... | [
"public",
"static",
"Geometry",
"precisionReducer",
"(",
"Geometry",
"geometry",
",",
"int",
"nbDec",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"nbDec",
"<",
"0",
")",
"{",
... | Reduce the geometry precision. Decimal_Place is the number of decimals to
keep.
@param geometry
@param nbDec
@return
@throws SQLException | [
"Reduce",
"the",
"geometry",
"precision",
".",
"Decimal_Place",
"is",
"the",
"number",
"of",
"decimals",
"to",
"keep",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_PrecisionReducer.java#L54-L64 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/AnnotationUtils.java | AnnotationUtils.memberEquals | @GwtIncompatible("incompatible method")
private static boolean memberEquals(final Class<?> type, final Object o1, final Object o2) {
"""
Helper method for checking whether two objects of the given type are
equal. This method is used to compare the parameters of two annotation
instances.
@param type the ty... | java | @GwtIncompatible("incompatible method")
private static boolean memberEquals(final Class<?> type, final Object o1, final Object o2) {
if (o1 == o2) {
return true;
}
if (o1 == null || o2 == null) {
return false;
}
if (type.isArray()) {
return... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"private",
"static",
"boolean",
"memberEquals",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"Object",
"o1",
",",
"final",
"Object",
"o2",
")",
"{",
"if",
"(",
"o1",
"==",
"o2",
... | Helper method for checking whether two objects of the given type are
equal. This method is used to compare the parameters of two annotation
instances.
@param type the type of the objects to be compared
@param o1 the first object
@param o2 the second object
@return a flag whether these objects are equal | [
"Helper",
"method",
"for",
"checking",
"whether",
"two",
"objects",
"of",
"the",
"given",
"type",
"are",
"equal",
".",
"This",
"method",
"is",
"used",
"to",
"compare",
"the",
"parameters",
"of",
"two",
"annotation",
"instances",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/AnnotationUtils.java#L269-L284 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/javax/crypto/KeyAgreement.java | KeyAgreement.generateSecret | public final int generateSecret(byte[] sharedSecret, int offset)
throws IllegalStateException, ShortBufferException {
"""
Generates the shared secret, and places it into the buffer
<code>sharedSecret</code>, beginning at <code>offset</code> inclusive.
<p>If the <code>sharedSecret</code> buffer is too s... | java | public final int generateSecret(byte[] sharedSecret, int offset)
throws IllegalStateException, ShortBufferException
{
chooseFirstProvider();
return spi.engineGenerateSecret(sharedSecret, offset);
} | [
"public",
"final",
"int",
"generateSecret",
"(",
"byte",
"[",
"]",
"sharedSecret",
",",
"int",
"offset",
")",
"throws",
"IllegalStateException",
",",
"ShortBufferException",
"{",
"chooseFirstProvider",
"(",
")",
";",
"return",
"spi",
".",
"engineGenerateSecret",
"... | Generates the shared secret, and places it into the buffer
<code>sharedSecret</code>, beginning at <code>offset</code> inclusive.
<p>If the <code>sharedSecret</code> buffer is too small to hold the
result, a <code>ShortBufferException</code> is thrown.
In this case, this call should be repeated with a larger output bu... | [
"Generates",
"the",
"shared",
"secret",
"and",
"places",
"it",
"into",
"the",
"buffer",
"<code",
">",
"sharedSecret<",
"/",
"code",
">",
"beginning",
"at",
"<code",
">",
"offset<",
"/",
"code",
">",
"inclusive",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/javax/crypto/KeyAgreement.java#L607-L612 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java | CassandraSchemaManager.isCounterColumnType | private boolean isCounterColumnType(TableInfo tableInfo, String defaultValidationClass) {
"""
Checks if is counter column type.
@param tableInfo
the table info
@param defaultValidationClass
the default validation class
@return true, if is counter column type
"""
return (csmd != null && csmd.isCo... | java | private boolean isCounterColumnType(TableInfo tableInfo, String defaultValidationClass)
{
return (csmd != null && csmd.isCounterColumn(databaseName, tableInfo.getTableName()))
|| (defaultValidationClass != null
&& (defaultValidationClass.equalsIgnoreCase(CounterColumn... | [
"private",
"boolean",
"isCounterColumnType",
"(",
"TableInfo",
"tableInfo",
",",
"String",
"defaultValidationClass",
")",
"{",
"return",
"(",
"csmd",
"!=",
"null",
"&&",
"csmd",
".",
"isCounterColumn",
"(",
"databaseName",
",",
"tableInfo",
".",
"getTableName",
"(... | Checks if is counter column type.
@param tableInfo
the table info
@param defaultValidationClass
the default validation class
@return true, if is counter column type | [
"Checks",
"if",
"is",
"counter",
"column",
"type",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L3225-L3232 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/markup/ResponsiveImageMediaMarkupBuilder.java | ResponsiveImageMediaMarkupBuilder.toReponsiveImageSource | @SuppressWarnings("null")
protected JSONObject toReponsiveImageSource(Media media, Rendition rendition) {
"""
Build JSON metadata for one rendition as image source.
@param media Media
@param rendition Rendition
@return JSON metadata
"""
try {
JSONObject source = new JSONObject();
MediaForm... | java | @SuppressWarnings("null")
protected JSONObject toReponsiveImageSource(Media media, Rendition rendition) {
try {
JSONObject source = new JSONObject();
MediaFormat mediaFormat = rendition.getMediaFormat();
source.put(MediaNameConstants.PROP_BREAKPOINT, mediaFormat.getProperties().get(MediaNameCons... | [
"@",
"SuppressWarnings",
"(",
"\"null\"",
")",
"protected",
"JSONObject",
"toReponsiveImageSource",
"(",
"Media",
"media",
",",
"Rendition",
"rendition",
")",
"{",
"try",
"{",
"JSONObject",
"source",
"=",
"new",
"JSONObject",
"(",
")",
";",
"MediaFormat",
"media... | Build JSON metadata for one rendition as image source.
@param media Media
@param rendition Rendition
@return JSON metadata | [
"Build",
"JSON",
"metadata",
"for",
"one",
"rendition",
"as",
"image",
"source",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/markup/ResponsiveImageMediaMarkupBuilder.java#L131-L143 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/Broadcast.java | Broadcast.lte | public static INDArray lte(INDArray x, INDArray y, INDArray z, int... dimensions) {
"""
Broadcast less than or equal to op. See: {@link BroadcastLessThanOrEqual}
"""
if(dimensions == null || dimensions.length == 0) {
validateShapesNoDimCase(x,y,z);
return Nd4j.getExecutioner().e... | java | public static INDArray lte(INDArray x, INDArray y, INDArray z, int... dimensions) {
if(dimensions == null || dimensions.length == 0) {
validateShapesNoDimCase(x,y,z);
return Nd4j.getExecutioner().exec(new OldLessThanOrEqual(x,y,z));
}
return Nd4j.getExecutioner().exec(ne... | [
"public",
"static",
"INDArray",
"lte",
"(",
"INDArray",
"x",
",",
"INDArray",
"y",
",",
"INDArray",
"z",
",",
"int",
"...",
"dimensions",
")",
"{",
"if",
"(",
"dimensions",
"==",
"null",
"||",
"dimensions",
".",
"length",
"==",
"0",
")",
"{",
"validate... | Broadcast less than or equal to op. See: {@link BroadcastLessThanOrEqual} | [
"Broadcast",
"less",
"than",
"or",
"equal",
"to",
"op",
".",
"See",
":",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/Broadcast.java#L125-L132 |
centic9/commons-dost | src/main/java/org/dstadler/commons/svn/SVNCommands.java | SVNCommands.getBranchRevision | public static long getBranchRevision(String branch, String baseUrl) throws IOException {
"""
Return the revision from which the branch was branched off.
@param branch The name of the branch including the path to the branch, e.g. branches/4.2.x
@param baseUrl The SVN url to connect to
@return The revisio... | java | public static long getBranchRevision(String branch, String baseUrl) throws IOException {
CommandLine cmdLine = new CommandLine(SVN_CMD);
cmdLine.addArgument(CMD_LOG);
cmdLine.addArgument(OPT_XML);
addDefaultArguments(cmdLine, null, null);
cmdLine.addArgument("-v");
cmdLin... | [
"public",
"static",
"long",
"getBranchRevision",
"(",
"String",
"branch",
",",
"String",
"baseUrl",
")",
"throws",
"IOException",
"{",
"CommandLine",
"cmdLine",
"=",
"new",
"CommandLine",
"(",
"SVN_CMD",
")",
";",
"cmdLine",
".",
"addArgument",
"(",
"CMD_LOG",
... | Return the revision from which the branch was branched off.
@param branch The name of the branch including the path to the branch, e.g. branches/4.2.x
@param baseUrl The SVN url to connect to
@return The revision where the branch was branched off from it's parent branch.
@throws IOException Execution of the SVN ... | [
"Return",
"the",
"revision",
"from",
"which",
"the",
"branch",
"was",
"branched",
"off",
"."
] | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/svn/SVNCommands.java#L274-L299 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java | ExcelUtil.getReader | public static ExcelReader getReader(InputStream bookStream, boolean closeAfterRead) {
"""
获取Excel读取器,通过调用{@link ExcelReader}的read或readXXX方法读取Excel内容<br>
默认调用第一个sheet
@param bookStream Excel文件的流
@param closeAfterRead 读取结束是否关闭流
@return {@link ExcelReader}
@since 4.0.3
"""
try {
return getReader(boo... | java | public static ExcelReader getReader(InputStream bookStream, boolean closeAfterRead) {
try {
return getReader(bookStream, 0, closeAfterRead);
} catch (NoClassDefFoundError e) {
throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG);
}
} | [
"public",
"static",
"ExcelReader",
"getReader",
"(",
"InputStream",
"bookStream",
",",
"boolean",
"closeAfterRead",
")",
"{",
"try",
"{",
"return",
"getReader",
"(",
"bookStream",
",",
"0",
",",
"closeAfterRead",
")",
";",
"}",
"catch",
"(",
"NoClassDefFoundErro... | 获取Excel读取器,通过调用{@link ExcelReader}的read或readXXX方法读取Excel内容<br>
默认调用第一个sheet
@param bookStream Excel文件的流
@param closeAfterRead 读取结束是否关闭流
@return {@link ExcelReader}
@since 4.0.3 | [
"获取Excel读取器,通过调用",
"{",
"@link",
"ExcelReader",
"}",
"的read或readXXX方法读取Excel内容<br",
">",
"默认调用第一个sheet"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java#L273-L279 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/HostAccessManager.java | HostAccessManager.changeAccessMode | public void changeAccessMode(String principal, boolean isGroup, HostAccessMode accessMode) throws AuthMinimumAdminPermission, InvalidArgument, RuntimeFault, SecurityError, UserNotFound, RemoteException {
"""
Update the access mode for a user or group.
If the host is in lockdown mode, this operation is allowed onl... | java | public void changeAccessMode(String principal, boolean isGroup, HostAccessMode accessMode) throws AuthMinimumAdminPermission, InvalidArgument, RuntimeFault, SecurityError, UserNotFound, RemoteException {
getVimService().changeAccessMode(getMOR(), principal, isGroup, accessMode);
} | [
"public",
"void",
"changeAccessMode",
"(",
"String",
"principal",
",",
"boolean",
"isGroup",
",",
"HostAccessMode",
"accessMode",
")",
"throws",
"AuthMinimumAdminPermission",
",",
"InvalidArgument",
",",
"RuntimeFault",
",",
"SecurityError",
",",
"UserNotFound",
",",
... | Update the access mode for a user or group.
If the host is in lockdown mode, this operation is allowed only on users in the exceptions list - see
{@link com.vmware.vim25.mo.HostAccessManager#queryLockdownExceptions QueryLockdownExceptions}, and trying to
change the access mode of other users or groups will fail with Se... | [
"Update",
"the",
"access",
"mode",
"for",
"a",
"user",
"or",
"group",
".",
"If",
"the",
"host",
"is",
"in",
"lockdown",
"mode",
"this",
"operation",
"is",
"allowed",
"only",
"on",
"users",
"in",
"the",
"exceptions",
"list",
"-",
"see",
"{",
"@link",
"c... | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/HostAccessManager.java#L61-L63 |
rundeck/rundeck | core/src/main/java/com/dtolabs/utils/Mapper.java | Mapper.mapEntries | public static Map mapEntries(Mapper mapper, Map map) {
"""
Create a new Map by mapping all values from the original map and mapping all keys.
@param mapper a Mapper to map the values and keys
@param map a Map
@return a new Map with values mapped
"""
return mapEntries(mapper, map, false);
} | java | public static Map mapEntries(Mapper mapper, Map map) {
return mapEntries(mapper, map, false);
} | [
"public",
"static",
"Map",
"mapEntries",
"(",
"Mapper",
"mapper",
",",
"Map",
"map",
")",
"{",
"return",
"mapEntries",
"(",
"mapper",
",",
"map",
",",
"false",
")",
";",
"}"
] | Create a new Map by mapping all values from the original map and mapping all keys.
@param mapper a Mapper to map the values and keys
@param map a Map
@return a new Map with values mapped | [
"Create",
"a",
"new",
"Map",
"by",
"mapping",
"all",
"values",
"from",
"the",
"original",
"map",
"and",
"mapping",
"all",
"keys",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/Mapper.java#L449-L451 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/spelling/SpellingCheckRule.java | SpellingCheckRule.ignoreWord | protected boolean ignoreWord(List<String> words, int idx) throws IOException {
"""
Returns true iff the word at the given position should be ignored by the spell checker.
If possible, use {@link #ignoreToken(AnalyzedTokenReadings[], int)} instead.
@since 2.6
"""
return ignoreWord(words.get(idx));
} | java | protected boolean ignoreWord(List<String> words, int idx) throws IOException {
return ignoreWord(words.get(idx));
} | [
"protected",
"boolean",
"ignoreWord",
"(",
"List",
"<",
"String",
">",
"words",
",",
"int",
"idx",
")",
"throws",
"IOException",
"{",
"return",
"ignoreWord",
"(",
"words",
".",
"get",
"(",
"idx",
")",
")",
";",
"}"
] | Returns true iff the word at the given position should be ignored by the spell checker.
If possible, use {@link #ignoreToken(AnalyzedTokenReadings[], int)} instead.
@since 2.6 | [
"Returns",
"true",
"iff",
"the",
"word",
"at",
"the",
"given",
"position",
"should",
"be",
"ignored",
"by",
"the",
"spell",
"checker",
".",
"If",
"possible",
"use",
"{"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/spelling/SpellingCheckRule.java#L291-L293 |
liferay/com-liferay-commerce | commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java | CommerceVirtualOrderItemPersistenceImpl.findAll | @Override
public List<CommerceVirtualOrderItem> findAll(int start, int end) {
"""
Returns a range of all the commerce virtual order items.
<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... | java | @Override
public List<CommerceVirtualOrderItem> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceVirtualOrderItem",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce virtual order items.
<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 result in the set. Setting bot... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"virtual",
"order",
"items",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java#L2369-L2372 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/types/TimecodeRange.java | TimecodeRange.merge | public static TimecodeRange merge(TimecodeRange a, TimecodeRange b) {
"""
Produce a new Timecode range which includes all timecodes from <code>a</code> and <code>b</code>. This may result in
coverage
of additional timecodes if the two ranges do not overlap.
@param a
@param b
@return
"""
final Timeco... | java | public static TimecodeRange merge(TimecodeRange a, TimecodeRange b)
{
final Timecode start = TimecodeComparator.min(a.getStart(), b.getStart());
final Timecode end = TimecodeComparator.max(a.getEnd(), b.getEnd());
return new TimecodeRange(start, end);
} | [
"public",
"static",
"TimecodeRange",
"merge",
"(",
"TimecodeRange",
"a",
",",
"TimecodeRange",
"b",
")",
"{",
"final",
"Timecode",
"start",
"=",
"TimecodeComparator",
".",
"min",
"(",
"a",
".",
"getStart",
"(",
")",
",",
"b",
".",
"getStart",
"(",
")",
"... | Produce a new Timecode range which includes all timecodes from <code>a</code> and <code>b</code>. This may result in
coverage
of additional timecodes if the two ranges do not overlap.
@param a
@param b
@return | [
"Produce",
"a",
"new",
"Timecode",
"range",
"which",
"includes",
"all",
"timecodes",
"from",
"<code",
">",
"a<",
"/",
"code",
">",
"and",
"<code",
">",
"b<",
"/",
"code",
">",
".",
"This",
"may",
"result",
"in",
"coverage",
"of",
"additional",
"timecodes... | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/TimecodeRange.java#L183-L189 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/DevicesManagementApi.java | DevicesManagementApi.getTasksAsync | public com.squareup.okhttp.Call getTasksAsync(String dtid, Integer count, Integer offset, String status, String order, String sort, final ApiCallback<TaskListEnvelope> callback) throws ApiException {
"""
Returns the all the tasks for a device type. (asynchronously)
Returns the all the tasks for a device type.
@p... | java | public com.squareup.okhttp.Call getTasksAsync(String dtid, Integer count, Integer offset, String status, String order, String sort, final ApiCallback<TaskListEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListe... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"getTasksAsync",
"(",
"String",
"dtid",
",",
"Integer",
"count",
",",
"Integer",
"offset",
",",
"String",
"status",
",",
"String",
"order",
",",
"String",
"sort",
",",
"final",
"ApiCallback",
"<... | Returns the all the tasks for a device type. (asynchronously)
Returns the all the tasks for a device type.
@param dtid Device Type ID. (required)
@param count Max results count. (optional)
@param offset Result starting offset. (optional)
@param status Status filter. Comma-separated statuses. (optional)
@param order Sor... | [
"Returns",
"the",
"all",
"the",
"tasks",
"for",
"a",
"device",
"type",
".",
"(",
"asynchronously",
")",
"Returns",
"the",
"all",
"the",
"tasks",
"for",
"a",
"device",
"type",
"."
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DevicesManagementApi.java#L1315-L1340 |
languagetool-org/languagetool | languagetool-server/src/main/java/org/languagetool/server/PipelinePool.java | PipelinePool.createPipeline | Pipeline createPipeline(Language lang, Language motherTongue, TextChecker.QueryParams params, UserConfig userConfig)
throws Exception {
"""
Create a JLanguageTool instance for a specific language, mother tongue, and rule configuration.
Uses Pipeline wrapper to safely share objects
@param lang the language ... | java | Pipeline createPipeline(Language lang, Language motherTongue, TextChecker.QueryParams params, UserConfig userConfig)
throws Exception { // package-private for mocking
Pipeline lt = new Pipeline(lang, params.altLanguages, motherTongue, cache, userConfig);
lt.setMaxErrorsPerWordRate(config.getMaxErrorsPerWord... | [
"Pipeline",
"createPipeline",
"(",
"Language",
"lang",
",",
"Language",
"motherTongue",
",",
"TextChecker",
".",
"QueryParams",
"params",
",",
"UserConfig",
"userConfig",
")",
"throws",
"Exception",
"{",
"// package-private for mocking",
"Pipeline",
"lt",
"=",
"new",
... | Create a JLanguageTool instance for a specific language, mother tongue, and rule configuration.
Uses Pipeline wrapper to safely share objects
@param lang the language to be used
@param motherTongue the user's mother tongue or {@code null} | [
"Create",
"a",
"JLanguageTool",
"instance",
"for",
"a",
"specific",
"language",
"mother",
"tongue",
"and",
"rule",
"configuration",
".",
"Uses",
"Pipeline",
"wrapper",
"to",
"safely",
"share",
"objects"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-server/src/main/java/org/languagetool/server/PipelinePool.java#L185-L208 |
wildfly-extras/wildfly-camel | subsystem/core/src/main/java/org/wildfly/extension/camel/service/CamelEndpointDeployerService.java | CamelEndpointDeployerService.deploy | public void deploy(URI uri, final HttpHandler routingHandler) {
"""
Exposes an HTTP endpoint that will be served by the given {@link HttpHandler} under the given {@link URI}'s path.
@param uri determines the path and protocol under which the HTTP endpoint should be exposed
@param routingHandler an {@link HttpH... | java | public void deploy(URI uri, final HttpHandler routingHandler) {
final Set<Deployment> availableDeployments = hostSupplier.getValue().getDeployments();
if (!availableDeployments.stream().anyMatch(
deployment -> deployment.getHandler() instanceof CamelEndpointDeployerHandler
... | [
"public",
"void",
"deploy",
"(",
"URI",
"uri",
",",
"final",
"HttpHandler",
"routingHandler",
")",
"{",
"final",
"Set",
"<",
"Deployment",
">",
"availableDeployments",
"=",
"hostSupplier",
".",
"getValue",
"(",
")",
".",
"getDeployments",
"(",
")",
";",
"if"... | Exposes an HTTP endpoint that will be served by the given {@link HttpHandler} under the given {@link URI}'s path.
@param uri determines the path and protocol under which the HTTP endpoint should be exposed
@param routingHandler an {@link HttpHandler} to use for handling HTTP requests sent to the given
{@link URI}'s pa... | [
"Exposes",
"an",
"HTTP",
"endpoint",
"that",
"will",
"be",
"served",
"by",
"the",
"given",
"{",
"@link",
"HttpHandler",
"}",
"under",
"the",
"given",
"{",
"@link",
"URI",
"}",
"s",
"path",
"."
] | train | https://github.com/wildfly-extras/wildfly-camel/blob/9ebd7e28574f277a6d5b583e8a4c357e1538c370/subsystem/core/src/main/java/org/wildfly/extension/camel/service/CamelEndpointDeployerService.java#L440-L455 |
EsotericSoftware/jsonbeans | src/com/esotericsoftware/jsonbeans/Json.java | Json.writeValue | public void writeValue (Object value) {
"""
Writes the value, without writing the class of the object.
@param value May be null.
"""
if (value == null)
writeValue(value, null, null);
else
writeValue(value, value.getClass(), null);
} | java | public void writeValue (Object value) {
if (value == null)
writeValue(value, null, null);
else
writeValue(value, value.getClass(), null);
} | [
"public",
"void",
"writeValue",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"writeValue",
"(",
"value",
",",
"null",
",",
"null",
")",
";",
"else",
"writeValue",
"(",
"value",
",",
"value",
".",
"getClass",
"(",
")",
",",... | Writes the value, without writing the class of the object.
@param value May be null. | [
"Writes",
"the",
"value",
"without",
"writing",
"the",
"class",
"of",
"the",
"object",
"."
] | train | https://github.com/EsotericSoftware/jsonbeans/blob/ff4502d0ff86cc77aa5c61d47371d0c66c14fe2f/src/com/esotericsoftware/jsonbeans/Json.java#L423-L428 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cart_cartId_domainTransfer_GET | public ArrayList<OvhProductInformation> cart_cartId_domainTransfer_GET(String cartId, String domain) throws IOException {
"""
Get informations about a domain name transfer
REST: GET /order/cart/{cartId}/domainTransfer
@param cartId [required] Cart identifier
@param domain [required] Domain name requested
A... | java | public ArrayList<OvhProductInformation> cart_cartId_domainTransfer_GET(String cartId, String domain) throws IOException {
String qPath = "/order/cart/{cartId}/domainTransfer";
StringBuilder sb = path(qPath, cartId);
query(sb, "domain", domain);
String resp = execN(qPath, "GET", sb.toString(), null);
return co... | [
"public",
"ArrayList",
"<",
"OvhProductInformation",
">",
"cart_cartId_domainTransfer_GET",
"(",
"String",
"cartId",
",",
"String",
"domain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cart/{cartId}/domainTransfer\"",
";",
"StringBuilder",
"sb",
... | Get informations about a domain name transfer
REST: GET /order/cart/{cartId}/domainTransfer
@param cartId [required] Cart identifier
@param domain [required] Domain name requested
API beta | [
"Get",
"informations",
"about",
"a",
"domain",
"name",
"transfer"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L10949-L10955 |
haifengl/smile | core/src/main/java/smile/taxonomy/Taxonomy.java | Taxonomy.lowestCommonAncestor | public Concept lowestCommonAncestor(Concept v, Concept w) {
"""
Returns the lowest common ancestor (LCA) of concepts v and w. The lowest
common ancestor is defined between two nodes v and w as the lowest node
that has both v and w as descendants (where we allow a node to be a
descendant of itself).
"""
... | java | public Concept lowestCommonAncestor(Concept v, Concept w) {
if (v.taxonomy != w.taxonomy) {
throw new IllegalArgumentException("Concepts are not from the same taxonomy.");
}
List<Concept> vPath = v.getPathFromRoot();
List<Concept> wPath = w.getPathFromRoot();
Iterat... | [
"public",
"Concept",
"lowestCommonAncestor",
"(",
"Concept",
"v",
",",
"Concept",
"w",
")",
"{",
"if",
"(",
"v",
".",
"taxonomy",
"!=",
"w",
".",
"taxonomy",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Concepts are not from the same taxonomy.\"",... | Returns the lowest common ancestor (LCA) of concepts v and w. The lowest
common ancestor is defined between two nodes v and w as the lowest node
that has both v and w as descendants (where we allow a node to be a
descendant of itself). | [
"Returns",
"the",
"lowest",
"common",
"ancestor",
"(",
"LCA",
")",
"of",
"concepts",
"v",
"and",
"w",
".",
"The",
"lowest",
"common",
"ancestor",
"is",
"defined",
"between",
"two",
"nodes",
"v",
"and",
"w",
"as",
"the",
"lowest",
"node",
"that",
"has",
... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/taxonomy/Taxonomy.java#L123-L147 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/handlers/FileStatusTaskPropertyHandler.java | FileStatusTaskPropertyHandler.taskProperty | private void taskProperty(RESTRequest request, RESTResponse response) {
"""
Returns the value of the property. An IllegalArgument exception is thrown if the value is not an instance of java.lang.String.
"""
String taskID = RESTHelper.getRequiredParam(request, APIConstants.PARAM_TASK_ID);
String... | java | private void taskProperty(RESTRequest request, RESTResponse response) {
String taskID = RESTHelper.getRequiredParam(request, APIConstants.PARAM_TASK_ID);
String property = RESTHelper.getRequiredParam(request, APIConstants.PARAM_PROPERTY);
String taskPropertyText = getMultipleRoutingHelper().get... | [
"private",
"void",
"taskProperty",
"(",
"RESTRequest",
"request",
",",
"RESTResponse",
"response",
")",
"{",
"String",
"taskID",
"=",
"RESTHelper",
".",
"getRequiredParam",
"(",
"request",
",",
"APIConstants",
".",
"PARAM_TASK_ID",
")",
";",
"String",
"property",
... | Returns the value of the property. An IllegalArgument exception is thrown if the value is not an instance of java.lang.String. | [
"Returns",
"the",
"value",
"of",
"the",
"property",
".",
"An",
"IllegalArgument",
"exception",
"is",
"thrown",
"if",
"the",
"value",
"is",
"not",
"an",
"instance",
"of",
"java",
".",
"lang",
".",
"String",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/handlers/FileStatusTaskPropertyHandler.java#L97-L103 |
thorntail/thorntail | core/container/src/main/java/org/wildfly/swarm/internal/wildfly/SelfContainedContainer.java | SelfContainedContainer.start | public ServiceContainer start(final List<ModelNode> containerDefinition, Collection<ServiceActivator> additionalActivators) throws ExecutionException, InterruptedException, ModuleLoadException {
"""
The main method.
@param containerDefinition The container definition.
"""
final long startTime = Sys... | java | public ServiceContainer start(final List<ModelNode> containerDefinition, Collection<ServiceActivator> additionalActivators) throws ExecutionException, InterruptedException, ModuleLoadException {
final long startTime = System.currentTimeMillis();
if (java.util.logging.LogManager.getLogManager().getCla... | [
"public",
"ServiceContainer",
"start",
"(",
"final",
"List",
"<",
"ModelNode",
">",
"containerDefinition",
",",
"Collection",
"<",
"ServiceActivator",
">",
"additionalActivators",
")",
"throws",
"ExecutionException",
",",
"InterruptedException",
",",
"ModuleLoadException"... | The main method.
@param containerDefinition The container definition. | [
"The",
"main",
"method",
"."
] | train | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/container/src/main/java/org/wildfly/swarm/internal/wildfly/SelfContainedContainer.java#L95-L145 |
banq/jdonframework | JdonAccessory/jdon-struts1x/src/main/java/com/jdon/strutsutil/ModelViewAction.java | ModelViewAction.execute | public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response)
throws Exception {
"""
accept the form submit, action parameter must be : create or edit; if
not, will directly forward the jsp page mapping for the action value;
"""
... | java | public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response)
throws Exception {
Debug.logVerbose("[JdonFramework]--> enter ModelViewAction process ", module);
intContext(this.getServlet().getServletContext());
ModelForm modelFo... | [
"public",
"ActionForward",
"execute",
"(",
"ActionMapping",
"actionMapping",
",",
"ActionForm",
"actionForm",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"Exception",
"{",
"Debug",
".",
"logVerbose",
"(",
"\"[JdonFramewor... | accept the form submit, action parameter must be : create or edit; if
not, will directly forward the jsp page mapping for the action value; | [
"accept",
"the",
"form",
"submit",
"action",
"parameter",
"must",
"be",
":",
"create",
"or",
"edit",
";",
"if",
"not",
"will",
"directly",
"forward",
"the",
"jsp",
"page",
"mapping",
"for",
"the",
"action",
"value",
";"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-struts1x/src/main/java/com/jdon/strutsutil/ModelViewAction.java#L65-L98 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/svd/implicitqr/SvdImplicitQrAlgorithm_DDRM.java | SvdImplicitQrAlgorithm_DDRM.performImplicitSingleStep | public void performImplicitSingleStep(double scale , double lambda , boolean byAngle) {
"""
Given the lambda value perform an implicit QR step on the matrix.
B^T*B-lambda*I
@param lambda Stepping factor.
"""
createBulge(x1,lambda,scale,byAngle);
for( int i = x1; i < x2-1 && bulge != 0.0;... | java | public void performImplicitSingleStep(double scale , double lambda , boolean byAngle) {
createBulge(x1,lambda,scale,byAngle);
for( int i = x1; i < x2-1 && bulge != 0.0; i++ ) {
removeBulgeLeft(i,true);
if( bulge == 0 )
break;
removeBulgeRight(i);
... | [
"public",
"void",
"performImplicitSingleStep",
"(",
"double",
"scale",
",",
"double",
"lambda",
",",
"boolean",
"byAngle",
")",
"{",
"createBulge",
"(",
"x1",
",",
"lambda",
",",
"scale",
",",
"byAngle",
")",
";",
"for",
"(",
"int",
"i",
"=",
"x1",
";",
... | Given the lambda value perform an implicit QR step on the matrix.
B^T*B-lambda*I
@param lambda Stepping factor. | [
"Given",
"the",
"lambda",
"value",
"perform",
"an",
"implicit",
"QR",
"step",
"on",
"the",
"matrix",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/svd/implicitqr/SvdImplicitQrAlgorithm_DDRM.java#L356-L370 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.invokeConstructor | public MethodHandle invokeConstructor(MethodHandles.Lookup lookup, Class<?> target) throws NoSuchMethodException, IllegalAccessException {
"""
Apply the chain of transforms and bind them to a constructor specified
using the end signature plus the given class. The constructor will
be retrieved using the given Loo... | java | public MethodHandle invokeConstructor(MethodHandles.Lookup lookup, Class<?> target) throws NoSuchMethodException, IllegalAccessException {
return invoke(lookup.findConstructor(target, type().changeReturnType(void.class)));
} | [
"public",
"MethodHandle",
"invokeConstructor",
"(",
"MethodHandles",
".",
"Lookup",
"lookup",
",",
"Class",
"<",
"?",
">",
"target",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
"{",
"return",
"invoke",
"(",
"lookup",
".",
"findConstructor"... | Apply the chain of transforms and bind them to a constructor specified
using the end signature plus the given class. The constructor will
be retrieved using the given Lookup and must match the end signature's
arguments exactly.
If the final handle's type does not exactly match the initial type for
this Binder, an addi... | [
"Apply",
"the",
"chain",
"of",
"transforms",
"and",
"bind",
"them",
"to",
"a",
"constructor",
"specified",
"using",
"the",
"end",
"signature",
"plus",
"the",
"given",
"class",
".",
"The",
"constructor",
"will",
"be",
"retrieved",
"using",
"the",
"given",
"Lo... | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1342-L1344 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java | KeyValueHandler.handleTouchRequest | private static BinaryMemcacheRequest handleTouchRequest(final ChannelHandlerContext ctx, final TouchRequest msg) {
"""
Encodes a {@link TouchRequest} into its lower level representation.
@return a ready {@link BinaryMemcacheRequest}.
"""
ByteBuf extras = ctx.alloc().buffer();
extras.writeInt... | java | private static BinaryMemcacheRequest handleTouchRequest(final ChannelHandlerContext ctx, final TouchRequest msg) {
ByteBuf extras = ctx.alloc().buffer();
extras.writeInt(msg.expiry());
byte[] key = msg.keyBytes();
short keyLength = (short) key.length;
byte extrasLength = (byte) ... | [
"private",
"static",
"BinaryMemcacheRequest",
"handleTouchRequest",
"(",
"final",
"ChannelHandlerContext",
"ctx",
",",
"final",
"TouchRequest",
"msg",
")",
"{",
"ByteBuf",
"extras",
"=",
"ctx",
".",
"alloc",
"(",
")",
".",
"buffer",
"(",
")",
";",
"extras",
".... | Encodes a {@link TouchRequest} into its lower level representation.
@return a ready {@link BinaryMemcacheRequest}. | [
"Encodes",
"a",
"{",
"@link",
"TouchRequest",
"}",
"into",
"its",
"lower",
"level",
"representation",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java#L647-L661 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java | ContentKeyPoliciesInner.createOrUpdate | public ContentKeyPolicyInner createOrUpdate(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) {
"""
Create or update an Content Key Policy.
Create or update a Content Key Policy in the Media Services account.
@param resourceGroupName The name of the re... | java | public ContentKeyPolicyInner createOrUpdate(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).toBlocking().single().body();
} | [
"public",
"ContentKeyPolicyInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"contentKeyPolicyName",
",",
"ContentKeyPolicyInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resour... | Create or update an Content Key Policy.
Create or update a Content Key Policy in the Media Services account.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param contentKeyPolicyName The Content Key Policy name.
@param paramet... | [
"Create",
"or",
"update",
"an",
"Content",
"Key",
"Policy",
".",
"Create",
"or",
"update",
"a",
"Content",
"Key",
"Policy",
"in",
"the",
"Media",
"Services",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java#L474-L476 |
icode/ameba | src/main/java/ameba/core/Requests.java | Requests.readEntity | public static <T> T readEntity(Class<T> rawType, Annotation[] annotations) {
"""
<p>readEntity.</p>
@param rawType a {@link java.lang.Class} object.
@param annotations an array of {@link java.lang.annotation.Annotation} objects.
@param <T> a T object.
@return a T object.
"""
return ge... | java | public static <T> T readEntity(Class<T> rawType, Annotation[] annotations) {
return getRequest().readEntity(rawType, annotations);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"readEntity",
"(",
"Class",
"<",
"T",
">",
"rawType",
",",
"Annotation",
"[",
"]",
"annotations",
")",
"{",
"return",
"getRequest",
"(",
")",
".",
"readEntity",
"(",
"rawType",
",",
"annotations",
")",
";",
"}"
] | <p>readEntity.</p>
@param rawType a {@link java.lang.Class} object.
@param annotations an array of {@link java.lang.annotation.Annotation} objects.
@param <T> a T object.
@return a T object. | [
"<p",
">",
"readEntity",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/core/Requests.java#L626-L628 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ManagedPropertyPersistenceHelper.java | ManagedPropertyPersistenceHelper.generateParamParser | public static void generateParamParser(BindTypeContext context, String methodName, TypeName parameterTypeName, PersistType persistType) {
"""
Generate param parser.
@param context the context
@param methodName the method name
@param parameterTypeName the parameter type name
@param persistType the persist typ... | java | public static void generateParamParser(BindTypeContext context, String methodName, TypeName parameterTypeName, PersistType persistType) {
methodName = SQLiteDaoDefinition.PARAM_PARSER_PREFIX + methodName;
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(methodName).addJavadoc("for param $L parsing\n", m... | [
"public",
"static",
"void",
"generateParamParser",
"(",
"BindTypeContext",
"context",
",",
"String",
"methodName",
",",
"TypeName",
"parameterTypeName",
",",
"PersistType",
"persistType",
")",
"{",
"methodName",
"=",
"SQLiteDaoDefinition",
".",
"PARAM_PARSER_PREFIX",
"+... | Generate param parser.
@param context the context
@param methodName the method name
@param parameterTypeName the parameter type name
@param persistType the persist type | [
"Generate",
"param",
"parser",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ManagedPropertyPersistenceHelper.java#L313-L360 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BetterCFGBuilder2.java | BetterCFGBuilder2.handleExceptions | private void handleExceptions(Subroutine subroutine, InstructionHandle pei, BasicBlock etb) {
"""
Add exception edges for given instruction.
@param subroutine
the subroutine containing the instruction
@param pei
the instruction which throws an exception
@param etb
the exception thrower block (ETB) for the ... | java | private void handleExceptions(Subroutine subroutine, InstructionHandle pei, BasicBlock etb) {
etb.setExceptionThrower(pei);
// Remember whether or not a universal exception handler
// is reachable. If so, then we know that exceptions raised
// at this instruction cannot propagate out of... | [
"private",
"void",
"handleExceptions",
"(",
"Subroutine",
"subroutine",
",",
"InstructionHandle",
"pei",
",",
"BasicBlock",
"etb",
")",
"{",
"etb",
".",
"setExceptionThrower",
"(",
"pei",
")",
";",
"// Remember whether or not a universal exception handler",
"// is reachab... | Add exception edges for given instruction.
@param subroutine
the subroutine containing the instruction
@param pei
the instruction which throws an exception
@param etb
the exception thrower block (ETB) for the instruction | [
"Add",
"exception",
"edges",
"for",
"given",
"instruction",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BetterCFGBuilder2.java#L941-L971 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacTypes.java | JavacTypes.validateTypeNotIn | private void validateTypeNotIn(TypeMirror t, Set<TypeKind> invalidKinds) {
"""
Throws an IllegalArgumentException if a type's kind is one of a set.
"""
if (invalidKinds.contains(t.getKind()))
throw new IllegalArgumentException(t.toString());
} | java | private void validateTypeNotIn(TypeMirror t, Set<TypeKind> invalidKinds) {
if (invalidKinds.contains(t.getKind()))
throw new IllegalArgumentException(t.toString());
} | [
"private",
"void",
"validateTypeNotIn",
"(",
"TypeMirror",
"t",
",",
"Set",
"<",
"TypeKind",
">",
"invalidKinds",
")",
"{",
"if",
"(",
"invalidKinds",
".",
"contains",
"(",
"t",
".",
"getKind",
"(",
")",
")",
")",
"throw",
"new",
"IllegalArgumentException",
... | Throws an IllegalArgumentException if a type's kind is one of a set. | [
"Throws",
"an",
"IllegalArgumentException",
"if",
"a",
"type",
"s",
"kind",
"is",
"one",
"of",
"a",
"set",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacTypes.java#L310-L313 |
alkacon/opencms-core | src/org/opencms/main/CmsSystemInfo.java | CmsSystemInfo.initVersion | private void initVersion() {
"""
Initializes the version for this OpenCms, will be called by
{@link OpenCmsServlet} or {@link CmsShell} upon system startup.<p>
"""
// initialize version information with static defaults
m_versionNumber = DEFAULT_VERSION_NUMBER;
m_versionId = DEFAULT_VE... | java | private void initVersion() {
// initialize version information with static defaults
m_versionNumber = DEFAULT_VERSION_NUMBER;
m_versionId = DEFAULT_VERSION_ID;
m_version = "OpenCms/" + m_versionNumber;
m_buildInfo = Collections.emptyMap();
// read the version-information... | [
"private",
"void",
"initVersion",
"(",
")",
"{",
"// initialize version information with static defaults",
"m_versionNumber",
"=",
"DEFAULT_VERSION_NUMBER",
";",
"m_versionId",
"=",
"DEFAULT_VERSION_ID",
";",
"m_version",
"=",
"\"OpenCms/\"",
"+",
"m_versionNumber",
";",
"m... | Initializes the version for this OpenCms, will be called by
{@link OpenCmsServlet} or {@link CmsShell} upon system startup.<p> | [
"Initializes",
"the",
"version",
"for",
"this",
"OpenCms",
"will",
"be",
"called",
"by",
"{"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsSystemInfo.java#L850-L881 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/logging/Logger.java | Logger.logError | public final void logError(@NonNull final Class<?> tag, @NonNull final String message) {
"""
Logs a specific message on the log level ERROR.
@param tag
The tag, which identifies the source of the log message, as an instance of the class
{@link Class}. The tag may not be null
@param message
The message, whic... | java | public final void logError(@NonNull final Class<?> tag, @NonNull final String message) {
Condition.INSTANCE.ensureNotNull(tag, "The tag may not be null");
Condition.INSTANCE.ensureNotNull(message, "The message may not be null");
Condition.INSTANCE.ensureNotEmpty(message, "The message may not be ... | [
"public",
"final",
"void",
"logError",
"(",
"@",
"NonNull",
"final",
"Class",
"<",
"?",
">",
"tag",
",",
"@",
"NonNull",
"final",
"String",
"message",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"tag",
",",
"\"The tag may not be null\"... | Logs a specific message on the log level ERROR.
@param tag
The tag, which identifies the source of the log message, as an instance of the class
{@link Class}. The tag may not be null
@param message
The message, which should be logged, as a {@link String}. The message may neither be
null, nor empty | [
"Logs",
"a",
"specific",
"message",
"on",
"the",
"log",
"level",
"ERROR",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/logging/Logger.java#L262-L270 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsSqlManager.java | CmsSqlManager.readQuery | public String readQuery(CmsProject project, String queryKey) {
"""
Searches for the SQL query with the specified key and CmsProject.<p>
@param project the specified CmsProject
@param queryKey the key of the SQL query
@return the the SQL query in this property list with the specified key
"""
retur... | java | public String readQuery(CmsProject project, String queryKey) {
return readQuery(project.getUuid(), queryKey);
} | [
"public",
"String",
"readQuery",
"(",
"CmsProject",
"project",
",",
"String",
"queryKey",
")",
"{",
"return",
"readQuery",
"(",
"project",
".",
"getUuid",
"(",
")",
",",
"queryKey",
")",
";",
"}"
] | Searches for the SQL query with the specified key and CmsProject.<p>
@param project the specified CmsProject
@param queryKey the key of the SQL query
@return the the SQL query in this property list with the specified key | [
"Searches",
"for",
"the",
"SQL",
"query",
"with",
"the",
"specified",
"key",
"and",
"CmsProject",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsSqlManager.java#L313-L316 |
apptik/jus | rx-jus/src/main/java/io/apptik/comm/jus/rx/queue/RxRequestQueue.java | RxRequestQueue.errorObservable | public static Observable<ErrorEvent> errorObservable(
RequestQueue queue, RequestQueue.RequestFilter filter) {
"""
Returns {@link Observable} of error events coming as {@link ErrorEvent}
@param queue the {@link RequestQueue} to listen to
@param filter the {@link io.apptik.comm.jus.RequestQueue.Req... | java | public static Observable<ErrorEvent> errorObservable(
RequestQueue queue, RequestQueue.RequestFilter filter) {
return Observable.create(new QRequestErrorOnSubscribe(queue, filter));
} | [
"public",
"static",
"Observable",
"<",
"ErrorEvent",
">",
"errorObservable",
"(",
"RequestQueue",
"queue",
",",
"RequestQueue",
".",
"RequestFilter",
"filter",
")",
"{",
"return",
"Observable",
".",
"create",
"(",
"new",
"QRequestErrorOnSubscribe",
"(",
"queue",
"... | Returns {@link Observable} of error events coming as {@link ErrorEvent}
@param queue the {@link RequestQueue} to listen to
@param filter the {@link io.apptik.comm.jus.RequestQueue.RequestFilter} which will filter
the requests to hook to. Set null for no filtering.
@return {@link Observable} of errors | [
"Returns",
"{",
"@link",
"Observable",
"}",
"of",
"error",
"events",
"coming",
"as",
"{",
"@link",
"ErrorEvent",
"}"
] | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/rx-jus/src/main/java/io/apptik/comm/jus/rx/queue/RxRequestQueue.java#L76-L79 |
powermock/powermock | powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/PowerMockito.java | PowerMockito.mockStatic | public static void mockStatic(Class<?> classToMock, MockSettings mockSettings) {
"""
Creates a class mock with some non-standard settings.
<p>
The number of configuration points for a mock grows so we need a fluent
way to introduce new configuration without adding more and more
overloaded PowerMockito.mockStat... | java | public static void mockStatic(Class<?> classToMock, MockSettings mockSettings) {
DefaultMockCreator.mock(classToMock, true, false, null, mockSettings, (Method[]) null);
} | [
"public",
"static",
"void",
"mockStatic",
"(",
"Class",
"<",
"?",
">",
"classToMock",
",",
"MockSettings",
"mockSettings",
")",
"{",
"DefaultMockCreator",
".",
"mock",
"(",
"classToMock",
",",
"true",
",",
"false",
",",
"null",
",",
"mockSettings",
",",
"(",... | Creates a class mock with some non-standard settings.
<p>
The number of configuration points for a mock grows so we need a fluent
way to introduce new configuration without adding more and more
overloaded PowerMockito.mockStatic() methods. Hence {@link MockSettings}.
<p>
<pre>
mockStatic(Listener.class, withSettings()
... | [
"Creates",
"a",
"class",
"mock",
"with",
"some",
"non",
"-",
"standard",
"settings",
".",
"<p",
">",
"The",
"number",
"of",
"configuration",
"points",
"for",
"a",
"mock",
"grows",
"so",
"we",
"need",
"a",
"fluent",
"way",
"to",
"introduce",
"new",
"confi... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/PowerMockito.java#L114-L116 |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java | DataTree.updateCount | public void updateCount(String lastPrefix, int diff) {
"""
update the count of this stat datanode
@param lastPrefix
the path of the node that is quotaed.
@param diff
the diff to be added to the count
"""
String statNode = Quotas.statPath(lastPrefix);
DataNode node = nodes.get(statNode);
... | java | public void updateCount(String lastPrefix, int diff) {
String statNode = Quotas.statPath(lastPrefix);
DataNode node = nodes.get(statNode);
StatsTrack updatedStat = null;
if (node == null) {
// should not happen
LOG.error("Missing count node for stat " + statNode);... | [
"public",
"void",
"updateCount",
"(",
"String",
"lastPrefix",
",",
"int",
"diff",
")",
"{",
"String",
"statNode",
"=",
"Quotas",
".",
"statPath",
"(",
"lastPrefix",
")",
";",
"DataNode",
"node",
"=",
"nodes",
".",
"get",
"(",
"statNode",
")",
";",
"Stats... | update the count of this stat datanode
@param lastPrefix
the path of the node that is quotaed.
@param diff
the diff to be added to the count | [
"update",
"the",
"count",
"of",
"this",
"stat",
"datanode"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L351-L383 |
smallnest/fastjson-jaxrs-json-provider | src/main/java/com/colobu/fastjson/FastJsonProvider.java | FastJsonProvider.isReadable | public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
"""
Method that JAX-RS container calls to try to check whether values of
given type (and media type) can be deserialized by this provider.
"""
if (!hasMatchingMediaType(mediaType)) {
return false;
... | java | public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
if (!hasMatchingMediaType(mediaType)) {
return false;
}
return isValidType(type, annotations);
} | [
"public",
"boolean",
"isReadable",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Type",
"genericType",
",",
"Annotation",
"[",
"]",
"annotations",
",",
"MediaType",
"mediaType",
")",
"{",
"if",
"(",
"!",
"hasMatchingMediaType",
"(",
"mediaType",
")",
")",
"{"... | Method that JAX-RS container calls to try to check whether values of
given type (and media type) can be deserialized by this provider. | [
"Method",
"that",
"JAX",
"-",
"RS",
"container",
"calls",
"to",
"try",
"to",
"check",
"whether",
"values",
"of",
"given",
"type",
"(",
"and",
"media",
"type",
")",
"can",
"be",
"deserialized",
"by",
"this",
"provider",
"."
] | train | https://github.com/smallnest/fastjson-jaxrs-json-provider/blob/bbdb2e3d101069bf62c026976ff9d00967671ec0/src/main/java/com/colobu/fastjson/FastJsonProvider.java#L259-L265 |
msteiger/jxmapviewer2 | jxmapviewer2/src/main/java/org/jxmapviewer/viewer/util/GeoUtil.java | GeoUtil.getPosition | public static GeoPosition getPosition(Point2D pixelCoordinate, int zoom, TileFactoryInfo info) {
"""
Convert an on screen pixel coordinate and a zoom level to a geo position
@param pixelCoordinate the coordinate in pixels
@param zoom the zoom level
@param info the tile factory info
@return a geo position
"... | java | public static GeoPosition getPosition(Point2D pixelCoordinate, int zoom, TileFactoryInfo info)
{
// p(" --bitmap to latlon : " + coord + " " + zoom);
double wx = pixelCoordinate.getX();
double wy = pixelCoordinate.getY();
// this reverses getBitmapCoordinates
double flon = (w... | [
"public",
"static",
"GeoPosition",
"getPosition",
"(",
"Point2D",
"pixelCoordinate",
",",
"int",
"zoom",
",",
"TileFactoryInfo",
"info",
")",
"{",
"// p(\" --bitmap to latlon : \" + coord + \" \" + zoom);",
"double",
"wx",
"=",
"pixelCoordinate",
".",
"getX",
"(",
")",
... | Convert an on screen pixel coordinate and a zoom level to a geo position
@param pixelCoordinate the coordinate in pixels
@param zoom the zoom level
@param info the tile factory info
@return a geo position | [
"Convert",
"an",
"on",
"screen",
"pixel",
"coordinate",
"and",
"a",
"zoom",
"level",
"to",
"a",
"geo",
"position"
] | train | https://github.com/msteiger/jxmapviewer2/blob/82639273b0aac983b6026fb90aa925c0cf596410/jxmapviewer2/src/main/java/org/jxmapviewer/viewer/util/GeoUtil.java#L123-L136 |
alkacon/opencms-core | src-gwt/org/opencms/ade/publish/client/CmsPublishDialog.java | CmsPublishDialog.getWorkflowActionParams | protected CmsWorkflowActionParams getWorkflowActionParams() {
"""
Gets the workflow action parameters to which the workflow action should be applied.<p>
@return the workflow action parameters
"""
if (m_publishSelectPanel.isShowResources()) {
List<CmsUUID> resourcesToPublish = new ArrayL... | java | protected CmsWorkflowActionParams getWorkflowActionParams() {
if (m_publishSelectPanel.isShowResources()) {
List<CmsUUID> resourcesToPublish = new ArrayList<CmsUUID>(m_publishSelectPanel.getResourcesToPublish());
List<CmsUUID> resourcesToRemove = new ArrayList<CmsUUID>(m_publishSelectPa... | [
"protected",
"CmsWorkflowActionParams",
"getWorkflowActionParams",
"(",
")",
"{",
"if",
"(",
"m_publishSelectPanel",
".",
"isShowResources",
"(",
")",
")",
"{",
"List",
"<",
"CmsUUID",
">",
"resourcesToPublish",
"=",
"new",
"ArrayList",
"<",
"CmsUUID",
">",
"(",
... | Gets the workflow action parameters to which the workflow action should be applied.<p>
@return the workflow action parameters | [
"Gets",
"the",
"workflow",
"action",
"parameters",
"to",
"which",
"the",
"workflow",
"action",
"should",
"be",
"applied",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/publish/client/CmsPublishDialog.java#L661-L674 |
awin/rabbiteasy | rabbiteasy-core/src/main/java/com/zanox/rabbiteasy/consumer/ConsumerContainer.java | ConsumerContainer.addConsumer | public void addConsumer(Consumer consumer, String queue) {
"""
Adds a consumer to the container and binds it to the given queue with auto acknowledge disabled.
Does NOT enable the consumer to consume from the message broker until the container is started.
@param consumer The consumer
@param queue The queue to... | java | public void addConsumer(Consumer consumer, String queue) {
addConsumer(consumer, new ConsumerConfiguration(queue), DEFAULT_AMOUNT_OF_INSTANCES);
} | [
"public",
"void",
"addConsumer",
"(",
"Consumer",
"consumer",
",",
"String",
"queue",
")",
"{",
"addConsumer",
"(",
"consumer",
",",
"new",
"ConsumerConfiguration",
"(",
"queue",
")",
",",
"DEFAULT_AMOUNT_OF_INSTANCES",
")",
";",
"}"
] | Adds a consumer to the container and binds it to the given queue with auto acknowledge disabled.
Does NOT enable the consumer to consume from the message broker until the container is started.
@param consumer The consumer
@param queue The queue to bind the consume to | [
"Adds",
"a",
"consumer",
"to",
"the",
"container",
"and",
"binds",
"it",
"to",
"the",
"given",
"queue",
"with",
"auto",
"acknowledge",
"disabled",
".",
"Does",
"NOT",
"enable",
"the",
"consumer",
"to",
"consume",
"from",
"the",
"message",
"broker",
"until",
... | train | https://github.com/awin/rabbiteasy/blob/c161efda6c0f7ef319aedf09dfe40a4a90165510/rabbiteasy-core/src/main/java/com/zanox/rabbiteasy/consumer/ConsumerContainer.java#L59-L61 |
DDTH/ddth-redis | src/main/java/com/github/ddth/redis/RedisClientFactory.java | RedisClientFactory.getRedisClient | public IRedisClient getRedisClient(String host) {
"""
Gets or Creates a {@link IRedisClient} object.
@param host
@return
"""
return getRedisClient(host, IRedisClient.DEFAULT_REDIS_PORT, null, null);
} | java | public IRedisClient getRedisClient(String host) {
return getRedisClient(host, IRedisClient.DEFAULT_REDIS_PORT, null, null);
} | [
"public",
"IRedisClient",
"getRedisClient",
"(",
"String",
"host",
")",
"{",
"return",
"getRedisClient",
"(",
"host",
",",
"IRedisClient",
".",
"DEFAULT_REDIS_PORT",
",",
"null",
",",
"null",
")",
";",
"}"
] | Gets or Creates a {@link IRedisClient} object.
@param host
@return | [
"Gets",
"or",
"Creates",
"a",
"{",
"@link",
"IRedisClient",
"}",
"object",
"."
] | train | https://github.com/DDTH/ddth-redis/blob/7e6abc3e43c9efe7e9c293d421c94227253ded87/src/main/java/com/github/ddth/redis/RedisClientFactory.java#L151-L153 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/index/util/ValidationIndexUtil.java | ValidationIndexUtil.removeIndexData | public static void removeIndexData(ValidationData data, ValidationDataIndex index) {
"""
Remove index data.
@param data the data
@param index the index
"""
String key = index.getKey(data);
List<ValidationData> datas = index.get(key);
if (!datas.isEmpty()) {
datas = da... | java | public static void removeIndexData(ValidationData data, ValidationDataIndex index) {
String key = index.getKey(data);
List<ValidationData> datas = index.get(key);
if (!datas.isEmpty()) {
datas = datas.stream().filter(d -> !d.getId().equals(data.getId())).collect(Collectors.toList()... | [
"public",
"static",
"void",
"removeIndexData",
"(",
"ValidationData",
"data",
",",
"ValidationDataIndex",
"index",
")",
"{",
"String",
"key",
"=",
"index",
".",
"getKey",
"(",
"data",
")",
";",
"List",
"<",
"ValidationData",
">",
"datas",
"=",
"index",
".",
... | Remove index data.
@param data the data
@param index the index | [
"Remove",
"index",
"data",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/index/util/ValidationIndexUtil.java#L37-L50 |
f2prateek/dart | henson/src/main/java/dart/henson/Bundler.java | Bundler.put | public Bundler put(String key, String value) {
"""
Inserts a String value into the mapping of the underlying Bundle, replacing any existing value
for the given key. Either key or value may be null.
@param key a String, or null
@param value a String, or null
@return this bundler instance to chain method calls... | java | public Bundler put(String key, String value) {
delegate.putString(key, value);
return this;
} | [
"public",
"Bundler",
"put",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"delegate",
".",
"putString",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a String value into the mapping of the underlying Bundle, replacing any existing value
for the given key. Either key or value may be null.
@param key a String, or null
@param value a String, or null
@return this bundler instance to chain method calls | [
"Inserts",
"a",
"String",
"value",
"into",
"the",
"mapping",
"of",
"the",
"underlying",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L166-L169 |
graknlabs/grakn | server/src/graql/gremlin/TraversalPlanner.java | TraversalPlanner.createTraversal | public static GraqlTraversal createTraversal(Pattern pattern, TransactionOLTP tx) {
"""
Create a traversal plan.
@param pattern a pattern to find a query plan for
@return a semi-optimal traversal plan
"""
Collection<Conjunction<Statement>> patterns = pattern.getDisjunctiveNormalForm().getPatterns()... | java | public static GraqlTraversal createTraversal(Pattern pattern, TransactionOLTP tx) {
Collection<Conjunction<Statement>> patterns = pattern.getDisjunctiveNormalForm().getPatterns();
Set<? extends List<Fragment>> fragments = patterns.stream()
.map(conjunction -> new ConjunctionQuery(conjun... | [
"public",
"static",
"GraqlTraversal",
"createTraversal",
"(",
"Pattern",
"pattern",
",",
"TransactionOLTP",
"tx",
")",
"{",
"Collection",
"<",
"Conjunction",
"<",
"Statement",
">>",
"patterns",
"=",
"pattern",
".",
"getDisjunctiveNormalForm",
"(",
")",
".",
"getPa... | Create a traversal plan.
@param pattern a pattern to find a query plan for
@return a semi-optimal traversal plan | [
"Create",
"a",
"traversal",
"plan",
"."
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/graql/gremlin/TraversalPlanner.java#L77-L86 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGraph.java | ExecutionGraph.jobHasScheduledStatus | private boolean jobHasScheduledStatus() {
"""
Checks whether the job represented by the execution graph has the status <code>SCHEDULED</code>.
@return <code>true</code> if the job has the status <code>SCHEDULED</code>, <code>false</code> otherwise
"""
final Iterator<ExecutionVertex> it = new ExecutionGra... | java | private boolean jobHasScheduledStatus() {
final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(this, true);
while (it.hasNext()) {
final ExecutionState s = it.next().getExecutionState();
if (s != ExecutionState.CREATED && s != ExecutionState.SCHEDULED && s != ExecutionState.READY) {
return f... | [
"private",
"boolean",
"jobHasScheduledStatus",
"(",
")",
"{",
"final",
"Iterator",
"<",
"ExecutionVertex",
">",
"it",
"=",
"new",
"ExecutionGraphIterator",
"(",
"this",
",",
"true",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"final",... | Checks whether the job represented by the execution graph has the status <code>SCHEDULED</code>.
@return <code>true</code> if the job has the status <code>SCHEDULED</code>, <code>false</code> otherwise | [
"Checks",
"whether",
"the",
"job",
"represented",
"by",
"the",
"execution",
"graph",
"has",
"the",
"status",
"<code",
">",
"SCHEDULED<",
"/",
"code",
">",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGraph.java#L1060-L1073 |
CodeNarc/CodeNarc | src/main/java/org/codenarc/util/AstUtil.java | AstUtil.isMethodCallOnObject | public static boolean isMethodCallOnObject(Expression expression, String methodObjectPattern) {
"""
Tells you if the expression is a method call on a particular object (which is represented as a String).
For instance, you may ask isMethodCallOnObject(e, 'this') to find a this reference.
@param expression - the e... | java | public static boolean isMethodCallOnObject(Expression expression, String methodObjectPattern) {
if (expression instanceof MethodCallExpression) {
Expression objectExpression = ((MethodCallExpression) expression).getObjectExpression();
if (objectExpression instanceof VariableExpression... | [
"public",
"static",
"boolean",
"isMethodCallOnObject",
"(",
"Expression",
"expression",
",",
"String",
"methodObjectPattern",
")",
"{",
"if",
"(",
"expression",
"instanceof",
"MethodCallExpression",
")",
"{",
"Expression",
"objectExpression",
"=",
"(",
"(",
"MethodCal... | Tells you if the expression is a method call on a particular object (which is represented as a String).
For instance, you may ask isMethodCallOnObject(e, 'this') to find a this reference.
@param expression - the expression
@param methodObjectPattern - the name of the method object (receiver) such as 'this'
@return
as d... | [
"Tells",
"you",
"if",
"the",
"expression",
"is",
"a",
"method",
"call",
"on",
"a",
"particular",
"object",
"(",
"which",
"is",
"represented",
"as",
"a",
"String",
")",
".",
"For",
"instance",
"you",
"may",
"ask",
"isMethodCallOnObject",
"(",
"e",
"this",
... | train | https://github.com/CodeNarc/CodeNarc/blob/9a7cec02cb8cbaf845030f2434309e8968f5d7a7/src/main/java/org/codenarc/util/AstUtil.java#L264-L281 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/MemcachedClient.java | MemcachedClient.getBulk | @Override
public <T> Map<String, T> getBulk(Iterator<String> keyIter,
Transcoder<T> tc) {
"""
Get the values for multiple keys from the cache.
@param <T>
@param keyIter Iterator that produces the keys
@param tc the transcoder to serialize and unserialize value
@return a map of the values (for each va... | java | @Override
public <T> Map<String, T> getBulk(Iterator<String> keyIter,
Transcoder<T> tc) {
try {
return asyncGetBulk(keyIter, tc).get(operationTimeout,
TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
throw new RuntimeException("Interrupted getting bulk values", e);
} ... | [
"@",
"Override",
"public",
"<",
"T",
">",
"Map",
"<",
"String",
",",
"T",
">",
"getBulk",
"(",
"Iterator",
"<",
"String",
">",
"keyIter",
",",
"Transcoder",
"<",
"T",
">",
"tc",
")",
"{",
"try",
"{",
"return",
"asyncGetBulk",
"(",
"keyIter",
",",
"... | Get the values for multiple keys from the cache.
@param <T>
@param keyIter Iterator that produces the keys
@param tc the transcoder to serialize and unserialize value
@return a map of the values (for each value that exists)
@throws OperationTimeoutException if the global operation timeout is
exceeded
@throws Cancellat... | [
"Get",
"the",
"values",
"for",
"multiple",
"keys",
"from",
"the",
"cache",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedClient.java#L1551-L1569 |
dropwizard/dropwizard | dropwizard-hibernate/src/main/java/io/dropwizard/hibernate/ScanningHibernateBundle.java | ScanningHibernateBundle.findEntityClassesFromDirectory | public static List<Class<?>> findEntityClassesFromDirectory(String[] pckgs) {
"""
Method scanning given directory for classes containing Hibernate @Entity annotation
@param pckgs string array with packages containing Hibernate entities (classes annotated with @Entity annotation)
e.g. com.codahale.fake.db.direc... | java | public static List<Class<?>> findEntityClassesFromDirectory(String[] pckgs) {
@SuppressWarnings("unchecked")
final AnnotationAcceptingListener asl = new AnnotationAcceptingListener(Entity.class);
try (final PackageNamesScanner scanner = new PackageNamesScanner(pckgs, true)) {
while (... | [
"public",
"static",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"findEntityClassesFromDirectory",
"(",
"String",
"[",
"]",
"pckgs",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"final",
"AnnotationAcceptingListener",
"asl",
"=",
"new",
"Annotation... | Method scanning given directory for classes containing Hibernate @Entity annotation
@param pckgs string array with packages containing Hibernate entities (classes annotated with @Entity annotation)
e.g. com.codahale.fake.db.directory.entities
@return ImmutableList with classes from given directory annotated with Hiber... | [
"Method",
"scanning",
"given",
"directory",
"for",
"classes",
"containing",
"Hibernate",
"@Entity",
"annotation"
] | train | https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-hibernate/src/main/java/io/dropwizard/hibernate/ScanningHibernateBundle.java#L40-L57 |
infinispan/infinispan | hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/PutFromLoadValidator.java | PutFromLoadValidator.addToCache | public static void addToCache(AdvancedCache cache, PutFromLoadValidator validator) {
"""
Besides the call from constructor, this should be called only from tests when mocking the validator.
"""
AsyncInterceptorChain chain = cache.getAsyncInterceptorChain();
List<AsyncInterceptor> interceptors = cha... | java | public static void addToCache(AdvancedCache cache, PutFromLoadValidator validator) {
AsyncInterceptorChain chain = cache.getAsyncInterceptorChain();
List<AsyncInterceptor> interceptors = chain.getInterceptors();
log.debugf("Interceptor chain was: ", interceptors);
int position = 0;
// add inte... | [
"public",
"static",
"void",
"addToCache",
"(",
"AdvancedCache",
"cache",
",",
"PutFromLoadValidator",
"validator",
")",
"{",
"AsyncInterceptorChain",
"chain",
"=",
"cache",
".",
"getAsyncInterceptorChain",
"(",
")",
";",
"List",
"<",
"AsyncInterceptor",
">",
"interc... | Besides the call from constructor, this should be called only from tests when mocking the validator. | [
"Besides",
"the",
"call",
"from",
"constructor",
"this",
"should",
"be",
"called",
"only",
"from",
"tests",
"when",
"mocking",
"the",
"validator",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/PutFromLoadValidator.java#L183-L235 |
dmfs/xmlobjects | src/org/dmfs/xmlobjects/QualifiedName.java | QualifiedName.get | public static QualifiedName get(String namespace, String name) {
"""
Returns a {@link QualifiedName} with a specific name space. If the {@link QualifiedName} already exists, the existing instance is returned, otherwise
it's created.
@param namespace
The namespace of the {@link QualifiedName}.
@param name
Th... | java | public static QualifiedName get(String namespace, String name)
{
if (namespace != null && namespace.length() == 0)
{
namespace = null;
}
synchronized (QUALIFIED_NAME_CACHE)
{
Map<String, QualifiedName> qualifiedNameMap = QUALIFIED_NAME_CACHE.get(namespace);
QualifiedName qualifiedName;
if (quali... | [
"public",
"static",
"QualifiedName",
"get",
"(",
"String",
"namespace",
",",
"String",
"name",
")",
"{",
"if",
"(",
"namespace",
"!=",
"null",
"&&",
"namespace",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"namespace",
"=",
"null",
";",
"}",
"synchro... | Returns a {@link QualifiedName} with a specific name space. If the {@link QualifiedName} already exists, the existing instance is returned, otherwise
it's created.
@param namespace
The namespace of the {@link QualifiedName}.
@param name
The name of the {@link QualifiedName}.
@return The {@link QualifiedName} instance. | [
"Returns",
"a",
"{",
"@link",
"QualifiedName",
"}",
"with",
"a",
"specific",
"name",
"space",
".",
"If",
"the",
"{",
"@link",
"QualifiedName",
"}",
"already",
"exists",
"the",
"existing",
"instance",
"is",
"returned",
"otherwise",
"it",
"s",
"created",
"."
] | train | https://github.com/dmfs/xmlobjects/blob/b68ddd0ce994d804fc2ec6da1096bf0d883b37f9/src/org/dmfs/xmlobjects/QualifiedName.java#L78-L107 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.