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 |
|---|---|---|---|---|---|---|---|---|---|---|
tvesalainen/util | util/src/main/java/org/vesalainen/navi/Navis.java | Navis.radBearing | public static final double radBearing(double lat1, double lon1, double lat2, double lon2) {
"""
Returns bearing from (lat1, lon1) to (lat2, lon2) in radians
@param lat1
@param lon1
@param lat2
@param lon2
@return
"""
checkLatitude(lat1);
checkLongitude(lon1);
checkLatitude(lat2)... | java | public static final double radBearing(double lat1, double lon1, double lat2, double lon2)
{
checkLatitude(lat1);
checkLongitude(lon1);
checkLatitude(lat2);
checkLongitude(lon2);
double dep = departure(lat1, lat2);
double aa = dep*(lon2-lon1);
double bb... | [
"public",
"static",
"final",
"double",
"radBearing",
"(",
"double",
"lat1",
",",
"double",
"lon1",
",",
"double",
"lat2",
",",
"double",
"lon2",
")",
"{",
"checkLatitude",
"(",
"lat1",
")",
";",
"checkLongitude",
"(",
"lon1",
")",
";",
"checkLatitude",
"("... | Returns bearing from (lat1, lon1) to (lat2, lon2) in radians
@param lat1
@param lon1
@param lat2
@param lon2
@return | [
"Returns",
"bearing",
"from",
"(",
"lat1",
"lon1",
")",
"to",
"(",
"lat2",
"lon2",
")",
"in",
"radians"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/navi/Navis.java#L131-L146 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatter.java | DateTimeFormatter.printTo | public void printTo(StringBuilder buf, ReadablePartial partial) {
"""
Prints a ReadablePartial.
<p>
Neither the override chronology nor the override zone are used
by this method.
@param buf the destination to format to, not null
@param partial partial to format
"""
try {
printTo((A... | java | public void printTo(StringBuilder buf, ReadablePartial partial) {
try {
printTo((Appendable) buf, partial);
} catch (IOException ex) {
// StringBuilder does not throw IOException
}
} | [
"public",
"void",
"printTo",
"(",
"StringBuilder",
"buf",
",",
"ReadablePartial",
"partial",
")",
"{",
"try",
"{",
"printTo",
"(",
"(",
"Appendable",
")",
"buf",
",",
"partial",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
"// StringBuilder ... | Prints a ReadablePartial.
<p>
Neither the override chronology nor the override zone are used
by this method.
@param buf the destination to format to, not null
@param partial partial to format | [
"Prints",
"a",
"ReadablePartial",
".",
"<p",
">",
"Neither",
"the",
"override",
"chronology",
"nor",
"the",
"override",
"zone",
"are",
"used",
"by",
"this",
"method",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatter.java#L619-L625 |
redkale/redkale | src/org/redkale/asm/MethodVisitor.java | MethodVisitor.visitParameter | public void visitParameter(String name, int access) {
"""
Visits a parameter of this method.
@param name
parameter name or null if none is provided.
@param access
the parameter's access flags, only <tt>ACC_FINAL</tt>,
<tt>ACC_SYNTHETIC</tt> or/and <tt>ACC_MANDATED</tt> are
allowed (see {@link Opcodes}).
... | java | public void visitParameter(String name, int access) {
if (mv != null) {
mv.visitParameter(name, access);
}
} | [
"public",
"void",
"visitParameter",
"(",
"String",
"name",
",",
"int",
"access",
")",
"{",
"if",
"(",
"mv",
"!=",
"null",
")",
"{",
"mv",
".",
"visitParameter",
"(",
"name",
",",
"access",
")",
";",
"}",
"}"
] | Visits a parameter of this method.
@param name
parameter name or null if none is provided.
@param access
the parameter's access flags, only <tt>ACC_FINAL</tt>,
<tt>ACC_SYNTHETIC</tt> or/and <tt>ACC_MANDATED</tt> are
allowed (see {@link Opcodes}). | [
"Visits",
"a",
"parameter",
"of",
"this",
"method",
"."
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/MethodVisitor.java#L139-L143 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertex.java | JobVertex.getInvokableClass | public Class<? extends AbstractInvokable> getInvokableClass(ClassLoader cl) {
"""
Returns the invokable class which represents the task of this vertex
@param cl The classloader used to resolve user-defined classes
@return The invokable class, <code>null</code> if it is not set
"""
if (cl == null) {
th... | java | public Class<? extends AbstractInvokable> getInvokableClass(ClassLoader cl) {
if (cl == null) {
throw new NullPointerException("The classloader must not be null.");
}
if (invokableClassName == null) {
return null;
}
try {
return Class.forName(invokableClassName, true, cl).asSubclass(AbstractInvokabl... | [
"public",
"Class",
"<",
"?",
"extends",
"AbstractInvokable",
">",
"getInvokableClass",
"(",
"ClassLoader",
"cl",
")",
"{",
"if",
"(",
"cl",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"The classloader must not be null.\"",
")",
";",
"}... | Returns the invokable class which represents the task of this vertex
@param cl The classloader used to resolve user-defined classes
@return The invokable class, <code>null</code> if it is not set | [
"Returns",
"the",
"invokable",
"class",
"which",
"represents",
"the",
"task",
"of",
"this",
"vertex"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertex.java#L257-L274 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getHexEncoded | @Nonnull
public static String getHexEncoded (@Nonnull final byte [] aInput) {
"""
Convert a byte array to a hexadecimal encoded string.
@param aInput
The byte array to be converted to a String. May not be
<code>null</code>.
@return The String representation of the byte array.
"""
ValueEnforcer.notN... | java | @Nonnull
public static String getHexEncoded (@Nonnull final byte [] aInput)
{
ValueEnforcer.notNull (aInput, "Input");
return getHexEncoded (aInput, 0, aInput.length);
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getHexEncoded",
"(",
"@",
"Nonnull",
"final",
"byte",
"[",
"]",
"aInput",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aInput",
",",
"\"Input\"",
")",
";",
"return",
"getHexEncoded",
"(",
"aInput",
",",
"0... | Convert a byte array to a hexadecimal encoded string.
@param aInput
The byte array to be converted to a String. May not be
<code>null</code>.
@return The String representation of the byte array. | [
"Convert",
"a",
"byte",
"array",
"to",
"a",
"hexadecimal",
"encoded",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L618-L624 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java | BaseNeo4jAssociationQueries.createRelationshipForCollectionOfPrimitivesOrMap | private void createRelationshipForCollectionOfPrimitivesOrMap(AssociationKey associationKey, String collectionRole, String[] columnNames, StringBuilder queryBuilder) {
"""
/*
Append query part related to the creation of a relationship for a collection of primitive or a Map like in the
following examples:
1) @... | java | private void createRelationshipForCollectionOfPrimitivesOrMap(AssociationKey associationKey, String collectionRole, String[] columnNames, StringBuilder queryBuilder) {
String relationshipType = collectionRole;
if ( isPartOfEmbedded( collectionRole ) ) {
queryBuilder.append( " MERGE (owner) " );
String[] pathT... | [
"private",
"void",
"createRelationshipForCollectionOfPrimitivesOrMap",
"(",
"AssociationKey",
"associationKey",
",",
"String",
"collectionRole",
",",
"String",
"[",
"]",
"columnNames",
",",
"StringBuilder",
"queryBuilder",
")",
"{",
"String",
"relationshipType",
"=",
"col... | /*
Append query part related to the creation of a relationship for a collection of primitive or a Map like in the
following examples:
1) @ElementCollection List<String> alternatives
2) @MapKeyColumn(name = "addressType") Map<String, Address> addresses
Query example for embedded collection of primitives or Map:
MATCH... | [
"/",
"*",
"Append",
"query",
"part",
"related",
"to",
"the",
"creation",
"of",
"a",
"relationship",
"for",
"a",
"collection",
"of",
"primitive",
"or",
"a",
"Map",
"like",
"in",
"the",
"following",
"examples",
":"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java#L457-L485 |
apereo/cas | support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java | LdapUtils.executeAddOperation | public static boolean executeAddOperation(final ConnectionFactory connectionFactory, final LdapEntry entry) {
"""
Execute add operation boolean.
@param connectionFactory the connection factory
@param entry the entry
@return true/false
"""
try (val connection = createConnection(connecti... | java | public static boolean executeAddOperation(final ConnectionFactory connectionFactory, final LdapEntry entry) {
try (val connection = createConnection(connectionFactory)) {
val operation = new AddOperation(connection);
operation.execute(new AddRequest(entry.getDn(), entry.getAttributes()))... | [
"public",
"static",
"boolean",
"executeAddOperation",
"(",
"final",
"ConnectionFactory",
"connectionFactory",
",",
"final",
"LdapEntry",
"entry",
")",
"{",
"try",
"(",
"val",
"connection",
"=",
"createConnection",
"(",
"connectionFactory",
")",
")",
"{",
"val",
"o... | Execute add operation boolean.
@param connectionFactory the connection factory
@param entry the entry
@return true/false | [
"Execute",
"add",
"operation",
"boolean",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java#L399-L408 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java | ServletUtil.getMultipart | public static MultipartFormData getMultipart(ServletRequest request, UploadSetting uploadSetting) throws IORuntimeException {
"""
获得multipart/form-data 表单内容<br>
包括文件和普通表单数据<br>
在同一次请求中,此方法只能被执行一次!
@param request {@link ServletRequest}
@param uploadSetting 上传文件的设定,包括最大文件大小、保存在内存的边界大小、临时目录、扩展名限定等
@return Mult... | java | public static MultipartFormData getMultipart(ServletRequest request, UploadSetting uploadSetting) throws IORuntimeException {
final MultipartFormData formData = new MultipartFormData(uploadSetting);
try {
formData.parseRequest(request);
} catch (IOException e) {
throw new IORuntimeException(e);
}
... | [
"public",
"static",
"MultipartFormData",
"getMultipart",
"(",
"ServletRequest",
"request",
",",
"UploadSetting",
"uploadSetting",
")",
"throws",
"IORuntimeException",
"{",
"final",
"MultipartFormData",
"formData",
"=",
"new",
"MultipartFormData",
"(",
"uploadSetting",
")"... | 获得multipart/form-data 表单内容<br>
包括文件和普通表单数据<br>
在同一次请求中,此方法只能被执行一次!
@param request {@link ServletRequest}
@param uploadSetting 上传文件的设定,包括最大文件大小、保存在内存的边界大小、临时目录、扩展名限定等
@return MultiPart表单
@throws IORuntimeException IO异常
@since 4.0.2 | [
"获得multipart",
"/",
"form",
"-",
"data",
"表单内容<br",
">",
"包括文件和普通表单数据<br",
">",
"在同一次请求中,此方法只能被执行一次!"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java#L258-L267 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspContentAccessValueWrapper.java | CmsJspContentAccessValueWrapper.getResolveMacros | public CmsJspContentAccessValueWrapper getResolveMacros() {
"""
Turn on macro resolving for the wrapped value.<p>
Macro resolving is turned off by default.
When turned on, a macro resolver is initialized with
the current OpenCms user context and the URI of the current resource.
This means known macros contai... | java | public CmsJspContentAccessValueWrapper getResolveMacros() {
if (m_macroResolver == null) {
CmsMacroResolver macroResolver = CmsMacroResolver.newInstance();
macroResolver.setCmsObject(m_cms);
macroResolver.setKeepEmptyMacros(true);
return new CmsJspContentAccessVa... | [
"public",
"CmsJspContentAccessValueWrapper",
"getResolveMacros",
"(",
")",
"{",
"if",
"(",
"m_macroResolver",
"==",
"null",
")",
"{",
"CmsMacroResolver",
"macroResolver",
"=",
"CmsMacroResolver",
".",
"newInstance",
"(",
")",
";",
"macroResolver",
".",
"setCmsObject",... | Turn on macro resolving for the wrapped value.<p>
Macro resolving is turned off by default.
When turned on, a macro resolver is initialized with
the current OpenCms user context and the URI of the current resource.
This means known macros contained in the wrapped value will be resolved when the output String is genera... | [
"Turn",
"on",
"macro",
"resolving",
"for",
"the",
"wrapped",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspContentAccessValueWrapper.java#L806-L816 |
kefirfromperm/kefirbb | src/org/kefirsf/bb/DomConfigurationFactory.java | DomConfigurationFactory.parseCode | private Code parseCode(Element codeElement, Map<String, Scope> scopes) {
"""
Parse bb-code from DOM Node
@param codeElement node, represent code wich
@return bb-code
@throws TextProcessorFactoryException if error format
"""
// Code name
Code code = new Code(nodeAttribute(codeElement, TAG_C... | java | private Code parseCode(Element codeElement, Map<String, Scope> scopes) {
// Code name
Code code = new Code(nodeAttribute(codeElement, TAG_CODE_ATTR_NAME, Utils.generateRandomName()));
// Code priority
code.setPriority(nodeAttribute(codeElement, TAG_CODE_ATTR_PRIORITY, Code.DEFAULT_PRIOR... | [
"private",
"Code",
"parseCode",
"(",
"Element",
"codeElement",
",",
"Map",
"<",
"String",
",",
"Scope",
">",
"scopes",
")",
"{",
"// Code name",
"Code",
"code",
"=",
"new",
"Code",
"(",
"nodeAttribute",
"(",
"codeElement",
",",
"TAG_CODE_ATTR_NAME",
",",
"Ut... | Parse bb-code from DOM Node
@param codeElement node, represent code wich
@return bb-code
@throws TextProcessorFactoryException if error format | [
"Parse",
"bb",
"-",
"code",
"from",
"DOM",
"Node"
] | train | https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L329-L359 |
graphql-java/graphql-java | src/main/java/graphql/schema/idl/SchemaTypeExtensionsChecker.java | SchemaTypeExtensionsChecker.checkScalarTypeExtensions | private void checkScalarTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry) {
"""
/*
Scalar type extensions have the potential to be invalid if incorrectly defined.
The named type must already be defined and must be a Scalar type.
Any directives provided must not already apply to th... | java | private void checkScalarTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry) {
typeRegistry.scalarTypeExtensions()
.forEach((name, extensions) -> {
checkTypeExtensionHasCorrespondingType(errors, typeRegistry, name, extensions, ScalarTypeDefinition.cl... | [
"private",
"void",
"checkScalarTypeExtensions",
"(",
"List",
"<",
"GraphQLError",
">",
"errors",
",",
"TypeDefinitionRegistry",
"typeRegistry",
")",
"{",
"typeRegistry",
".",
"scalarTypeExtensions",
"(",
")",
".",
"forEach",
"(",
"(",
"name",
",",
"extensions",
")... | /*
Scalar type extensions have the potential to be invalid if incorrectly defined.
The named type must already be defined and must be a Scalar type.
Any directives provided must not already apply to the original Scalar type. | [
"/",
"*",
"Scalar",
"type",
"extensions",
"have",
"the",
"potential",
"to",
"be",
"invalid",
"if",
"incorrectly",
"defined",
"."
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/schema/idl/SchemaTypeExtensionsChecker.java#L242-L249 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | FSNamesystem.delete | public boolean delete(String src, boolean recursive) throws IOException {
"""
Remove the indicated filename from namespace. If the filename
is a directory (non empty) and recursive is set to false then throw exception.
"""
boolean status = deleteInternal(src, null, recursive, true);
getEditLog().logSy... | java | public boolean delete(String src, boolean recursive) throws IOException {
boolean status = deleteInternal(src, null, recursive, true);
getEditLog().logSync(false);
if (status && auditLog.isInfoEnabled()) {
logAuditEvent(getCurrentUGI(),
Server.getRemoteIp(),
"delete", src, null, null);... | [
"public",
"boolean",
"delete",
"(",
"String",
"src",
",",
"boolean",
"recursive",
")",
"throws",
"IOException",
"{",
"boolean",
"status",
"=",
"deleteInternal",
"(",
"src",
",",
"null",
",",
"recursive",
",",
"true",
")",
";",
"getEditLog",
"(",
")",
".",
... | Remove the indicated filename from namespace. If the filename
is a directory (non empty) and recursive is set to false then throw exception. | [
"Remove",
"the",
"indicated",
"filename",
"from",
"namespace",
".",
"If",
"the",
"filename",
"is",
"a",
"directory",
"(",
"non",
"empty",
")",
"and",
"recursive",
"is",
"set",
"to",
"false",
"then",
"throw",
"exception",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L3769-L3778 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java | GrahamScanConvexHull2D.mdist | private double mdist(double[] a, double[] b) {
"""
Manhattan distance.
@param a double[] A
@param b double[] B
@return Manhattan distance
"""
return Math.abs(a[0] - b[0]) + Math.abs(a[1] - b[1]);
} | java | private double mdist(double[] a, double[] b) {
return Math.abs(a[0] - b[0]) + Math.abs(a[1] - b[1]);
} | [
"private",
"double",
"mdist",
"(",
"double",
"[",
"]",
"a",
",",
"double",
"[",
"]",
"b",
")",
"{",
"return",
"Math",
".",
"abs",
"(",
"a",
"[",
"0",
"]",
"-",
"b",
"[",
"0",
"]",
")",
"+",
"Math",
".",
"abs",
"(",
"a",
"[",
"1",
"]",
"-"... | Manhattan distance.
@param a double[] A
@param b double[] B
@return Manhattan distance | [
"Manhattan",
"distance",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java#L211-L213 |
gallandarakhneorg/afc | core/text/src/main/java/org/arakhne/afc/text/TextUtil.java | TextUtil.join | @Pure
public static <T> String join(char leftSeparator, char rightSeparator, @SuppressWarnings("unchecked") T... strs) {
"""
Merge the given strings with to separators.
The separators are used to delimit the groups
of characters.
<p>Examples:
<ul>
<li><code>merge('{','}',"a","b","cd")</code> returns the st... | java | @Pure
public static <T> String join(char leftSeparator, char rightSeparator, @SuppressWarnings("unchecked") T... strs) {
final StringBuilder buffer = new StringBuilder();
for (final Object s : strs) {
buffer.append(leftSeparator);
if (s != null) {
buffer.append(s.toString());
}
buffer.append(rightS... | [
"@",
"Pure",
"public",
"static",
"<",
"T",
">",
"String",
"join",
"(",
"char",
"leftSeparator",
",",
"char",
"rightSeparator",
",",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"T",
"...",
"strs",
")",
"{",
"final",
"StringBuilder",
"buffer",
"=",
"... | Merge the given strings with to separators.
The separators are used to delimit the groups
of characters.
<p>Examples:
<ul>
<li><code>merge('{','}',"a","b","cd")</code> returns the string
<code>"{a}{b}{cd}"</code></li>
<li><code>merge('{','}',"a{bcd")</code> returns the string
<code>"{a{bcd}"</code></li>
</ul>
@param ... | [
"Merge",
"the",
"given",
"strings",
"with",
"to",
"separators",
".",
"The",
"separators",
"are",
"used",
"to",
"delimit",
"the",
"groups",
"of",
"characters",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/text/src/main/java/org/arakhne/afc/text/TextUtil.java#L889-L900 |
undera/jmeter-plugins | infra/common/src/main/java/kg/apc/jmeter/JMeterPluginsUtils.java | JMeterPluginsUtils.getEnvDefault | public static String getEnvDefault(String propName, String defaultVal) {
"""
Get a String value (environment) with default if not present.
@param propName the name of the environment variable.
@param defaultVal the default value.
@return The PropDefault value
"""
String ans = defaultVal;
... | java | public static String getEnvDefault(String propName, String defaultVal) {
String ans = defaultVal;
String value = System.getenv(propName);
if (value != null) {
ans = value.trim();
} else if (defaultVal != null) {
ans = defaultVal.trim();
}
return an... | [
"public",
"static",
"String",
"getEnvDefault",
"(",
"String",
"propName",
",",
"String",
"defaultVal",
")",
"{",
"String",
"ans",
"=",
"defaultVal",
";",
"String",
"value",
"=",
"System",
".",
"getenv",
"(",
"propName",
")",
";",
"if",
"(",
"value",
"!=",
... | Get a String value (environment) with default if not present.
@param propName the name of the environment variable.
@param defaultVal the default value.
@return The PropDefault value | [
"Get",
"a",
"String",
"value",
"(",
"environment",
")",
"with",
"default",
"if",
"not",
"present",
"."
] | train | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/jmeter/JMeterPluginsUtils.java#L425-L434 |
wcm-io/wcm-io-handler | richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java | DefaultRewriteContentHandler.getAnchorLink | private Link getAnchorLink(Element element) {
"""
Extracts link metadata from the DOM elements attributes and resolves them to a {@link Link} object.
@param element DOM element
@return Link metadata
"""
SyntheticLinkResource resource = new SyntheticLinkResource(resourceResolver);
ValueMap resourcePro... | java | private Link getAnchorLink(Element element) {
SyntheticLinkResource resource = new SyntheticLinkResource(resourceResolver);
ValueMap resourceProps = resource.getValueMap();
// get link metadata from data element
boolean foundMetadata = getAnchorMetadataFromData(resourceProps, element);
if (!foundMe... | [
"private",
"Link",
"getAnchorLink",
"(",
"Element",
"element",
")",
"{",
"SyntheticLinkResource",
"resource",
"=",
"new",
"SyntheticLinkResource",
"(",
"resourceResolver",
")",
";",
"ValueMap",
"resourceProps",
"=",
"resource",
".",
"getValueMap",
"(",
")",
";",
"... | Extracts link metadata from the DOM elements attributes and resolves them to a {@link Link} object.
@param element DOM element
@return Link metadata | [
"Extracts",
"link",
"metadata",
"from",
"the",
"DOM",
"elements",
"attributes",
"and",
"resolves",
"them",
"to",
"a",
"{"
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java#L182-L199 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java | IdentityPatchContext.undoChanges | static void undoChanges(final PatchEntry entry, final PatchContentLoader loader) {
"""
Undo changes for a single patch entry.
@param entry the patch entry
@param loader the content loader
"""
final List<ContentModification> modifications = new ArrayList<ContentModification>(entry.rollbackActions);... | java | static void undoChanges(final PatchEntry entry, final PatchContentLoader loader) {
final List<ContentModification> modifications = new ArrayList<ContentModification>(entry.rollbackActions);
for (final ContentModification modification : modifications) {
final ContentItem item = modification.g... | [
"static",
"void",
"undoChanges",
"(",
"final",
"PatchEntry",
"entry",
",",
"final",
"PatchContentLoader",
"loader",
")",
"{",
"final",
"List",
"<",
"ContentModification",
">",
"modifications",
"=",
"new",
"ArrayList",
"<",
"ContentModification",
">",
"(",
"entry",... | Undo changes for a single patch entry.
@param entry the patch entry
@param loader the content loader | [
"Undo",
"changes",
"for",
"a",
"single",
"patch",
"entry",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java#L488-L504 |
protegeproject/jpaul | src/main/java/jpaul/DataStructs/RelFacts.java | RelFacts.mapSet | public static <K,V> RelationFactory<K,V> mapSet() {
"""
Returns a relation factory that generates
<code>Relation</code>s interface backed by a
<code>LinkedHashMap</code> from keys to
<code>LinkedHashSet</code>s of values. This relation factory
is very good for programs that use only a few large relations.
... | java | public static <K,V> RelationFactory<K,V> mapSet() {
return mapSet(MapFacts.<K,Set<V>>hash(),
SetFacts.<V>hash());
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"RelationFactory",
"<",
"K",
",",
"V",
">",
"mapSet",
"(",
")",
"{",
"return",
"mapSet",
"(",
"MapFacts",
".",
"<",
"K",
",",
"Set",
"<",
"V",
">",
">",
"hash",
"(",
")",
",",
"SetFacts",
".",
"<",
... | Returns a relation factory that generates
<code>Relation</code>s interface backed by a
<code>LinkedHashMap</code> from keys to
<code>LinkedHashSet</code>s of values. This relation factory
is very good for programs that use only a few large relations. | [
"Returns",
"a",
"relation",
"factory",
"that",
"generates",
"<code",
">",
"Relation<",
"/",
"code",
">",
"s",
"interface",
"backed",
"by",
"a",
"<code",
">",
"LinkedHashMap<",
"/",
"code",
">",
"from",
"keys",
"to",
"<code",
">",
"LinkedHashSet<",
"/",
"co... | train | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/RelFacts.java#L27-L30 |
alkacon/opencms-core | src/org/opencms/ade/sitemap/CmsModelPageHelper.java | CmsModelPageHelper.writeSitemapConfig | private void writeSitemapConfig(CmsXmlContent content, CmsFile sitemapConfigFile)
throws CmsXmlException, CmsException {
"""
Writes a sitemap configuration back to the VFS.<p>
@param content the content to write
@param sitemapConfigFile the file to which the sitemap config should be written
@throws CmsX... | java | private void writeSitemapConfig(CmsXmlContent content, CmsFile sitemapConfigFile)
throws CmsXmlException, CmsException {
content.correctXmlStructure(m_cms);
byte[] contentBytes = content.marshal();
sitemapConfigFile.setContents(contentBytes);
try {
CmsLock lock = m_cms.g... | [
"private",
"void",
"writeSitemapConfig",
"(",
"CmsXmlContent",
"content",
",",
"CmsFile",
"sitemapConfigFile",
")",
"throws",
"CmsXmlException",
",",
"CmsException",
"{",
"content",
".",
"correctXmlStructure",
"(",
"m_cms",
")",
";",
"byte",
"[",
"]",
"contentBytes"... | Writes a sitemap configuration back to the VFS.<p>
@param content the content to write
@param sitemapConfigFile the file to which the sitemap config should be written
@throws CmsXmlException if an XML processing error occurs
@throws CmsException if something goes wrong | [
"Writes",
"a",
"sitemap",
"configuration",
"back",
"to",
"the",
"VFS",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/sitemap/CmsModelPageHelper.java#L601-L616 |
sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/mails/MailsAdapter.java | MailsAdapter.findMail | public MailInAdapterResult findMail(Mail mail) {
"""
Searches for an equal mail (compares mail id) in the adapter.
@return A {@link MailInAdapterResult} containing the information if the adapter contains that
mail and at which index position. If the adapter doesn't contain this mail, then the result
will cont... | java | public MailInAdapterResult findMail(Mail mail) {
int indexPosition = Collections.binarySearch(items, mail, MailComparator.INSTANCE);
boolean containsMail = false;
Mail found = null;
if (indexPosition < 0) {
indexPosition = ~indexPosition;
} else {
found = items.get(indexPosition);
... | [
"public",
"MailInAdapterResult",
"findMail",
"(",
"Mail",
"mail",
")",
"{",
"int",
"indexPosition",
"=",
"Collections",
".",
"binarySearch",
"(",
"items",
",",
"mail",
",",
"MailComparator",
".",
"INSTANCE",
")",
";",
"boolean",
"containsMail",
"=",
"false",
"... | Searches for an equal mail (compares mail id) in the adapter.
@return A {@link MailInAdapterResult} containing the information if the adapter contains that
mail and at which index position. If the adapter doesn't contain this mail, then the result
will contain the index position where the mail would be. | [
"Searches",
"for",
"an",
"equal",
"mail",
"(",
"compares",
"mail",
"id",
")",
"in",
"the",
"adapter",
"."
] | train | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/mails/MailsAdapter.java#L141-L158 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/corpus/processing/ProcessorContext.java | ProcessorContext.getAs | public <T> T getAs(String name, @NonNull Class<T> clazz) {
"""
Gets as.
@param <T> the type parameter
@param name the name
@param clazz the clazz
@return the as
"""
if (properties.containsKey(name)) {
return Cast.as(properties.get(name), clazz);
}
return Config.get(name).as(... | java | public <T> T getAs(String name, @NonNull Class<T> clazz) {
if (properties.containsKey(name)) {
return Cast.as(properties.get(name), clazz);
}
return Config.get(name).as(clazz);
} | [
"public",
"<",
"T",
">",
"T",
"getAs",
"(",
"String",
"name",
",",
"@",
"NonNull",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"properties",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"Cast",
".",
"as",
"(",
"properties",
... | Gets as.
@param <T> the type parameter
@param name the name
@param clazz the clazz
@return the as | [
"Gets",
"as",
"."
] | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/corpus/processing/ProcessorContext.java#L69-L75 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.removeAll | @SafeVarargs
public static byte[] removeAll(final byte[] a, final byte... elements) {
"""
Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection)
"""
if (N.isNullOrEmpty(a)) {
... | java | @SafeVarargs
public static byte[] removeAll(final byte[] a, final byte... elements) {
if (N.isNullOrEmpty(a)) {
return N.EMPTY_BYTE_ARRAY;
} else if (N.isNullOrEmpty(elements)) {
return a.clone();
} else if (elements.length == 1) {
return removeAllO... | [
"@",
"SafeVarargs",
"public",
"static",
"byte",
"[",
"]",
"removeAll",
"(",
"final",
"byte",
"[",
"]",
"a",
",",
"final",
"byte",
"...",
"elements",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"a",
")",
")",
"{",
"return",
"N",
".",
"EMPTY... | Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection) | [
"Returns",
"a",
"new",
"array",
"with",
"removes",
"all",
"the",
"occurrences",
"of",
"specified",
"elements",
"from",
"<code",
">",
"a<",
"/",
"code",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L23397-L23410 |
vlingo/vlingo-actors | src/main/java/io/vlingo/actors/World.java | World.actorFor | public Protocols actorFor(final Class<?>[] protocols, final Definition definition) {
"""
Answers a {@code Protocols} that provides one or more supported protocols for the
newly created {@code Actor} according to {@code definition}.
@param protocols the {@code Class<?>[]} array of protocols that the {@code Actor}... | java | public Protocols actorFor(final Class<?>[] protocols, final Definition definition) {
if (isTerminated()) {
throw new IllegalStateException("vlingo/actors: Stopped.");
}
return stage().actorFor(protocols, definition);
} | [
"public",
"Protocols",
"actorFor",
"(",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"protocols",
",",
"final",
"Definition",
"definition",
")",
"{",
"if",
"(",
"isTerminated",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"vlingo/actors:... | Answers a {@code Protocols} that provides one or more supported protocols for the
newly created {@code Actor} according to {@code definition}.
@param protocols the {@code Class<?>[]} array of protocols that the {@code Actor} supports
@param definition the {@code Definition} providing parameters to the {@code Actor}
@re... | [
"Answers",
"a",
"{"
] | train | https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/World.java#L151-L157 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.rotate | public static void rotate(Image image, int degree, OutputStream out) throws IORuntimeException {
"""
旋转图片为指定角度<br>
此方法不会关闭输出流
@param image 目标图像
@param degree 旋转角度
@param out 输出流
@since 3.2.2
@throws IORuntimeException IO异常
"""
writeJpg(rotate(image, degree), getImageOutputStream(out));
} | java | public static void rotate(Image image, int degree, OutputStream out) throws IORuntimeException {
writeJpg(rotate(image, degree), getImageOutputStream(out));
} | [
"public",
"static",
"void",
"rotate",
"(",
"Image",
"image",
",",
"int",
"degree",
",",
"OutputStream",
"out",
")",
"throws",
"IORuntimeException",
"{",
"writeJpg",
"(",
"rotate",
"(",
"image",
",",
"degree",
")",
",",
"getImageOutputStream",
"(",
"out",
")"... | 旋转图片为指定角度<br>
此方法不会关闭输出流
@param image 目标图像
@param degree 旋转角度
@param out 输出流
@since 3.2.2
@throws IORuntimeException IO异常 | [
"旋转图片为指定角度<br",
">",
"此方法不会关闭输出流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1030-L1032 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypeReferenceBuilder.java | JvmTypeReferenceBuilder.typeRef | public JvmTypeReference typeRef(String typeName, JvmTypeReference... typeArgs) {
"""
Creates a new {@link JvmTypeReference} pointing to the given class and containing the given type arguments.
@param typeName
the name of the type the reference shall point to.
@param typeArgs
type arguments
@return the newly... | java | public JvmTypeReference typeRef(String typeName, JvmTypeReference... typeArgs) {
JvmType type = references.findDeclaredType(typeName, context);
if (type == null) {
return createUnknownTypeReference(typeName);
}
return typeRef(type, typeArgs);
} | [
"public",
"JvmTypeReference",
"typeRef",
"(",
"String",
"typeName",
",",
"JvmTypeReference",
"...",
"typeArgs",
")",
"{",
"JvmType",
"type",
"=",
"references",
".",
"findDeclaredType",
"(",
"typeName",
",",
"context",
")",
";",
"if",
"(",
"type",
"==",
"null",... | Creates a new {@link JvmTypeReference} pointing to the given class and containing the given type arguments.
@param typeName
the name of the type the reference shall point to.
@param typeArgs
type arguments
@return the newly created {@link JvmTypeReference} | [
"Creates",
"a",
"new",
"{",
"@link",
"JvmTypeReference",
"}",
"pointing",
"to",
"the",
"given",
"class",
"and",
"containing",
"the",
"given",
"type",
"arguments",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypeReferenceBuilder.java#L87-L93 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addMethodInfo | private void addMethodInfo(MethodDoc method, Content dl) {
"""
Add method information.
@param method the method to be documented
@param dl the content tree to which the method information will be added
"""
ClassDoc[] intfacs = method.containingClass().interfaces();
MethodDoc overriddenMetho... | java | private void addMethodInfo(MethodDoc method, Content dl) {
ClassDoc[] intfacs = method.containingClass().interfaces();
MethodDoc overriddenMethod = method.overriddenMethod();
// Check whether there is any implementation or overridden info to be
// printed. If no overridden or implementat... | [
"private",
"void",
"addMethodInfo",
"(",
"MethodDoc",
"method",
",",
"Content",
"dl",
")",
"{",
"ClassDoc",
"[",
"]",
"intfacs",
"=",
"method",
".",
"containingClass",
"(",
")",
".",
"interfaces",
"(",
")",
";",
"MethodDoc",
"overriddenMethod",
"=",
"method"... | Add method information.
@param method the method to be documented
@param dl the content tree to which the method information will be added | [
"Add",
"method",
"information",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L214-L229 |
knightliao/disconf | disconf-core/src/main/java/com/baidu/disconf/core/common/zookeeper/ZookeeperMgr.java | ZookeeperMgr.initInternal | private void initInternal(String hosts, String defaultPrefixString, boolean debug)
throws IOException, InterruptedException {
"""
@return void
@throws IOException
@throws InterruptedException
@Description: 初始化
@author liaoqiqi
@date 2013-6-14
"""
curHost = hosts;
curDefaultP... | java | private void initInternal(String hosts, String defaultPrefixString, boolean debug)
throws IOException, InterruptedException {
curHost = hosts;
curDefaultPrefixString = defaultPrefixString;
store = new ResilientActiveKeyValueStore(debug);
store.connect(hosts);
LOGGE... | [
"private",
"void",
"initInternal",
"(",
"String",
"hosts",
",",
"String",
"defaultPrefixString",
",",
"boolean",
"debug",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"curHost",
"=",
"hosts",
";",
"curDefaultPrefixString",
"=",
"defaultPrefixString"... | @return void
@throws IOException
@throws InterruptedException
@Description: 初始化
@author liaoqiqi
@date 2013-6-14 | [
"@return",
"void"
] | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-core/src/main/java/com/baidu/disconf/core/common/zookeeper/ZookeeperMgr.java#L91-L104 |
oasp/oasp4j | modules/rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java | RestServiceExceptionFacade.createResponse | protected Response createResponse(WebApplicationException exception) {
"""
Add a response message to an existing response.
@param exception the {@link WebApplicationException}.
@return the response with the response message added
"""
Response response = exception.getResponse();
int statusCode = re... | java | protected Response createResponse(WebApplicationException exception) {
Response response = exception.getResponse();
int statusCode = response.getStatus();
Status status = Status.fromStatusCode(statusCode);
NlsRuntimeException error;
if (exception instanceof ServerErrorException) {
error = new... | [
"protected",
"Response",
"createResponse",
"(",
"WebApplicationException",
"exception",
")",
"{",
"Response",
"response",
"=",
"exception",
".",
"getResponse",
"(",
")",
";",
"int",
"statusCode",
"=",
"response",
".",
"getStatus",
"(",
")",
";",
"Status",
"statu... | Add a response message to an existing response.
@param exception the {@link WebApplicationException}.
@return the response with the response message added | [
"Add",
"a",
"response",
"message",
"to",
"an",
"existing",
"response",
"."
] | train | https://github.com/oasp/oasp4j/blob/03f90132699fad95e52ec8efa54aa391f8d3c7e4/modules/rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java#L509-L529 |
wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java | RadialPickerLayout.setItem | private void setItem(int index, Timepoint time) {
"""
Set either the hour, the minute or the second. Will set the internal value, and set the selection.
"""
time = roundToValidTime(time, index);
mCurrentTime = time;
reselectSelector(time, false, index);
} | java | private void setItem(int index, Timepoint time) {
time = roundToValidTime(time, index);
mCurrentTime = time;
reselectSelector(time, false, index);
} | [
"private",
"void",
"setItem",
"(",
"int",
"index",
",",
"Timepoint",
"time",
")",
"{",
"time",
"=",
"roundToValidTime",
"(",
"time",
",",
"index",
")",
";",
"mCurrentTime",
"=",
"time",
";",
"reselectSelector",
"(",
"time",
",",
"false",
",",
"index",
")... | Set either the hour, the minute or the second. Will set the internal value, and set the selection. | [
"Set",
"either",
"the",
"hour",
"the",
"minute",
"or",
"the",
"second",
".",
"Will",
"set",
"the",
"internal",
"value",
"and",
"set",
"the",
"selection",
"."
] | train | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java#L255-L259 |
mapsforge/mapsforge | mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/AndroidUtil.java | AndroidUtil.getAvailableCacheSlots | @SuppressWarnings("deprecation")
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
public static long getAvailableCacheSlots(String directory, int fileSize) {
"""
Get the number of tiles that can be stored on the file system.
@param directory where the cache will reside
@param fileSize average size of ti... | java | @SuppressWarnings("deprecation")
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
public static long getAvailableCacheSlots(String directory, int fileSize) {
StatFs statfs = new StatFs(directory);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
return statfs.getAvail... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"JELLY_BEAN_MR2",
")",
"public",
"static",
"long",
"getAvailableCacheSlots",
"(",
"String",
"directory",
",",
"int",
"fileSize",
")",
"{",
"StatFs",
... | Get the number of tiles that can be stored on the file system.
@param directory where the cache will reside
@param fileSize average size of tile to be cached
@return number of tiles that can be stored without running out of space | [
"Get",
"the",
"number",
"of",
"tiles",
"that",
"can",
"be",
"stored",
"on",
"the",
"file",
"system",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/AndroidUtil.java#L326-L337 |
meltmedia/cadmium | deployer/src/main/java/com/meltmedia/cadmium/deployer/DeployerModule.java | DeployerModule.configure | @Override
protected void configure() {
"""
Called to do all bindings for this module.
@see <a href="http://code.google.com/p/google-guice/">Google Guice</a>
"""
try {
InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
File appRoot = new File(System.getProperty(CadmiumListen... | java | @Override
protected void configure() {
try {
InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
File appRoot = new File(System.getProperty(CadmiumListener.BASE_PATH_ENV), "maven");
FileUtils.forceMkdir(appRoot);
String remoteMavenRepo = System.getProperty(MAVEN_REPOSITORY);... | [
"@",
"Override",
"protected",
"void",
"configure",
"(",
")",
"{",
"try",
"{",
"InternalLoggerFactory",
".",
"setDefaultFactory",
"(",
"new",
"Slf4JLoggerFactory",
"(",
")",
")",
";",
"File",
"appRoot",
"=",
"new",
"File",
"(",
"System",
".",
"getProperty",
"... | Called to do all bindings for this module.
@see <a href="http://code.google.com/p/google-guice/">Google Guice</a> | [
"Called",
"to",
"do",
"all",
"bindings",
"for",
"this",
"module",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/deployer/src/main/java/com/meltmedia/cadmium/deployer/DeployerModule.java#L55-L71 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetExtensionsInner.java | VirtualMachineScaleSetExtensionsInner.createOrUpdateAsync | public Observable<VirtualMachineScaleSetExtensionInner> createOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName, VirtualMachineScaleSetExtensionInner extensionParameters) {
"""
The operation to create or update an extension.
@param resourceGroupName The name of the resource... | java | public Observable<VirtualMachineScaleSetExtensionInner> createOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName, VirtualMachineScaleSetExtensionInner extensionParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, e... | [
"public",
"Observable",
"<",
"VirtualMachineScaleSetExtensionInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"String",
"vmssExtensionName",
",",
"VirtualMachineScaleSetExtensionInner",
"extensionParameters",
")",
"{"... | The operation to create or update an extension.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set where the extension should be create or updated.
@param vmssExtensionName The name of the VM scale set extension.
@param extensionParameters Parameters supplied to... | [
"The",
"operation",
"to",
"create",
"or",
"update",
"an",
"extension",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetExtensionsInner.java#L135-L142 |
Squarespace/cldr | core/src/main/java/com/squarespace/cldr/units/UnitFactorMap.java | UnitFactorMap.resolve | protected UnitFactor resolve(Unit from, Unit to) {
"""
Find the best conversion factor path between the FROM and TO
units, multiply them together and return the resulting factor.
"""
if (from == to) {
return new UnitFactor(Rational.ONE, to);
}
List<UnitFactor> path = getPath(from, to);
... | java | protected UnitFactor resolve(Unit from, Unit to) {
if (from == to) {
return new UnitFactor(Rational.ONE, to);
}
List<UnitFactor> path = getPath(from, to);
if (path.isEmpty()) {
throw new IllegalStateException("Can't find a path to convert " + from + " units into " + to);
}
UnitFacto... | [
"protected",
"UnitFactor",
"resolve",
"(",
"Unit",
"from",
",",
"Unit",
"to",
")",
"{",
"if",
"(",
"from",
"==",
"to",
")",
"{",
"return",
"new",
"UnitFactor",
"(",
"Rational",
".",
"ONE",
",",
"to",
")",
";",
"}",
"List",
"<",
"UnitFactor",
">",
"... | Find the best conversion factor path between the FROM and TO
units, multiply them together and return the resulting factor. | [
"Find",
"the",
"best",
"conversion",
"factor",
"path",
"between",
"the",
"FROM",
"and",
"TO",
"units",
"multiply",
"them",
"together",
"and",
"return",
"the",
"resulting",
"factor",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/core/src/main/java/com/squarespace/cldr/units/UnitFactorMap.java#L201-L216 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java | CmsXmlContentPropertyHelper.getIdForUri | public static CmsUUID getIdForUri(CmsObject cms, String uri) throws CmsException {
"""
Looks up an URI in the sitemap and returns either a sitemap entry id (if the URI is a sitemap URI)
or the structure id of a resource (if the URI is a VFS path).<p>
@param cms the current CMS context
@param uri the URI to lo... | java | public static CmsUUID getIdForUri(CmsObject cms, String uri) throws CmsException {
return cms.readResource(uri).getStructureId();
} | [
"public",
"static",
"CmsUUID",
"getIdForUri",
"(",
"CmsObject",
"cms",
",",
"String",
"uri",
")",
"throws",
"CmsException",
"{",
"return",
"cms",
".",
"readResource",
"(",
"uri",
")",
".",
"getStructureId",
"(",
")",
";",
"}"
] | Looks up an URI in the sitemap and returns either a sitemap entry id (if the URI is a sitemap URI)
or the structure id of a resource (if the URI is a VFS path).<p>
@param cms the current CMS context
@param uri the URI to look up
@return a sitemap entry id or a structure id
@throws CmsException if something goes wrong | [
"Looks",
"up",
"an",
"URI",
"in",
"the",
"sitemap",
"and",
"returns",
"either",
"a",
"sitemap",
"entry",
"id",
"(",
"if",
"the",
"URI",
"is",
"a",
"sitemap",
"URI",
")",
"or",
"the",
"structure",
"id",
"of",
"a",
"resource",
"(",
"if",
"the",
"URI",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java#L198-L201 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.addHierarchicalEntityChild | public UUID addHierarchicalEntityChild(UUID appId, String versionId, UUID hEntityId, AddHierarchicalEntityChildOptionalParameter addHierarchicalEntityChildOptionalParameter) {
"""
Creates a single child in an existing hierarchical entity model.
@param appId The application ID.
@param versionId The version ID.
... | java | public UUID addHierarchicalEntityChild(UUID appId, String versionId, UUID hEntityId, AddHierarchicalEntityChildOptionalParameter addHierarchicalEntityChildOptionalParameter) {
return addHierarchicalEntityChildWithServiceResponseAsync(appId, versionId, hEntityId, addHierarchicalEntityChildOptionalParameter).toBl... | [
"public",
"UUID",
"addHierarchicalEntityChild",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"hEntityId",
",",
"AddHierarchicalEntityChildOptionalParameter",
"addHierarchicalEntityChildOptionalParameter",
")",
"{",
"return",
"addHierarchicalEntityChildWithServic... | Creates a single child in an existing hierarchical entity model.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@param addHierarchicalEntityChildOptionalParameter the object representing the optional parameters to be set before calling this API
... | [
"Creates",
"a",
"single",
"child",
"in",
"an",
"existing",
"hierarchical",
"entity",
"model",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L6645-L6647 |
bignerdranch/expandable-recycler-view | expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java | ExpandableRecyclerAdapter.onCreateViewHolder | @NonNull
@Override
@UiThread
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int viewType) {
"""
Implementation of Adapter.onCreateViewHolder(ViewGroup, int)
that determines if the list item is a parent or a child and calls through
to the appropriate implementation of ... | java | @NonNull
@Override
@UiThread
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int viewType) {
if (isParentViewType(viewType)) {
PVH pvh = onCreateParentViewHolder(viewGroup, viewType);
pvh.setParentViewHolderExpandCollapseListener(mParentViewHol... | [
"@",
"NonNull",
"@",
"Override",
"@",
"UiThread",
"public",
"RecyclerView",
".",
"ViewHolder",
"onCreateViewHolder",
"(",
"@",
"NonNull",
"ViewGroup",
"viewGroup",
",",
"int",
"viewType",
")",
"{",
"if",
"(",
"isParentViewType",
"(",
"viewType",
")",
")",
"{",... | Implementation of Adapter.onCreateViewHolder(ViewGroup, int)
that determines if the list item is a parent or a child and calls through
to the appropriate implementation of either {@link #onCreateParentViewHolder(ViewGroup, int)}
or {@link #onCreateChildViewHolder(ViewGroup, int)}.
@param viewGroup The {@link ViewGroup... | [
"Implementation",
"of",
"Adapter",
".",
"onCreateViewHolder",
"(",
"ViewGroup",
"int",
")",
"that",
"determines",
"if",
"the",
"list",
"item",
"is",
"a",
"parent",
"or",
"a",
"child",
"and",
"calls",
"through",
"to",
"the",
"appropriate",
"implementation",
"of... | train | https://github.com/bignerdranch/expandable-recycler-view/blob/930912510620894c531d236856fa79d646e2f1ed/expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java#L137-L151 |
redkale/redkale | src/org/redkale/asm/ClassReader.java | ClassReader.readTypeAnnotations | private int[] readTypeAnnotations(final MethodVisitor mv,
final Context context, int u, boolean visible) {
"""
Parses a type annotation table to find the labels, and to visit the try
catch block annotations.
@param u
the start offset of a type annotation table.
@param mv
the method visitor to be... | java | private int[] readTypeAnnotations(final MethodVisitor mv,
final Context context, int u, boolean visible) {
char[] c = context.buffer;
int[] offsets = new int[readUnsignedShort(u)];
u += 2;
for (int i = 0; i < offsets.length; ++i) {
offsets[i] = u;
int ... | [
"private",
"int",
"[",
"]",
"readTypeAnnotations",
"(",
"final",
"MethodVisitor",
"mv",
",",
"final",
"Context",
"context",
",",
"int",
"u",
",",
"boolean",
"visible",
")",
"{",
"char",
"[",
"]",
"c",
"=",
"context",
".",
"buffer",
";",
"int",
"[",
"]"... | Parses a type annotation table to find the labels, and to visit the try
catch block annotations.
@param u
the start offset of a type annotation table.
@param mv
the method visitor to be used to visit the try catch block
annotations.
@param context
information about the class being parsed.
@param visible
if the type an... | [
"Parses",
"a",
"type",
"annotation",
"table",
"to",
"find",
"the",
"labels",
"and",
"to",
"visit",
"the",
"try",
"catch",
"block",
"annotations",
"."
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ClassReader.java#L1786-L1848 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.beginCreateOrUpdateAsync | public Observable<VirtualMachineScaleSetInner> beginCreateOrUpdateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) {
"""
Create or update a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set to ... | java | public Observable<VirtualMachineScaleSetInner> beginCreateOrUpdateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, parameters).map(new Func1<ServiceResponse<VirtualMachineScaleSe... | [
"public",
"Observable",
"<",
"VirtualMachineScaleSetInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"VirtualMachineScaleSetInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
... | Create or update a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set to create or update.
@param parameters The scale set object.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the VirtualMachin... | [
"Create",
"or",
"update",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L309-L316 |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/MultiChangeBuilder.java | MultiChangeBuilder.deleteText | public MultiChangeBuilder<PS, SEG, S> deleteText(int startParagraph, int startColumn, int endParagraph, int endColumn) {
"""
Removes a range of text.
It must hold {@code 0 <= start <= end <= getLength()} where
{@code start = getAbsolutePosition(startParagraph, startColumn);} and is <b>inclusive</b>, and
{@cod... | java | public MultiChangeBuilder<PS, SEG, S> deleteText(int startParagraph, int startColumn, int endParagraph, int endColumn) {
int start = area.getAbsolutePosition(startParagraph, startColumn);
int end = area.getAbsolutePosition(endParagraph, endColumn);
return replaceText(start, end, "");
} | [
"public",
"MultiChangeBuilder",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"deleteText",
"(",
"int",
"startParagraph",
",",
"int",
"startColumn",
",",
"int",
"endParagraph",
",",
"int",
"endColumn",
")",
"{",
"int",
"start",
"=",
"area",
".",
"getAbsolutePosition... | Removes a range of text.
It must hold {@code 0 <= start <= end <= getLength()} where
{@code start = getAbsolutePosition(startParagraph, startColumn);} and is <b>inclusive</b>, and
{@code int end = getAbsolutePosition(endParagraph, endColumn);} and is <b>exclusive</b>.
<p><b>Caution:</b> see {@link StyledDocument#getA... | [
"Removes",
"a",
"range",
"of",
"text",
"."
] | train | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/MultiChangeBuilder.java#L288-L292 |
knowm/Sundial | src/main/java/org/knowm/sundial/SundialJobScheduler.java | SundialJobScheduler.addJob | public static void addJob(String jobName, Class<? extends Job> jobClass)
throws SundialSchedulerException {
"""
Adds a Job to the scheduler. Replaces a matching existing Job.
@param jobName
@param jobClass
"""
addJob(jobName, jobClass, null, false);
} | java | public static void addJob(String jobName, Class<? extends Job> jobClass)
throws SundialSchedulerException {
addJob(jobName, jobClass, null, false);
} | [
"public",
"static",
"void",
"addJob",
"(",
"String",
"jobName",
",",
"Class",
"<",
"?",
"extends",
"Job",
">",
"jobClass",
")",
"throws",
"SundialSchedulerException",
"{",
"addJob",
"(",
"jobName",
",",
"jobClass",
",",
"null",
",",
"false",
")",
";",
"}"
... | Adds a Job to the scheduler. Replaces a matching existing Job.
@param jobName
@param jobClass | [
"Adds",
"a",
"Job",
"to",
"the",
"scheduler",
".",
"Replaces",
"a",
"matching",
"existing",
"Job",
"."
] | train | https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L188-L192 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsContentFolderDescriptor.java | CmsContentFolderDescriptor.getFolderPath | public String getFolderPath(CmsObject cms, String pageFolderPath) {
"""
Computes the folder root path.<p>
@param cms the CMS context to use
@param pageFolderPath the root path of the folder containing the current container page
@return the folder root path
"""
if (m_folder != null) {
... | java | public String getFolderPath(CmsObject cms, String pageFolderPath) {
if (m_folder != null) {
try {
return OpenCms.getADEManager().getRootPath(
m_folder.getStructureId(),
cms.getRequestContext().getCurrentProject().isOnlineProject());
... | [
"public",
"String",
"getFolderPath",
"(",
"CmsObject",
"cms",
",",
"String",
"pageFolderPath",
")",
"{",
"if",
"(",
"m_folder",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"OpenCms",
".",
"getADEManager",
"(",
")",
".",
"getRootPath",
"(",
"m_folder",
".... | Computes the folder root path.<p>
@param cms the CMS context to use
@param pageFolderPath the root path of the folder containing the current container page
@return the folder root path | [
"Computes",
"the",
"folder",
"root",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsContentFolderDescriptor.java#L141-L167 |
Pi4J/pi4j | pi4j-core/src/main/java/com/pi4j/temperature/TemperatureConversion.java | TemperatureConversion.convertToFarenheit | public static double convertToFarenheit (TemperatureScale from, double temperature) {
"""
Convert a temperature value from another temperature scale into the Farenheit temperature scale.
@param from TemperatureScale
@param temperature value from other scale
@return converted temperature value in degrees Faren... | java | public static double convertToFarenheit (TemperatureScale from, double temperature) {
switch(from) {
case FARENHEIT:
return temperature;
case CELSIUS:
return convertCelsiusToFarenheit(temperature);
case KELVIN:
return convertK... | [
"public",
"static",
"double",
"convertToFarenheit",
"(",
"TemperatureScale",
"from",
",",
"double",
"temperature",
")",
"{",
"switch",
"(",
"from",
")",
"{",
"case",
"FARENHEIT",
":",
"return",
"temperature",
";",
"case",
"CELSIUS",
":",
"return",
"convertCelsiu... | Convert a temperature value from another temperature scale into the Farenheit temperature scale.
@param from TemperatureScale
@param temperature value from other scale
@return converted temperature value in degrees Farenheit | [
"Convert",
"a",
"temperature",
"value",
"from",
"another",
"temperature",
"scale",
"into",
"the",
"Farenheit",
"temperature",
"scale",
"."
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/temperature/TemperatureConversion.java#L97-L112 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java | CDKMCS.isIsomorph | public static boolean isIsomorph(IAtomContainer sourceGraph, IAtomContainer targetGraph, boolean shouldMatchBonds)
throws CDKException {
"""
Tests if sourceGraph and targetGraph are isomorph.
@param sourceGraph first molecule. Must not be an IQueryAtomContainer.
@param targetGraph second molecu... | java | public static boolean isIsomorph(IAtomContainer sourceGraph, IAtomContainer targetGraph, boolean shouldMatchBonds)
throws CDKException {
if (sourceGraph instanceof IQueryAtomContainer) {
throw new CDKException("The first IAtomContainer must not be an IQueryAtomContainer");
}
... | [
"public",
"static",
"boolean",
"isIsomorph",
"(",
"IAtomContainer",
"sourceGraph",
",",
"IAtomContainer",
"targetGraph",
",",
"boolean",
"shouldMatchBonds",
")",
"throws",
"CDKException",
"{",
"if",
"(",
"sourceGraph",
"instanceof",
"IQueryAtomContainer",
")",
"{",
"t... | Tests if sourceGraph and targetGraph are isomorph.
@param sourceGraph first molecule. Must not be an IQueryAtomContainer.
@param targetGraph second molecule. May be an IQueryAtomContainer.
@param shouldMatchBonds
@return true if the 2 molecule are isomorph
@throws org.openscience.cdk.exception.CDKException if ... | [
"Tests",
"if",
"sourceGraph",
"and",
"targetGraph",
"are",
"isomorph",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java#L156-L181 |
thymeleaf/thymeleaf-spring | thymeleaf-spring4/src/main/java/org/thymeleaf/spring4/processor/SpringErrorClassTagProcessor.java | SpringErrorClassTagProcessor.computeBindStatus | private static BindStatus computeBindStatus(final IExpressionContext context, final IProcessableElementTag tag) {
"""
/*
There are two scenarios for a th:errorclass to appear in: one is in an element for which a th:field has already
been executed, in which case we already have a BindStatus to check for errors; a... | java | private static BindStatus computeBindStatus(final IExpressionContext context, final IProcessableElementTag tag) {
/*
* First, try to obtain an already-existing BindStatus resulting from the execution of a th:field attribute
* in the same element.
*/
final BindStatus bindStatu... | [
"private",
"static",
"BindStatus",
"computeBindStatus",
"(",
"final",
"IExpressionContext",
"context",
",",
"final",
"IProcessableElementTag",
"tag",
")",
"{",
"/*\n * First, try to obtain an already-existing BindStatus resulting from the execution of a th:field attribute\n ... | /*
There are two scenarios for a th:errorclass to appear in: one is in an element for which a th:field has already
been executed, in which case we already have a BindStatus to check for errors; and the other one is an element
for which a th:field has not been executed, but which should have a "name" attribute (either d... | [
"/",
"*",
"There",
"are",
"two",
"scenarios",
"for",
"a",
"th",
":",
"errorclass",
"to",
"appear",
"in",
":",
"one",
"is",
"in",
"an",
"element",
"for",
"which",
"a",
"th",
":",
"field",
"has",
"already",
"been",
"executed",
"in",
"which",
"case",
"w... | train | https://github.com/thymeleaf/thymeleaf-spring/blob/9aa15a19017a0938e57646e3deefb8a90ab78dcb/thymeleaf-spring4/src/main/java/org/thymeleaf/spring4/processor/SpringErrorClassTagProcessor.java#L145-L189 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/controller/impl/PartitionedStepControllerImpl.java | PartitionedStepControllerImpl.receivedLastMessageForPartition | private boolean receivedLastMessageForPartition(PartitionReplyMsg msg, List<Integer> finishedPartitions) {
"""
/*
Check if its the last message received for this partition
We are still checking for THREAD_COMPLETE to maintain compatibility with 8.5.5.7,
which sends FINAL_STATUS without a partitionNumber ,and ... | java | private boolean receivedLastMessageForPartition(PartitionReplyMsg msg, List<Integer> finishedPartitions) {
switch (msg.getMsgType()) {
case PARTITION_FINAL_STATUS:
if (msg.getPartitionPlanConfig() != null) {
partitionFinished(msg);
finishedPa... | [
"private",
"boolean",
"receivedLastMessageForPartition",
"(",
"PartitionReplyMsg",
"msg",
",",
"List",
"<",
"Integer",
">",
"finishedPartitions",
")",
"{",
"switch",
"(",
"msg",
".",
"getMsgType",
"(",
")",
")",
"{",
"case",
"PARTITION_FINAL_STATUS",
":",
"if",
... | /*
Check if its the last message received for this partition
We are still checking for THREAD_COMPLETE to maintain compatibility with 8.5.5.7,
which sends FINAL_STATUS without a partitionNumber ,and THREAD_COMPLETE with a partitionNumber,
although, now the executor does not send a THREAD_COMPLETE message, just a FINAL... | [
"/",
"*",
"Check",
"if",
"its",
"the",
"last",
"message",
"received",
"for",
"this",
"partition"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/controller/impl/PartitionedStepControllerImpl.java#L834-L853 |
akquinet/needle | src/main/java/de/akquinet/jbosscc/needle/db/transaction/TransactionHelper.java | TransactionHelper.executeInTransaction | public final <T> T executeInTransaction(final Runnable<T> runnable) throws Exception {
"""
see executeInTransaction(runnable, clearAfterCommit) .
@param <T>
result type of runnable.run()
@param runnable
algorithm to execute
@return return value of runnable.run()
@throws Exception
execution failed
"""
... | java | public final <T> T executeInTransaction(final Runnable<T> runnable) throws Exception {
return executeInTransaction(runnable, true);
} | [
"public",
"final",
"<",
"T",
">",
"T",
"executeInTransaction",
"(",
"final",
"Runnable",
"<",
"T",
">",
"runnable",
")",
"throws",
"Exception",
"{",
"return",
"executeInTransaction",
"(",
"runnable",
",",
"true",
")",
";",
"}"
] | see executeInTransaction(runnable, clearAfterCommit) .
@param <T>
result type of runnable.run()
@param runnable
algorithm to execute
@return return value of runnable.run()
@throws Exception
execution failed | [
"see",
"executeInTransaction",
"(",
"runnable",
"clearAfterCommit",
")",
"."
] | train | https://github.com/akquinet/needle/blob/8b411c521246b8212882485edc01644f9aac7e24/src/main/java/de/akquinet/jbosscc/needle/db/transaction/TransactionHelper.java#L140-L142 |
andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java | RedBlackTree.del | private Tree<K, V> del(Tree<K, V> tree, K k) {
"""
/* Based on Stefan Kahrs' Haskell version of Okasaki's Red&Black Trees
http://www.cse.unsw.edu.au/~dons/data/RedBlackTree.html
"""
if (tree == null)
return null;
int cmp = ordering.compare(k, tree.getKey(kf));
if (cmp < 0)... | java | private Tree<K, V> del(Tree<K, V> tree, K k) {
if (tree == null)
return null;
int cmp = ordering.compare(k, tree.getKey(kf));
if (cmp < 0) return delLeft(tree, k);
else if (cmp > 0) return delRight(tree, k);
else return append(tree.getLeft(), tree.getRight());
} | [
"private",
"Tree",
"<",
"K",
",",
"V",
">",
"del",
"(",
"Tree",
"<",
"K",
",",
"V",
">",
"tree",
",",
"K",
"k",
")",
"{",
"if",
"(",
"tree",
"==",
"null",
")",
"return",
"null",
";",
"int",
"cmp",
"=",
"ordering",
".",
"compare",
"(",
"k",
... | /* Based on Stefan Kahrs' Haskell version of Okasaki's Red&Black Trees
http://www.cse.unsw.edu.au/~dons/data/RedBlackTree.html | [
"/",
"*",
"Based",
"on",
"Stefan",
"Kahrs",
"Haskell",
"version",
"of",
"Okasaki",
"s",
"Red&Black",
"Trees",
"http",
":",
"//",
"www",
".",
"cse",
".",
"unsw",
".",
"edu",
".",
"au",
"/",
"~dons",
"/",
"data",
"/",
"RedBlackTree",
".",
"html"
] | train | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java#L264-L272 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/waiters/AmazonS3Waiters.java | AmazonS3Waiters.objectNotExists | public Waiter objectNotExists() {
"""
Builds a ObjectNotExists waiter by using custom parameters
waiterParameters and other parameters defined in the waiters
specification, and then polls until it determines whether the resource
entered the desired state or not, where polling criteria is bound by
either defaul... | java | public Waiter objectNotExists() {
return new WaiterBuilder<GetObjectMetadataRequest, ObjectMetadata>()
.withSdkFunction(new HeadObjectFunction(client))
.withAcceptors(
new HttpFailureStatusAcceptor(404, WaiterState.SUCCESS))
.withDefaultPo... | [
"public",
"Waiter",
"objectNotExists",
"(",
")",
"{",
"return",
"new",
"WaiterBuilder",
"<",
"GetObjectMetadataRequest",
",",
"ObjectMetadata",
">",
"(",
")",
".",
"withSdkFunction",
"(",
"new",
"HeadObjectFunction",
"(",
"client",
")",
")",
".",
"withAcceptors",
... | Builds a ObjectNotExists waiter by using custom parameters
waiterParameters and other parameters defined in the waiters
specification, and then polls until it determines whether the resource
entered the desired state or not, where polling criteria is bound by
either default polling strategy or custom polling strategy. | [
"Builds",
"a",
"ObjectNotExists",
"waiter",
"by",
"using",
"custom",
"parameters",
"waiterParameters",
"and",
"other",
"parameters",
"defined",
"in",
"the",
"waiters",
"specification",
"and",
"then",
"polls",
"until",
"it",
"determines",
"whether",
"the",
"resource"... | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/waiters/AmazonS3Waiters.java#L114-L124 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newReadOnlyException | public static ReadOnlyException newReadOnlyException(String message, Object... args) {
"""
Constructs and initializes a new {@link ReadOnlyException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link ReadOnlyException ... | java | public static ReadOnlyException newReadOnlyException(String message, Object... args) {
return newReadOnlyException(null, message, args);
} | [
"public",
"static",
"ReadOnlyException",
"newReadOnlyException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newReadOnlyException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link ReadOnlyException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link ReadOnlyException exception}.
@param args {@link Object[] arguments} used to replace format placeholders in the {@lin... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"ReadOnlyException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L845-L847 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.joinDescendants | private Context joinDescendants(Context ancestor, Context[] descendants) {
"""
Join one or more descendant context's together. To understand this, consider
the following snippet, annotated with context information:
<pre>
// Context: y >= 0
if x >= 0:
x = x + 1
// Context: y >= 0 && x >= 0 && x$1 == x + 1
... | java | private Context joinDescendants(Context ancestor, Context[] descendants) {
// Santity check parameters, as they maybe null. This happens in case of
// branches which terminate (e.g. via return or break).
descendants = removeNull(descendants);
if (descendants.length == 0) {
// In this case, the are actually n... | [
"private",
"Context",
"joinDescendants",
"(",
"Context",
"ancestor",
",",
"Context",
"[",
"]",
"descendants",
")",
"{",
"// Santity check parameters, as they maybe null. This happens in case of",
"// branches which terminate (e.g. via return or break).",
"descendants",
"=",
"remove... | Join one or more descendant context's together. To understand this, consider
the following snippet, annotated with context information:
<pre>
// Context: y >= 0
if x >= 0:
x = x + 1
// Context: y >= 0 && x >= 0 && x$1 == x + 1
else:
x = -x
// Context: y >= 0 && x < 0 && x$2 == x + 1
//
Context: ?
</pre>
At this point... | [
"Join",
"one",
"or",
"more",
"descendant",
"context",
"s",
"together",
".",
"To",
"understand",
"this",
"consider",
"the",
"following",
"snippet",
"annotated",
"with",
"context",
"information",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L1816-L1844 |
ops4j/org.ops4j.pax.wicket | service/src/main/java/org/ops4j/pax/wicket/internal/HttpTracker.java | HttpTracker.addServlet | public final void addServlet(String mountPoint, Servlet servlet, Map<?, ?> contextParams, Bundle paxWicketBundle) {
"""
<p>addServlet.</p>
@param mountPoint a {@link java.lang.String} object.
@param servlet a {@link javax.servlet.Servlet} object.
@param contextParams a {@link java.util.Map} object.
@param pa... | java | public final void addServlet(String mountPoint, Servlet servlet, Map<?, ?> contextParams, Bundle paxWicketBundle) {
mountPoint = GenericContext.normalizeMountPoint(mountPoint);
ServletDescriptor descriptor =
new ServletDescriptor(servlet, mountPoint, paxWicketBundle, contextParams);
... | [
"public",
"final",
"void",
"addServlet",
"(",
"String",
"mountPoint",
",",
"Servlet",
"servlet",
",",
"Map",
"<",
"?",
",",
"?",
">",
"contextParams",
",",
"Bundle",
"paxWicketBundle",
")",
"{",
"mountPoint",
"=",
"GenericContext",
".",
"normalizeMountPoint",
... | <p>addServlet.</p>
@param mountPoint a {@link java.lang.String} object.
@param servlet a {@link javax.servlet.Servlet} object.
@param contextParams a {@link java.util.Map} object.
@param paxWicketBundle a {@link org.osgi.framework.Bundle} object. | [
"<p",
">",
"addServlet",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ops4j/org.ops4j.pax.wicket/blob/ef7cb4bdf918e9e61ec69789b9c690567616faa9/service/src/main/java/org/ops4j/pax/wicket/internal/HttpTracker.java#L121-L135 |
kite-sdk/kite | kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/avro/AvroUtils.java | AvroUtils.readAvroEntity | public static <T> T readAvroEntity(byte[] bytes, DatumReader<T> reader) {
"""
Given a byte array and a DatumReader, decode an avro entity from the byte
array. Decodes using the avro BinaryDecoder. Return the constructed entity.
@param bytes
The byte array to decode the entity from.
@param reader
The DatumRe... | java | public static <T> T readAvroEntity(byte[] bytes, DatumReader<T> reader) {
Decoder decoder = new DecoderFactory().binaryDecoder(bytes, null);
return AvroUtils.<T> readAvroEntity(decoder, reader);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"readAvroEntity",
"(",
"byte",
"[",
"]",
"bytes",
",",
"DatumReader",
"<",
"T",
">",
"reader",
")",
"{",
"Decoder",
"decoder",
"=",
"new",
"DecoderFactory",
"(",
")",
".",
"binaryDecoder",
"(",
"bytes",
",",
"nul... | Given a byte array and a DatumReader, decode an avro entity from the byte
array. Decodes using the avro BinaryDecoder. Return the constructed entity.
@param bytes
The byte array to decode the entity from.
@param reader
The DatumReader that will decode the byte array.
@return The Avro entity. | [
"Given",
"a",
"byte",
"array",
"and",
"a",
"DatumReader",
"decode",
"an",
"avro",
"entity",
"from",
"the",
"byte",
"array",
".",
"Decodes",
"using",
"the",
"avro",
"BinaryDecoder",
".",
"Return",
"the",
"constructed",
"entity",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/avro/AvroUtils.java#L65-L68 |
cdk/cdk | base/data/src/main/java/org/openscience/cdk/Reaction.java | Reaction.addReactant | @Override
public void addReactant(IAtomContainer reactant, Double coefficient) {
"""
Adds a reactant to this reaction with a stoichiometry coefficient.
@param reactant Molecule added as reactant to this reaction
@param coefficient Stoichiometry coefficient for this molecule
@see #getReactants
"""... | java | @Override
public void addReactant(IAtomContainer reactant, Double coefficient) {
reactants.addAtomContainer(reactant, coefficient);
notifyChanged();
} | [
"@",
"Override",
"public",
"void",
"addReactant",
"(",
"IAtomContainer",
"reactant",
",",
"Double",
"coefficient",
")",
"{",
"reactants",
".",
"addAtomContainer",
"(",
"reactant",
",",
"coefficient",
")",
";",
"notifyChanged",
"(",
")",
";",
"}"
] | Adds a reactant to this reaction with a stoichiometry coefficient.
@param reactant Molecule added as reactant to this reaction
@param coefficient Stoichiometry coefficient for this molecule
@see #getReactants | [
"Adds",
"a",
"reactant",
"to",
"this",
"reaction",
"with",
"a",
"stoichiometry",
"coefficient",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/data/src/main/java/org/openscience/cdk/Reaction.java#L244-L248 |
apache/incubator-gobblin | gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSClusterLauncher.java | GobblinAWSClusterLauncher.setupGobblinCluster | @VisibleForTesting
String setupGobblinCluster() throws IOException {
"""
Setup the Gobblin AWS cluster.
@throws IOException If there's anything wrong setting up the AWS cluster
"""
final String uuid = UUID.randomUUID().toString();
// Create security group
// TODO: Make security group restric... | java | @VisibleForTesting
String setupGobblinCluster() throws IOException {
final String uuid = UUID.randomUUID().toString();
// Create security group
// TODO: Make security group restrictive
final String securityGroupName = "GobblinSecurityGroup_" + uuid;
this.awsSdkClient.createSecurityGroup(security... | [
"@",
"VisibleForTesting",
"String",
"setupGobblinCluster",
"(",
")",
"throws",
"IOException",
"{",
"final",
"String",
"uuid",
"=",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
";",
"// Create security group",
"// TODO: Make security group restrictiv... | Setup the Gobblin AWS cluster.
@throws IOException If there's anything wrong setting up the AWS cluster | [
"Setup",
"the",
"Gobblin",
"AWS",
"cluster",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSClusterLauncher.java#L406-L437 |
authlete/authlete-java-common | src/main/java/com/authlete/common/util/TypedProperties.java | TypedProperties.getInt | public int getInt(Enum<?> key, int defaultValue) {
"""
Equivalent to {@link #getInt(String, int)
getInt}{@code (key.name(), defaultValue)}.
If {@code key} is null}, {@code defaultValue} is returned.
"""
if (key == null)
{
return defaultValue;
}
return getInt(key.n... | java | public int getInt(Enum<?> key, int defaultValue)
{
if (key == null)
{
return defaultValue;
}
return getInt(key.name(), defaultValue);
} | [
"public",
"int",
"getInt",
"(",
"Enum",
"<",
"?",
">",
"key",
",",
"int",
"defaultValue",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"return",
"getInt",
"(",
"key",
".",
"name",
"(",
")",
",",
"defaultVa... | Equivalent to {@link #getInt(String, int)
getInt}{@code (key.name(), defaultValue)}.
If {@code key} is null}, {@code defaultValue} is returned. | [
"Equivalent",
"to",
"{"
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/TypedProperties.java#L243-L251 |
jingwei/krati | krati-main/src/main/java/krati/util/SourceWaterMarks.java | SourceWaterMarks.setLWMScn | public void setLWMScn(String source, long scn) {
"""
Sets the low water mark of a source
@param source - the source
@param scn - the water mark value
"""
WaterMarkEntry e = sourceWaterMarkMap.get(source);
if (e == null) {
e = new WaterMarkEntry(source);
sourceWate... | java | public void setLWMScn(String source, long scn) {
WaterMarkEntry e = sourceWaterMarkMap.get(source);
if (e == null) {
e = new WaterMarkEntry(source);
sourceWaterMarkMap.put(source, e);
}
e.setLWMScn(scn);
} | [
"public",
"void",
"setLWMScn",
"(",
"String",
"source",
",",
"long",
"scn",
")",
"{",
"WaterMarkEntry",
"e",
"=",
"sourceWaterMarkMap",
".",
"get",
"(",
"source",
")",
";",
"if",
"(",
"e",
"==",
"null",
")",
"{",
"e",
"=",
"new",
"WaterMarkEntry",
"(",... | Sets the low water mark of a source
@param source - the source
@param scn - the water mark value | [
"Sets",
"the",
"low",
"water",
"mark",
"of",
"a",
"source"
] | train | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/SourceWaterMarks.java#L213-L220 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nstrafficdomain_bridgegroup_binding.java | nstrafficdomain_bridgegroup_binding.count_filtered | public static long count_filtered(nitro_service service, Long td, String filter) throws Exception {
"""
Use this API to count the filtered set of nstrafficdomain_bridgegroup_binding resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
"""
nstrafficdomain_bridgegroup_binding obj ... | java | public static long count_filtered(nitro_service service, Long td, String filter) throws Exception{
nstrafficdomain_bridgegroup_binding obj = new nstrafficdomain_bridgegroup_binding();
obj.set_td(td);
options option = new options();
option.set_count(true);
option.set_filter(filter);
nstrafficdomain_bridgegro... | [
"public",
"static",
"long",
"count_filtered",
"(",
"nitro_service",
"service",
",",
"Long",
"td",
",",
"String",
"filter",
")",
"throws",
"Exception",
"{",
"nstrafficdomain_bridgegroup_binding",
"obj",
"=",
"new",
"nstrafficdomain_bridgegroup_binding",
"(",
")",
";",
... | Use this API to count the filtered set of nstrafficdomain_bridgegroup_binding resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP". | [
"Use",
"this",
"API",
"to",
"count",
"the",
"filtered",
"set",
"of",
"nstrafficdomain_bridgegroup_binding",
"resources",
".",
"filter",
"string",
"should",
"be",
"in",
"JSON",
"format",
".",
"eg",
":",
"port",
":",
"80",
"servicetype",
":",
"HTTP",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nstrafficdomain_bridgegroup_binding.java#L227-L238 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java | JsonUtil.putShortList | public static void putShortList(Writer writer, List<Short> values) throws IOException {
"""
Writes the given value with the given writer.
@param writer
@param values
@throws IOException
@author vvakame
"""
if (values == null) {
writer.write("null");
} else {
startArray(writer);
for (int i = 0;... | java | public static void putShortList(Writer writer, List<Short> values) throws IOException {
if (values == null) {
writer.write("null");
} else {
startArray(writer);
for (int i = 0; i < values.size(); i++) {
put(writer, values.get(i));
if (i != values.size() - 1) {
addSeparator(writer);
}
}
... | [
"public",
"static",
"void",
"putShortList",
"(",
"Writer",
"writer",
",",
"List",
"<",
"Short",
">",
"values",
")",
"throws",
"IOException",
"{",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"writer",
".",
"write",
"(",
"\"null\"",
")",
";",
"}",
"else... | Writes the given value with the given writer.
@param writer
@param values
@throws IOException
@author vvakame | [
"Writes",
"the",
"given",
"value",
"with",
"the",
"given",
"writer",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java#L308-L321 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/VoltXMLElement.java | VoltXMLElement.findChild | public VoltXMLElement findChild(String elementName, String attributeName) {
"""
Given the element name ('table') and the attribute name ('foo'), find
the matching child element, if any
"""
String attName = attributeName;
if (attName == null) {
attName = "default";
}
... | java | public VoltXMLElement findChild(String elementName, String attributeName)
{
String attName = attributeName;
if (attName == null) {
attName = "default";
}
return findChild(elementName + attName);
} | [
"public",
"VoltXMLElement",
"findChild",
"(",
"String",
"elementName",
",",
"String",
"attributeName",
")",
"{",
"String",
"attName",
"=",
"attributeName",
";",
"if",
"(",
"attName",
"==",
"null",
")",
"{",
"attName",
"=",
"\"default\"",
";",
"}",
"return",
... | Given the element name ('table') and the attribute name ('foo'), find
the matching child element, if any | [
"Given",
"the",
"element",
"name",
"(",
"table",
")",
"and",
"the",
"attribute",
"name",
"(",
"foo",
")",
"find",
"the",
"matching",
"child",
"element",
"if",
"any"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/VoltXMLElement.java#L228-L235 |
amaembo/streamex | src/main/java/one/util/streamex/StreamEx.java | StreamEx.mapLast | public StreamEx<T> mapLast(Function<? super T, ? extends T> mapper) {
"""
Returns a stream where the last element is the replaced with the result
of applying the given function while the other elements are left intact.
<p>
This is a <a href="package-summary.html#StreamOps">quasi-intermediate
operation</a>.
... | java | public StreamEx<T> mapLast(Function<? super T, ? extends T> mapper) {
return supply(new PairSpliterator.PSOfRef<>(mapper, spliterator(), false));
} | [
"public",
"StreamEx",
"<",
"T",
">",
"mapLast",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"T",
">",
"mapper",
")",
"{",
"return",
"supply",
"(",
"new",
"PairSpliterator",
".",
"PSOfRef",
"<>",
"(",
"mapper",
",",
"spliterator",
"(",... | Returns a stream where the last element is the replaced with the result
of applying the given function while the other elements are left intact.
<p>
This is a <a href="package-summary.html#StreamOps">quasi-intermediate
operation</a>.
<p>
The mapper function is called at most once. It could be not called at all
if the... | [
"Returns",
"a",
"stream",
"where",
"the",
"last",
"element",
"is",
"the",
"replaced",
"with",
"the",
"result",
"of",
"applying",
"the",
"given",
"function",
"while",
"the",
"other",
"elements",
"are",
"left",
"intact",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L271-L273 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.hasExtension | @Pure
public static boolean hasExtension(File filename, String extension) {
"""
Replies if the specified file has the specified extension.
<p>The test is dependent of the case-sensitive attribute of operating system.
@param filename is the filename to parse
@param extension is the extension to test.
@retu... | java | @Pure
public static boolean hasExtension(File filename, String extension) {
if (filename == null) {
return false;
}
assert extension != null;
String extent = extension;
if (!"".equals(extent) && !extent.startsWith(EXTENSION_SEPARATOR)) { //$NON-NLS-1$
extent = EXTENSION_SEPARATOR + extent;
}
final ... | [
"@",
"Pure",
"public",
"static",
"boolean",
"hasExtension",
"(",
"File",
"filename",
",",
"String",
"extension",
")",
"{",
"if",
"(",
"filename",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"assert",
"extension",
"!=",
"null",
";",
"String",
"ex... | Replies if the specified file has the specified extension.
<p>The test is dependent of the case-sensitive attribute of operating system.
@param filename is the filename to parse
@param extension is the extension to test.
@return <code>true</code> if the given filename has the given extension,
otherwise <code>false</c... | [
"Replies",
"if",
"the",
"specified",
"file",
"has",
"the",
"specified",
"extension",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L1137-L1155 |
facebook/fresco | native-filters/src/main/java/com/facebook/imagepipeline/nativecode/NativeBlurFilter.java | NativeBlurFilter.iterativeBoxBlur | public static void iterativeBoxBlur(Bitmap bitmap, int iterations, int blurRadius) {
"""
This is a fast, native implementation of an iterative box blur. The algorithm runs in-place on
the provided bitmap and therefore has a very small memory footprint.
<p>
The iterative box blur has the nice property that it ap... | java | public static void iterativeBoxBlur(Bitmap bitmap, int iterations, int blurRadius) {
Preconditions.checkNotNull(bitmap);
Preconditions.checkArgument(iterations > 0);
Preconditions.checkArgument(blurRadius > 0);
nativeIterativeBoxBlur(bitmap, iterations, blurRadius);
} | [
"public",
"static",
"void",
"iterativeBoxBlur",
"(",
"Bitmap",
"bitmap",
",",
"int",
"iterations",
",",
"int",
"blurRadius",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"bitmap",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"iterations",
">",
... | This is a fast, native implementation of an iterative box blur. The algorithm runs in-place on
the provided bitmap and therefore has a very small memory footprint.
<p>
The iterative box blur has the nice property that it approximates the Gaussian blur very
quickly. Usually iterations=3 is sufficient such that the casua... | [
"This",
"is",
"a",
"fast",
"native",
"implementation",
"of",
"an",
"iterative",
"box",
"blur",
".",
"The",
"algorithm",
"runs",
"in",
"-",
"place",
"on",
"the",
"provided",
"bitmap",
"and",
"therefore",
"has",
"a",
"very",
"small",
"memory",
"footprint",
"... | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/native-filters/src/main/java/com/facebook/imagepipeline/nativecode/NativeBlurFilter.java#L44-L50 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java | CommonOps_DDF3.add | public static void add( DMatrix3 a , DMatrix3 b , DMatrix3 c ) {
"""
<p>Performs the following operation:<br>
<br>
c = a + b <br>
c<sub>i</sub> = a<sub>i</sub> + b<sub>i</sub> <br>
</p>
<p>
Vector C can be the same instance as Vector A and/or B.
</p>
@param a A Vector. Not modified.
@param b A Vector.... | java | public static void add( DMatrix3 a , DMatrix3 b , DMatrix3 c ) {
c.a1 = a.a1 + b.a1;
c.a2 = a.a2 + b.a2;
c.a3 = a.a3 + b.a3;
} | [
"public",
"static",
"void",
"add",
"(",
"DMatrix3",
"a",
",",
"DMatrix3",
"b",
",",
"DMatrix3",
"c",
")",
"{",
"c",
".",
"a1",
"=",
"a",
".",
"a1",
"+",
"b",
".",
"a1",
";",
"c",
".",
"a2",
"=",
"a",
".",
"a2",
"+",
"b",
".",
"a2",
";",
"... | <p>Performs the following operation:<br>
<br>
c = a + b <br>
c<sub>i</sub> = a<sub>i</sub> + b<sub>i</sub> <br>
</p>
<p>
Vector C can be the same instance as Vector A and/or B.
</p>
@param a A Vector. Not modified.
@param b A Vector. Not modified.
@param c A Vector where the results are stored. Modified. | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"c",
"=",
"a",
"+",
"b",
"<br",
">",
"c<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"+",
"b<sub",
">",
"i<",
"/",
"sub",
">",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java#L74-L78 |
trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/messages/Requests.java | Requests.createPublishNotify | public static PublishNotify createPublishNotify(Identifier i1, Document md) {
"""
Create a new {@link PublishNotify} instance that is used to publish
metadata to an {@link Identifier}.
@param i1 the {@link Identifier} to which the given metadata is published to
@param md the metadata that shall be published
... | java | public static PublishNotify createPublishNotify(Identifier i1, Document md) {
return createPublishNotify(i1, null, md);
} | [
"public",
"static",
"PublishNotify",
"createPublishNotify",
"(",
"Identifier",
"i1",
",",
"Document",
"md",
")",
"{",
"return",
"createPublishNotify",
"(",
"i1",
",",
"null",
",",
"md",
")",
";",
"}"
] | Create a new {@link PublishNotify} instance that is used to publish
metadata to an {@link Identifier}.
@param i1 the {@link Identifier} to which the given metadata is published to
@param md the metadata that shall be published
@return the new {@link PublishNotify} instance | [
"Create",
"a",
"new",
"{",
"@link",
"PublishNotify",
"}",
"instance",
"that",
"is",
"used",
"to",
"publish",
"metadata",
"to",
"an",
"{",
"@link",
"Identifier",
"}",
"."
] | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/messages/Requests.java#L470-L472 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/AbstractPoint.java | AbstractPoint.subtract | public static final Point subtract(Point p1, Point p2) {
"""
Returns a new Point(p1.x - p2.x, p1.y - p2.y)
@param p1
@param p2
@return Returns a new Point(p1.x - p2.x, p1.y - p2.y)
"""
return new AbstractPoint(p1.getX() - p2.getX(), p1.getY() - p2.getY());
} | java | public static final Point subtract(Point p1, Point p2)
{
return new AbstractPoint(p1.getX() - p2.getX(), p1.getY() - p2.getY());
} | [
"public",
"static",
"final",
"Point",
"subtract",
"(",
"Point",
"p1",
",",
"Point",
"p2",
")",
"{",
"return",
"new",
"AbstractPoint",
"(",
"p1",
".",
"getX",
"(",
")",
"-",
"p2",
".",
"getX",
"(",
")",
",",
"p1",
".",
"getY",
"(",
")",
"-",
"p2",... | Returns a new Point(p1.x - p2.x, p1.y - p2.y)
@param p1
@param p2
@return Returns a new Point(p1.x - p2.x, p1.y - p2.y) | [
"Returns",
"a",
"new",
"Point",
"(",
"p1",
".",
"x",
"-",
"p2",
".",
"x",
"p1",
".",
"y",
"-",
"p2",
".",
"y",
")"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/AbstractPoint.java#L129-L132 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/endpoint/AbstractEndpointComponent.java | AbstractEndpointComponent.enrichEndpointConfiguration | protected void enrichEndpointConfiguration(EndpointConfiguration endpointConfiguration, Map<String, String> parameters, TestContext context) {
"""
Sets properties on endpoint configuration using method reflection.
@param endpointConfiguration
@param parameters
@param context
"""
for (Map.Entry<Strin... | java | protected void enrichEndpointConfiguration(EndpointConfiguration endpointConfiguration, Map<String, String> parameters, TestContext context) {
for (Map.Entry<String, String> parameterEntry : parameters.entrySet()) {
Field field = ReflectionUtils.findField(endpointConfiguration.getClass(), parameterE... | [
"protected",
"void",
"enrichEndpointConfiguration",
"(",
"EndpointConfiguration",
"endpointConfiguration",
",",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"TestContext",
"context",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
... | Sets properties on endpoint configuration using method reflection.
@param endpointConfiguration
@param parameters
@param context | [
"Sets",
"properties",
"on",
"endpoint",
"configuration",
"using",
"method",
"reflection",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/endpoint/AbstractEndpointComponent.java#L110-L131 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java | SDNN.dotProductAttention | public SDVariable dotProductAttention(String name, SDVariable queries, SDVariable keys, SDVariable values, SDVariable mask, boolean scaled) {
"""
This operation performs dot product attention on the given timeseries input with the given queries
@see #dotProductAttention(String, SDVariable, SDVariable, SDVariable,... | java | public SDVariable dotProductAttention(String name, SDVariable queries, SDVariable keys, SDVariable values, SDVariable mask, boolean scaled){
final SDVariable result = f().dotProductAttention(queries, keys, values, mask, scaled);
return updateVariableNameAndReference(result, name);
} | [
"public",
"SDVariable",
"dotProductAttention",
"(",
"String",
"name",
",",
"SDVariable",
"queries",
",",
"SDVariable",
"keys",
",",
"SDVariable",
"values",
",",
"SDVariable",
"mask",
",",
"boolean",
"scaled",
")",
"{",
"final",
"SDVariable",
"result",
"=",
"f",
... | This operation performs dot product attention on the given timeseries input with the given queries
@see #dotProductAttention(String, SDVariable, SDVariable, SDVariable, SDVariable, boolean, boolean) | [
"This",
"operation",
"performs",
"dot",
"product",
"attention",
"on",
"the",
"given",
"timeseries",
"input",
"with",
"the",
"given",
"queries"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java#L842-L845 |
groupe-sii/ogham | ogham-email-sendgrid/src/main/java/fr/sii/ogham/email/sender/impl/sendgrid/handler/MultiContentHandler.java | MultiContentHandler.setContent | @Override
public void setContent(final SendGrid.Email email, final Content content) throws ContentHandlerException {
"""
Reads the content and adds it into the email. This method is expected to
update the content of the {@code email} parameter.
While the method signature accepts any {@link Content} instance ... | java | @Override
public void setContent(final SendGrid.Email email, final Content content) throws ContentHandlerException {
if (email == null) {
throw new IllegalArgumentException("[email] cannot be null");
}
if (content == null) {
throw new IllegalArgumentException("[content] cannot be null");
}
if... | [
"@",
"Override",
"public",
"void",
"setContent",
"(",
"final",
"SendGrid",
".",
"Email",
"email",
",",
"final",
"Content",
"content",
")",
"throws",
"ContentHandlerException",
"{",
"if",
"(",
"email",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentExc... | Reads the content and adds it into the email. This method is expected to
update the content of the {@code email} parameter.
While the method signature accepts any {@link Content} instance as
parameter, the method will fail if anything other than a
{@link MultiContent} is provided.
@param email
the email to put the co... | [
"Reads",
"the",
"content",
"and",
"adds",
"it",
"into",
"the",
"email",
".",
"This",
"method",
"is",
"expected",
"to",
"update",
"the",
"content",
"of",
"the",
"{",
"@code",
"email",
"}",
"parameter",
"."
] | train | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-sendgrid/src/main/java/fr/sii/ogham/email/sender/impl/sendgrid/handler/MultiContentHandler.java#L52-L68 |
milaboratory/milib | src/main/java/com/milaboratory/core/alignment/Alignment.java | Alignment.convertToSeq2Range | public Range convertToSeq2Range(Range rangeInSeq1) {
"""
Converts range in sequence1 to range in sequence2, or returns null if input range is not fully covered by
alignment
@param rangeInSeq1 range in sequence 1
@return range in sequence2 or null if rangeInSeq1 is not fully covered by alignment
"""
... | java | public Range convertToSeq2Range(Range rangeInSeq1) {
int from = aabs(convertToSeq2Position(rangeInSeq1.getFrom()));
int to = aabs(convertToSeq2Position(rangeInSeq1.getTo()));
if (from == -1 || to == -1)
return null;
return new Range(from, to);
} | [
"public",
"Range",
"convertToSeq2Range",
"(",
"Range",
"rangeInSeq1",
")",
"{",
"int",
"from",
"=",
"aabs",
"(",
"convertToSeq2Position",
"(",
"rangeInSeq1",
".",
"getFrom",
"(",
")",
")",
")",
";",
"int",
"to",
"=",
"aabs",
"(",
"convertToSeq2Position",
"("... | Converts range in sequence1 to range in sequence2, or returns null if input range is not fully covered by
alignment
@param rangeInSeq1 range in sequence 1
@return range in sequence2 or null if rangeInSeq1 is not fully covered by alignment | [
"Converts",
"range",
"in",
"sequence1",
"to",
"range",
"in",
"sequence2",
"or",
"returns",
"null",
"if",
"input",
"range",
"is",
"not",
"fully",
"covered",
"by",
"alignment"
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/alignment/Alignment.java#L248-L256 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/conversion/AbstractConverter.java | AbstractConverter.isAssignableTo | @NullSafe
protected boolean isAssignableTo(Class<?> fromType, Class<?>... toTypes) {
"""
Determines whether the {@link Class from type} is {@link ClassUtils#assignableTo(Class, Class) assignable to}
any of the {@link Class to types}.
@param fromType {@link Class type} to evaluate.
@param toTypes {@link Clas... | java | @NullSafe
protected boolean isAssignableTo(Class<?> fromType, Class<?>... toTypes) {
for (Class toType : nullSafeArray(toTypes, Class.class)) {
if (assignableTo(fromType, toType)) {
return true;
}
}
return false;
} | [
"@",
"NullSafe",
"protected",
"boolean",
"isAssignableTo",
"(",
"Class",
"<",
"?",
">",
"fromType",
",",
"Class",
"<",
"?",
">",
"...",
"toTypes",
")",
"{",
"for",
"(",
"Class",
"toType",
":",
"nullSafeArray",
"(",
"toTypes",
",",
"Class",
".",
"class",
... | Determines whether the {@link Class from type} is {@link ClassUtils#assignableTo(Class, Class) assignable to}
any of the {@link Class to types}.
@param fromType {@link Class type} to evaluate.
@param toTypes {@link Class types} checked for assignment compatibility.
@return {@literal true} if {@link Class from type} is... | [
"Determines",
"whether",
"the",
"{",
"@link",
"Class",
"from",
"type",
"}",
"is",
"{",
"@link",
"ClassUtils#assignableTo",
"(",
"Class",
"Class",
")",
"assignable",
"to",
"}",
"any",
"of",
"the",
"{",
"@link",
"Class",
"to",
"types",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/conversion/AbstractConverter.java#L146-L156 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/actions/InputAction.java | InputAction.checkAnswer | private boolean checkAnswer(String input) {
"""
Validate given input according to valid answer tokens.
@param input
@return
"""
StringTokenizer tok = new StringTokenizer(validAnswers, ANSWER_SEPARATOR);
while (tok.hasMoreTokens()) {
if (tok.nextElement().toString().trim().equalsI... | java | private boolean checkAnswer(String input) {
StringTokenizer tok = new StringTokenizer(validAnswers, ANSWER_SEPARATOR);
while (tok.hasMoreTokens()) {
if (tok.nextElement().toString().trim().equalsIgnoreCase(input.trim())) {
return true;
}
}
log.in... | [
"private",
"boolean",
"checkAnswer",
"(",
"String",
"input",
")",
"{",
"StringTokenizer",
"tok",
"=",
"new",
"StringTokenizer",
"(",
"validAnswers",
",",
"ANSWER_SEPARATOR",
")",
";",
"while",
"(",
"tok",
".",
"hasMoreTokens",
"(",
")",
")",
"{",
"if",
"(",
... | Validate given input according to valid answer tokens.
@param input
@return | [
"Validate",
"given",
"input",
"according",
"to",
"valid",
"answer",
"tokens",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/actions/InputAction.java#L108-L120 |
cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java | ForceFieldConfigurator.setAtom | private IAtom setAtom(IAtom atom, String ID) throws NoSuchAtomTypeException {
"""
Assigns an atom type to an atom
@param atom The atom to be aasigned
@param ID the atom type id
@exception NoSuchAtomTypeException atomType is not known
@return the assigned atom
"""
IAtomType at = null... | java | private IAtom setAtom(IAtom atom, String ID) throws NoSuchAtomTypeException {
IAtomType at = null;
String key = "";
List<?> data = null;
Double value = null;
at = getAtomType(ID);
if (atom.getSymbol() == null) {
atom.setSymbol(at.getSymbol());
}
... | [
"private",
"IAtom",
"setAtom",
"(",
"IAtom",
"atom",
",",
"String",
"ID",
")",
"throws",
"NoSuchAtomTypeException",
"{",
"IAtomType",
"at",
"=",
"null",
";",
"String",
"key",
"=",
"\"\"",
";",
"List",
"<",
"?",
">",
"data",
"=",
"null",
";",
"Double",
... | Assigns an atom type to an atom
@param atom The atom to be aasigned
@param ID the atom type id
@exception NoSuchAtomTypeException atomType is not known
@return the assigned atom | [
"Assigns",
"an",
"atom",
"type",
"to",
"an",
"atom"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java#L354-L386 |
m-m-m/util | date/src/main/java/net/sf/mmm/util/date/base/Iso8601UtilLimitedImpl.java | Iso8601UtilLimitedImpl.formatDate | public void formatDate(int year, int month, int day, boolean extended, Appendable buffer) {
"""
@see #formatDate(Date, boolean, Appendable)
@param year is the {@link java.util.Calendar#YEAR year}
@param month is the month (1-12).
@param day is the {@link java.util.Calendar#DAY_OF_MONTH day}.
@param extended ... | java | public void formatDate(int year, int month, int day, boolean extended, Appendable buffer) {
try {
// year
String yearString = String.valueOf(year);
buffer.append(yearString);
if (extended) {
buffer.append('-');
}
// month
String monthString = String.valueOf(month);... | [
"public",
"void",
"formatDate",
"(",
"int",
"year",
",",
"int",
"month",
",",
"int",
"day",
",",
"boolean",
"extended",
",",
"Appendable",
"buffer",
")",
"{",
"try",
"{",
"// year",
"String",
"yearString",
"=",
"String",
".",
"valueOf",
"(",
"year",
")",... | @see #formatDate(Date, boolean, Appendable)
@param year is the {@link java.util.Calendar#YEAR year}
@param month is the month (1-12).
@param day is the {@link java.util.Calendar#DAY_OF_MONTH day}.
@param extended if {@code false} the basic date format ("yyyyMMdd") is used, if {@code true} the extended
date format ("yy... | [
"@see",
"#formatDate",
"(",
"Date",
"boolean",
"Appendable",
")"
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/date/src/main/java/net/sf/mmm/util/date/base/Iso8601UtilLimitedImpl.java#L96-L123 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesInner.java | RegistriesInner.getBuildSourceUploadUrl | public SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName) {
"""
Get the upload location for the user to be able to upload the source.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of ... | java | public SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName) {
return getBuildSourceUploadUrlWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body();
} | [
"public",
"SourceUploadDefinitionInner",
"getBuildSourceUploadUrl",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
")",
"{",
"return",
"getBuildSourceUploadUrlWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
")",
".",
"toBlocking",
... | Get the upload location for the user to be able to upload the source.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException... | [
"Get",
"the",
"upload",
"location",
"for",
"the",
"user",
"to",
"be",
"able",
"to",
"upload",
"the",
"source",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesInner.java#L1894-L1896 |
jglobus/JGlobus | gss/src/main/java/org/globus/gsi/gssapi/auth/HostOrSelfAuthorization.java | HostOrSelfAuthorization.authorize | public void authorize(GSSContext context, String host)
throws AuthorizationException {
"""
Performs host authorization. If that fails, performs self authorization
"""
logger.debug("Authorization: HOST/SELF");
try {
GSSName expected = this.hostAuthz.getExpectedName(null, host);
GSS... | java | public void authorize(GSSContext context, String host)
throws AuthorizationException {
logger.debug("Authorization: HOST/SELF");
try {
GSSName expected = this.hostAuthz.getExpectedName(null, host);
GSSName target = null;
if (context.isInitiator()) {
target = con... | [
"public",
"void",
"authorize",
"(",
"GSSContext",
"context",
",",
"String",
"host",
")",
"throws",
"AuthorizationException",
"{",
"logger",
".",
"debug",
"(",
"\"Authorization: HOST/SELF\"",
")",
";",
"try",
"{",
"GSSName",
"expected",
"=",
"this",
".",
"hostAut... | Performs host authorization. If that fails, performs self authorization | [
"Performs",
"host",
"authorization",
".",
"If",
"that",
"fails",
"performs",
"self",
"authorization"
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gss/src/main/java/org/globus/gsi/gssapi/auth/HostOrSelfAuthorization.java#L61-L92 |
alkacon/opencms-core | src/org/opencms/jsp/decorator/CmsDecorationDefintion.java | CmsDecorationDefintion.createDecorationBundle | public CmsDecorationBundle createDecorationBundle(CmsObject cms, Locale locale) throws CmsException {
"""
Creates a CmsDecorationBundle of text decoration to be used by the decorator.<p>
@param cms the CmsObject
@param locale the locale to build the decoration bundle for. If no locale is given, a bundle of all... | java | public CmsDecorationBundle createDecorationBundle(CmsObject cms, Locale locale) throws CmsException {
// get configfile basename and the list of all decoration map files
List<CmsResource> decorationMapFiles = getDecorationMapFiles(cms);
if (LOG.isDebugEnabled()) {
LOG.debug(
... | [
"public",
"CmsDecorationBundle",
"createDecorationBundle",
"(",
"CmsObject",
"cms",
",",
"Locale",
"locale",
")",
"throws",
"CmsException",
"{",
"// get configfile basename and the list of all decoration map files",
"List",
"<",
"CmsResource",
">",
"decorationMapFiles",
"=",
... | Creates a CmsDecorationBundle of text decoration to be used by the decorator.<p>
@param cms the CmsObject
@param locale the locale to build the decoration bundle for. If no locale is given, a bundle of all locales is build
@return CmsDecorationBundle including all decoration lists that match the locale
@throws CmsExce... | [
"Creates",
"a",
"CmsDecorationBundle",
"of",
"text",
"decoration",
"to",
"be",
"used",
"by",
"the",
"decorator",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/decorator/CmsDecorationDefintion.java#L165-L189 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/ast/Stage.java | Stage.registerMetrics | public void registerMetrics(MetricRegistry metricRegistry, String pipelineId) {
"""
Register the metrics attached to this stage.
@param metricRegistry the registry to add the metrics to
"""
meterName = name(Pipeline.class, pipelineId, "stage", String.valueOf(stage()), "executed");
executed =... | java | public void registerMetrics(MetricRegistry metricRegistry, String pipelineId) {
meterName = name(Pipeline.class, pipelineId, "stage", String.valueOf(stage()), "executed");
executed = metricRegistry.meter(meterName);
} | [
"public",
"void",
"registerMetrics",
"(",
"MetricRegistry",
"metricRegistry",
",",
"String",
"pipelineId",
")",
"{",
"meterName",
"=",
"name",
"(",
"Pipeline",
".",
"class",
",",
"pipelineId",
",",
"\"stage\"",
",",
"String",
".",
"valueOf",
"(",
"stage",
"(",... | Register the metrics attached to this stage.
@param metricRegistry the registry to add the metrics to | [
"Register",
"the",
"metrics",
"attached",
"to",
"this",
"stage",
"."
] | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/ast/Stage.java#L65-L68 |
atteo/classindex | classindex/src/main/java/org/atteo/classindex/ClassIndex.java | ClassIndex.getPackageClassesNames | public static Iterable<String> getPackageClassesNames(String packageName) {
"""
Retrieves names of classes from given package.
<p/>
<p>
The package must be annotated with {@link IndexSubclasses} for the classes inside
to be indexed at compile-time by {@link org.atteo.classindex.processor.ClassIndexProcessor}.
... | java | public static Iterable<String> getPackageClassesNames(String packageName) {
return getPackageClassesNames(packageName, Thread.currentThread().getContextClassLoader());
} | [
"public",
"static",
"Iterable",
"<",
"String",
">",
"getPackageClassesNames",
"(",
"String",
"packageName",
")",
"{",
"return",
"getPackageClassesNames",
"(",
"packageName",
",",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
")"... | Retrieves names of classes from given package.
<p/>
<p>
The package must be annotated with {@link IndexSubclasses} for the classes inside
to be indexed at compile-time by {@link org.atteo.classindex.processor.ClassIndexProcessor}.
</p>
@param packageName name of the package to search classes for
@return names of class... | [
"Retrieves",
"names",
"of",
"classes",
"from",
"given",
"package",
".",
"<p",
"/",
">",
"<p",
">",
"The",
"package",
"must",
"be",
"annotated",
"with",
"{",
"@link",
"IndexSubclasses",
"}",
"for",
"the",
"classes",
"inside",
"to",
"be",
"indexed",
"at",
... | train | https://github.com/atteo/classindex/blob/ad76c6bd8b4e84c594d94e48f466a095ffe2306a/classindex/src/main/java/org/atteo/classindex/ClassIndex.java#L212-L214 |
tvesalainen/util | util/src/main/java/org/vesalainen/bean/BeanHelper.java | BeanHelper.doFor | public static final <T> void doFor(Object bean, String property, Consumer<T> consumer) {
"""
Executes consumer for property.
@param <T>
@param bean
@param property
@param consumer
"""
T t = (T) getValue(bean, property);
consumer.accept(t);
} | java | public static final <T> void doFor(Object bean, String property, Consumer<T> consumer)
{
T t = (T) getValue(bean, property);
consumer.accept(t);
} | [
"public",
"static",
"final",
"<",
"T",
">",
"void",
"doFor",
"(",
"Object",
"bean",
",",
"String",
"property",
",",
"Consumer",
"<",
"T",
">",
"consumer",
")",
"{",
"T",
"t",
"=",
"(",
"T",
")",
"getValue",
"(",
"bean",
",",
"property",
")",
";",
... | Executes consumer for property.
@param <T>
@param bean
@param property
@param consumer | [
"Executes",
"consumer",
"for",
"property",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/bean/BeanHelper.java#L92-L96 |
ManfredTremmel/gwt-bean-validators | gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/Assert.java | Assert.isAssignable | @GwtIncompatible("incompatible method")
public static void isAssignable(final Class<?> superType, final Class<?> subType) {
"""
Assert that {@code superType.isAssignableFrom(subType)} is {@code true}.
<pre class="code">
Assert.isAssignable(Number.class, myClass);
</pre>
@param superType the super type to... | java | @GwtIncompatible("incompatible method")
public static void isAssignable(final Class<?> superType, final Class<?> subType) {
Assert.isAssignable(superType, subType, "");
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"void",
"isAssignable",
"(",
"final",
"Class",
"<",
"?",
">",
"superType",
",",
"final",
"Class",
"<",
"?",
">",
"subType",
")",
"{",
"Assert",
".",
"isAssignable",
"(",
"superT... | Assert that {@code superType.isAssignableFrom(subType)} is {@code true}.
<pre class="code">
Assert.isAssignable(Number.class, myClass);
</pre>
@param superType the super type to check
@param subType the sub type to check
@throws IllegalArgumentException if the classes are not assignable | [
"Assert",
"that",
"{",
"@code",
"superType",
".",
"isAssignableFrom",
"(",
"subType",
")",
"}",
"is",
"{",
"@code",
"true",
"}",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/Assert.java#L716-L719 |
cycorp/api-suite | core-api/src/main/java/com/cyc/kb/exception/KbException.java | KbException.fromThrowable | public static KbException fromThrowable(String message, Throwable cause) {
"""
Converts a Throwable to a KbException with the specified detail message. If the
Throwable is a KbException and if the Throwable's message is identical to the
one supplied, the Throwable will be passed through unmodified; otherwise, it... | java | public static KbException fromThrowable(String message, Throwable cause) {
return (cause instanceof KbException && Objects.equals(message, cause.getMessage()))
? (KbException) cause
: new KbException(message, cause);
} | [
"public",
"static",
"KbException",
"fromThrowable",
"(",
"String",
"message",
",",
"Throwable",
"cause",
")",
"{",
"return",
"(",
"cause",
"instanceof",
"KbException",
"&&",
"Objects",
".",
"equals",
"(",
"message",
",",
"cause",
".",
"getMessage",
"(",
")",
... | Converts a Throwable to a KbException with the specified detail message. If the
Throwable is a KbException and if the Throwable's message is identical to the
one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in
a new KbException with the detail message.
@param cause the... | [
"Converts",
"a",
"Throwable",
"to",
"a",
"KbException",
"with",
"the",
"specified",
"detail",
"message",
".",
"If",
"the",
"Throwable",
"is",
"a",
"KbException",
"and",
"if",
"the",
"Throwable",
"s",
"message",
"is",
"identical",
"to",
"the",
"one",
"supplie... | train | https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/kb/exception/KbException.java#L62-L66 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/PeerGroup.java | PeerGroup.waitForPeersOfVersion | public ListenableFuture<List<Peer>> waitForPeersOfVersion(final int numPeers, final long protocolVersion) {
"""
Returns a future that is triggered when there are at least the requested number of connected peers that support
the given protocol version or higher. To block immediately, just call get() on the result.... | java | public ListenableFuture<List<Peer>> waitForPeersOfVersion(final int numPeers, final long protocolVersion) {
List<Peer> foundPeers = findPeersOfAtLeastVersion(protocolVersion);
if (foundPeers.size() >= numPeers) {
return Futures.immediateFuture(foundPeers);
}
final SettableFut... | [
"public",
"ListenableFuture",
"<",
"List",
"<",
"Peer",
">",
">",
"waitForPeersOfVersion",
"(",
"final",
"int",
"numPeers",
",",
"final",
"long",
"protocolVersion",
")",
"{",
"List",
"<",
"Peer",
">",
"foundPeers",
"=",
"findPeersOfAtLeastVersion",
"(",
"protoco... | Returns a future that is triggered when there are at least the requested number of connected peers that support
the given protocol version or higher. To block immediately, just call get() on the result.
@param numPeers How many peers to wait for.
@param protocolVersion The protocol version the awaited peers must imple... | [
"Returns",
"a",
"future",
"that",
"is",
"triggered",
"when",
"there",
"are",
"at",
"least",
"the",
"requested",
"number",
"of",
"connected",
"peers",
"that",
"support",
"the",
"given",
"protocol",
"version",
"or",
"higher",
".",
"To",
"block",
"immediately",
... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/PeerGroup.java#L1898-L1915 |
json-path/JsonPath | json-path/src/main/java/com/jayway/jsonpath/internal/Utils.java | Utils.join | public static String join(String delimiter, String wrap, Iterable<?> objs) {
"""
accept a collection of objects, since all objects have toString()
"""
Iterator<?> iter = objs.iterator();
if (!iter.hasNext()) {
return "";
}
StringBuilder buffer = new StringBuilder();
... | java | public static String join(String delimiter, String wrap, Iterable<?> objs) {
Iterator<?> iter = objs.iterator();
if (!iter.hasNext()) {
return "";
}
StringBuilder buffer = new StringBuilder();
buffer.append(wrap).append(iter.next()).append(wrap);
while (iter.h... | [
"public",
"static",
"String",
"join",
"(",
"String",
"delimiter",
",",
"String",
"wrap",
",",
"Iterable",
"<",
"?",
">",
"objs",
")",
"{",
"Iterator",
"<",
"?",
">",
"iter",
"=",
"objs",
".",
"iterator",
"(",
")",
";",
"if",
"(",
"!",
"iter",
".",
... | accept a collection of objects, since all objects have toString() | [
"accept",
"a",
"collection",
"of",
"objects",
"since",
"all",
"objects",
"have",
"toString",
"()"
] | train | https://github.com/json-path/JsonPath/blob/5a09489c3252b74bbf81992aadb3073be59c04f9/json-path/src/main/java/com/jayway/jsonpath/internal/Utils.java#L27-L38 |
geomajas/geomajas-project-client-gwt2 | impl/src/main/java/org/geomajas/gwt2/client/service/JsonService.java | JsonService.isNullObject | public static boolean isNullObject(JSONObject jsonObject, String key) throws JSONException {
"""
checks if a certain object value is null.
@param jsonObject The object to get the key value from.
@param key The name of the key to search the value for.
@throws JSONException In case something went wrong while pa... | java | public static boolean isNullObject(JSONObject jsonObject, String key) throws JSONException {
checkArguments(jsonObject, key);
JSONValue value = jsonObject.get(key);
boolean isNull = false;
if (value == null || value.isNull() != null) {
isNull = true;
}
return isNull;
} | [
"public",
"static",
"boolean",
"isNullObject",
"(",
"JSONObject",
"jsonObject",
",",
"String",
"key",
")",
"throws",
"JSONException",
"{",
"checkArguments",
"(",
"jsonObject",
",",
"key",
")",
";",
"JSONValue",
"value",
"=",
"jsonObject",
".",
"get",
"(",
"key... | checks if a certain object value is null.
@param jsonObject The object to get the key value from.
@param key The name of the key to search the value for.
@throws JSONException In case something went wrong while parsing. | [
"checks",
"if",
"a",
"certain",
"object",
"value",
"is",
"null",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/service/JsonService.java#L358-L367 |
lessthanoptimal/BoofCV | integration/boofcv-android/examples/video/app/src/main/java/org/boofcv/video/GradientActivity.java | GradientActivity.onCameraResolutionChange | @Override
protected void onCameraResolutionChange( int width , int height, int sensorOrientation ) {
"""
During camera initialization this function is called once after the resolution is known.
This is a good function to override and predeclare data structres which are dependent
on the video feeds resolution.
... | java | @Override
protected void onCameraResolutionChange( int width , int height, int sensorOrientation ) {
super.onCameraResolutionChange(width, height,sensorOrientation);
derivX.reshape(width, height);
derivY.reshape(width, height);
} | [
"@",
"Override",
"protected",
"void",
"onCameraResolutionChange",
"(",
"int",
"width",
",",
"int",
"height",
",",
"int",
"sensorOrientation",
")",
"{",
"super",
".",
"onCameraResolutionChange",
"(",
"width",
",",
"height",
",",
"sensorOrientation",
")",
";",
"de... | During camera initialization this function is called once after the resolution is known.
This is a good function to override and predeclare data structres which are dependent
on the video feeds resolution. | [
"During",
"camera",
"initialization",
"this",
"function",
"is",
"called",
"once",
"after",
"the",
"resolution",
"is",
"known",
".",
"This",
"is",
"a",
"good",
"function",
"to",
"override",
"and",
"predeclare",
"data",
"structres",
"which",
"are",
"dependent",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/examples/video/app/src/main/java/org/boofcv/video/GradientActivity.java#L121-L127 |
hdbeukel/james-core | src/main/java/org/jamesframework/core/search/LocalSearch.java | LocalSearch.updateCurrentSolution | protected void updateCurrentSolution(SolutionType solution, Evaluation evaluation, Validation validation) {
"""
Update the current solution during search, given that it has already been evaluated and validated.
The new current solution and its evaluation/validation are stored and attached local search listeners
... | java | protected void updateCurrentSolution(SolutionType solution, Evaluation evaluation, Validation validation){
// store new current solution
curSolution = solution;
// store evaluation and validation
curSolutionEvaluation = evaluation;
curSolutionValidation = validation;
// i... | [
"protected",
"void",
"updateCurrentSolution",
"(",
"SolutionType",
"solution",
",",
"Evaluation",
"evaluation",
",",
"Validation",
"validation",
")",
"{",
"// store new current solution",
"curSolution",
"=",
"solution",
";",
"// store evaluation and validation",
"curSolutionE... | Update the current solution during search, given that it has already been evaluated and validated.
The new current solution and its evaluation/validation are stored and attached local search listeners
are informed about this update. The update always takes place, it is <b>not</b> required that the
current solution is v... | [
"Update",
"the",
"current",
"solution",
"during",
"search",
"given",
"that",
"it",
"has",
"already",
"been",
"evaluated",
"and",
"validated",
".",
"The",
"new",
"current",
"solution",
"and",
"its",
"evaluation",
"/",
"validation",
"are",
"stored",
"and",
"atta... | train | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/LocalSearch.java#L245-L253 |
Wikidata/Wikidata-Toolkit | wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/values/BufferedValueConverter.java | BufferedValueConverter.addValue | void addValue(V value, Resource resource) {
"""
Adds the given value to the list of values that should still be
serialized. The given RDF resource will be used as a subject.
@param value
the value to be serialized
@param resource
the RDF resource that is used as a subject for serialization
"""
this.va... | java | void addValue(V value, Resource resource) {
this.valueQueue.add(value);
this.valueSubjectQueue.add(resource);
} | [
"void",
"addValue",
"(",
"V",
"value",
",",
"Resource",
"resource",
")",
"{",
"this",
".",
"valueQueue",
".",
"add",
"(",
"value",
")",
";",
"this",
".",
"valueSubjectQueue",
".",
"add",
"(",
"resource",
")",
";",
"}"
] | Adds the given value to the list of values that should still be
serialized. The given RDF resource will be used as a subject.
@param value
the value to be serialized
@param resource
the RDF resource that is used as a subject for serialization | [
"Adds",
"the",
"given",
"value",
"to",
"the",
"list",
"of",
"values",
"that",
"should",
"still",
"be",
"serialized",
".",
"The",
"given",
"RDF",
"resource",
"will",
"be",
"used",
"as",
"a",
"subject",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/values/BufferedValueConverter.java#L56-L59 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java | HealthCheckClient.insertHealthCheck | @BetaApi
public final Operation insertHealthCheck(String project, HealthCheck healthCheckResource) {
"""
Creates a HealthCheck resource in the specified project using the data included in the request.
<p>Sample code:
<pre><code>
try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
Pro... | java | @BetaApi
public final Operation insertHealthCheck(String project, HealthCheck healthCheckResource) {
InsertHealthCheckHttpRequest request =
InsertHealthCheckHttpRequest.newBuilder()
.setProject(project)
.setHealthCheckResource(healthCheckResource)
.build();
return ... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertHealthCheck",
"(",
"String",
"project",
",",
"HealthCheck",
"healthCheckResource",
")",
"{",
"InsertHealthCheckHttpRequest",
"request",
"=",
"InsertHealthCheckHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setProj... | Creates a HealthCheck resource in the specified project using the data included in the request.
<p>Sample code:
<pre><code>
try (HealthCheckClient healthCheckClient = HealthCheckClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
HealthCheck healthCheckResource = HealthCheck.newBuilder().build();
Op... | [
"Creates",
"a",
"HealthCheck",
"resource",
"in",
"the",
"specified",
"project",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HealthCheckClient.java#L404-L413 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/WebhooksInner.java | WebhooksInner.generateUri | public String generateUri(String resourceGroupName, String automationAccountName) {
"""
Generates a Uri for use in creating a webhook.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentException thrown if parameter... | java | public String generateUri(String resourceGroupName, String automationAccountName) {
return generateUriWithServiceResponseAsync(resourceGroupName, automationAccountName).toBlocking().single().body();
} | [
"public",
"String",
"generateUri",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
")",
"{",
"return",
"generateUriWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
")",
".",
"toBlocking",
"(",
")",
".",
"sing... | Generates a Uri for use in creating a webhook.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
... | [
"Generates",
"a",
"Uri",
"for",
"use",
"in",
"creating",
"a",
"webhook",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/WebhooksInner.java#L108-L110 |
Teddy-Zhu/SilentGo | framework/src/main/java/com/silentgo/servlet/oreilly/multipart/LimitedServletInputStream.java | LimitedServletInputStream.readLine | public int readLine(byte b[], int off, int len) throws IOException {
"""
Implement length limitation on top of the <code>readLine</code> method of
the wrapped <code>ServletInputStream</code>.
@param b an array of bytes into which data is read.
@param off an integer specifying the character at which
this ... | java | public int readLine(byte b[], int off, int len) throws IOException {
int result, left = totalExpected - totalRead;
if (left <= 0) {
return -1;
} else {
result = ((ServletInputStream)in).readLine(b, off, Math.min(left, len));
}
if (result > 0) {
totalRead += result;
}
return... | [
"public",
"int",
"readLine",
"(",
"byte",
"b",
"[",
"]",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"int",
"result",
",",
"left",
"=",
"totalExpected",
"-",
"totalRead",
";",
"if",
"(",
"left",
"<=",
"0",
")",
"{",
"re... | Implement length limitation on top of the <code>readLine</code> method of
the wrapped <code>ServletInputStream</code>.
@param b an array of bytes into which data is read.
@param off an integer specifying the character at which
this method begins reading.
@param len an integer specifying the maximum number of
byte... | [
"Implement",
"length",
"limitation",
"on",
"top",
"of",
"the",
"<code",
">",
"readLine<",
"/",
"code",
">",
"method",
"of",
"the",
"wrapped",
"<code",
">",
"ServletInputStream<",
"/",
"code",
">",
"."
] | train | https://github.com/Teddy-Zhu/SilentGo/blob/27f58b0cafe56b2eb9fc6993efa9ca2b529661e1/framework/src/main/java/com/silentgo/servlet/oreilly/multipart/LimitedServletInputStream.java#L56-L67 |
gallandarakhneorg/afc | core/util/src/main/java/org/arakhne/afc/progress/DefaultProgression.java | DefaultProgression.setValue | void setValue(SubProgressionModel subTask, double newValue, String comment) {
"""
Set the value with a float-point precision.
This method is invoked from a subtask.
@param subTask the subtask.
@param newValue the new value.
@param comment the new comment.
"""
setProperties(newValue, this.min, this.max,... | java | void setValue(SubProgressionModel subTask, double newValue, String comment) {
setProperties(newValue, this.min, this.max, this.isAdjusting,
comment == null ? this.comment : comment, true, true, false,
subTask);
} | [
"void",
"setValue",
"(",
"SubProgressionModel",
"subTask",
",",
"double",
"newValue",
",",
"String",
"comment",
")",
"{",
"setProperties",
"(",
"newValue",
",",
"this",
".",
"min",
",",
"this",
".",
"max",
",",
"this",
".",
"isAdjusting",
",",
"comment",
"... | Set the value with a float-point precision.
This method is invoked from a subtask.
@param subTask the subtask.
@param newValue the new value.
@param comment the new comment. | [
"Set",
"the",
"value",
"with",
"a",
"float",
"-",
"point",
"precision",
".",
"This",
"method",
"is",
"invoked",
"from",
"a",
"subtask",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/util/src/main/java/org/arakhne/afc/progress/DefaultProgression.java#L342-L346 |
undertow-io/undertow | core/src/main/java/io/undertow/server/handlers/resource/DirectoryUtils.java | DirectoryUtils.sendRequestedBlobs | public static boolean sendRequestedBlobs(HttpServerExchange exchange) {
"""
Serve static resource for the directory listing
@param exchange The exchange
@return true if resources were served
"""
ByteBuffer buffer = null;
String type = null;
String etag = null;
String quotedE... | java | public static boolean sendRequestedBlobs(HttpServerExchange exchange) {
ByteBuffer buffer = null;
String type = null;
String etag = null;
String quotedEtag = null;
if ("css".equals(exchange.getQueryString())) {
buffer = Blobs.FILE_CSS_BUFFER.duplicate();
t... | [
"public",
"static",
"boolean",
"sendRequestedBlobs",
"(",
"HttpServerExchange",
"exchange",
")",
"{",
"ByteBuffer",
"buffer",
"=",
"null",
";",
"String",
"type",
"=",
"null",
";",
"String",
"etag",
"=",
"null",
";",
"String",
"quotedEtag",
"=",
"null",
";",
... | Serve static resource for the directory listing
@param exchange The exchange
@return true if resources were served | [
"Serve",
"static",
"resource",
"for",
"the",
"directory",
"listing"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/resource/DirectoryUtils.java#L54-L91 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasUser.java | BaasUser.logoutSync | public BaasResult<Void> logoutSync(String registration) {
"""
Synchronously logouts current user from the server.
@param registration a registration id to remove
@return the result of the request
"""
BaasBox box = BaasBox.getDefaultChecked();
LogoutRequest request = new LogoutRequest(box, t... | java | public BaasResult<Void> logoutSync(String registration) {
BaasBox box = BaasBox.getDefaultChecked();
LogoutRequest request = new LogoutRequest(box, this, registration, RequestOptions.DEFAULT, null);
return box.submitSync(request);
} | [
"public",
"BaasResult",
"<",
"Void",
">",
"logoutSync",
"(",
"String",
"registration",
")",
"{",
"BaasBox",
"box",
"=",
"BaasBox",
".",
"getDefaultChecked",
"(",
")",
";",
"LogoutRequest",
"request",
"=",
"new",
"LogoutRequest",
"(",
"box",
",",
"this",
",",... | Synchronously logouts current user from the server.
@param registration a registration id to remove
@return the result of the request | [
"Synchronously",
"logouts",
"current",
"user",
"from",
"the",
"server",
"."
] | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasUser.java#L881-L885 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/NetworkUtils.java | NetworkUtils.setLearningRate | public static void setLearningRate(MultiLayerNetwork net, ISchedule newLrSchedule) {
"""
Set the learning rate schedule for all layers in the network to the specified schedule.
This schedule will replace any/all existing schedules, and also any fixed learning rate values.<br>
Note that the iteration/epoch counts... | java | public static void setLearningRate(MultiLayerNetwork net, ISchedule newLrSchedule) {
setLearningRate(net, Double.NaN, newLrSchedule);
} | [
"public",
"static",
"void",
"setLearningRate",
"(",
"MultiLayerNetwork",
"net",
",",
"ISchedule",
"newLrSchedule",
")",
"{",
"setLearningRate",
"(",
"net",
",",
"Double",
".",
"NaN",
",",
"newLrSchedule",
")",
";",
"}"
] | Set the learning rate schedule for all layers in the network to the specified schedule.
This schedule will replace any/all existing schedules, and also any fixed learning rate values.<br>
Note that the iteration/epoch counts will <i>not</i> be reset. Use {@link MultiLayerConfiguration#setIterationCount(int)}
and {@link... | [
"Set",
"the",
"learning",
"rate",
"schedule",
"for",
"all",
"layers",
"in",
"the",
"network",
"to",
"the",
"specified",
"schedule",
".",
"This",
"schedule",
"will",
"replace",
"any",
"/",
"all",
"existing",
"schedules",
"and",
"also",
"any",
"fixed",
"learni... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/NetworkUtils.java#L161-L163 |
hageldave/ImagingKit | ImagingKit_Core/src/main/java/hageldave/imagingkit/core/io/ImageLoader.java | ImageLoader.loadImage | public static BufferedImage loadImage(File file, int imageType) {
"""
Tries to load Image from file and converts it to the
desired image type if needed. <br>
See {@link BufferedImage#BufferedImage(int, int, int)} for details on
the available image types.
@param file the image file
@param imageType of the re... | java | public static BufferedImage loadImage(File file, int imageType){
BufferedImage img = loadImage(file);
if(img.getType() != imageType){
img = BufferedImageFactory.get(img, imageType);
}
return img;
} | [
"public",
"static",
"BufferedImage",
"loadImage",
"(",
"File",
"file",
",",
"int",
"imageType",
")",
"{",
"BufferedImage",
"img",
"=",
"loadImage",
"(",
"file",
")",
";",
"if",
"(",
"img",
".",
"getType",
"(",
")",
"!=",
"imageType",
")",
"{",
"img",
"... | Tries to load Image from file and converts it to the
desired image type if needed. <br>
See {@link BufferedImage#BufferedImage(int, int, int)} for details on
the available image types.
@param file the image file
@param imageType of the resulting BufferedImage
@return loaded Image.
@throws ImageLoaderException if no im... | [
"Tries",
"to",
"load",
"Image",
"from",
"file",
"and",
"converts",
"it",
"to",
"the",
"desired",
"image",
"type",
"if",
"needed",
".",
"<br",
">",
"See",
"{",
"@link",
"BufferedImage#BufferedImage",
"(",
"int",
"int",
"int",
")",
"}",
"for",
"details",
"... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Core/src/main/java/hageldave/imagingkit/core/io/ImageLoader.java#L123-L129 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/AsyncAtlasInfo.java | AsyncAtlasInfo.loadAtlasInformation | public static List<GVRAtlasInformation> loadAtlasInformation(InputStream ins) {
"""
This method is a sync parse to the JSON stream of atlas information.
@return List of atlas information.
"""
try {
int size = ins.available();
byte[] buffer = new byte[size];
ins.r... | java | public static List<GVRAtlasInformation> loadAtlasInformation(InputStream ins) {
try {
int size = ins.available();
byte[] buffer = new byte[size];
ins.read(buffer);
return loadAtlasInformation(new JSONArray(new String(buffer, "UTF-8")));
} catch (JSONExce... | [
"public",
"static",
"List",
"<",
"GVRAtlasInformation",
">",
"loadAtlasInformation",
"(",
"InputStream",
"ins",
")",
"{",
"try",
"{",
"int",
"size",
"=",
"ins",
".",
"available",
"(",
")",
";",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"size",... | This method is a sync parse to the JSON stream of atlas information.
@return List of atlas information. | [
"This",
"method",
"is",
"a",
"sync",
"parse",
"to",
"the",
"JSON",
"stream",
"of",
"atlas",
"information",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/AsyncAtlasInfo.java#L41-L56 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/json/JsonObject.java | JsonObject.getInt | public int getInt(String name, int defaultValue) {
"""
Returns the <code>int</code> value of the member with the specified name in this object. If
this object does not contain a member with this name, the given default value is returned. If
this object contains multiple members with the given name, the last one ... | java | public int getInt(String name, int defaultValue) {
JsonValue value = get(name);
return value != null ? value.asInt() : defaultValue;
} | [
"public",
"int",
"getInt",
"(",
"String",
"name",
",",
"int",
"defaultValue",
")",
"{",
"JsonValue",
"value",
"=",
"get",
"(",
"name",
")",
";",
"return",
"value",
"!=",
"null",
"?",
"value",
".",
"asInt",
"(",
")",
":",
"defaultValue",
";",
"}"
] | Returns the <code>int</code> value of the member with the specified name in this object. If
this object does not contain a member with this name, the given default value is returned. If
this object contains multiple members with the given name, the last one will be picked. If this
member's value does not represent a JS... | [
"Returns",
"the",
"<code",
">",
"int<",
"/",
"code",
">",
"value",
"of",
"the",
"member",
"with",
"the",
"specified",
"name",
"in",
"this",
"object",
".",
"If",
"this",
"object",
"does",
"not",
"contain",
"a",
"member",
"with",
"this",
"name",
"the",
"... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/json/JsonObject.java#L581-L584 |
DDTH/ddth-queue | ddth-queue-core/src/main/java/com/github/ddth/queue/impl/universal/UniversalIdIntQueueMessage.java | UniversalIdIntQueueMessage.newInstance | public static UniversalIdIntQueueMessage newInstance(Long id, byte[] content) {
"""
Create a new {@link UniversalIdIntQueueMessage} object with specified id
and content.
@param id
@param content
@return
@since 0.7.0
"""
UniversalIdIntQueueMessage msg = newInstance(content);
msg.setId(id)... | java | public static UniversalIdIntQueueMessage newInstance(Long id, byte[] content) {
UniversalIdIntQueueMessage msg = newInstance(content);
msg.setId(id);
return msg;
} | [
"public",
"static",
"UniversalIdIntQueueMessage",
"newInstance",
"(",
"Long",
"id",
",",
"byte",
"[",
"]",
"content",
")",
"{",
"UniversalIdIntQueueMessage",
"msg",
"=",
"newInstance",
"(",
"content",
")",
";",
"msg",
".",
"setId",
"(",
"id",
")",
";",
"retu... | Create a new {@link UniversalIdIntQueueMessage} object with specified id
and content.
@param id
@param content
@return
@since 0.7.0 | [
"Create",
"a",
"new",
"{",
"@link",
"UniversalIdIntQueueMessage",
"}",
"object",
"with",
"specified",
"id",
"and",
"content",
"."
] | train | https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/impl/universal/UniversalIdIntQueueMessage.java#L83-L87 |
rholder/guava-retrying | src/main/java/com/github/rholder/retry/WaitStrategies.java | WaitStrategies.fibonacciWait | public static WaitStrategy fibonacciWait(long maximumTime,
@Nonnull TimeUnit maximumTimeUnit) {
"""
Returns a strategy which sleeps for an increasing amount of time after the first failed attempt,
and in Fibonacci increments after each failed attempt up to the {@code m... | java | public static WaitStrategy fibonacciWait(long maximumTime,
@Nonnull TimeUnit maximumTimeUnit) {
Preconditions.checkNotNull(maximumTimeUnit, "The maximum time unit may not be null");
return new FibonacciWaitStrategy(1, maximumTimeUnit.toMillis(maximumTime));
... | [
"public",
"static",
"WaitStrategy",
"fibonacciWait",
"(",
"long",
"maximumTime",
",",
"@",
"Nonnull",
"TimeUnit",
"maximumTimeUnit",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"maximumTimeUnit",
",",
"\"The maximum time unit may not be null\"",
")",
";",
"retu... | Returns a strategy which sleeps for an increasing amount of time after the first failed attempt,
and in Fibonacci increments after each failed attempt up to the {@code maximumTime}.
@param maximumTime the maximum time to sleep
@param maximumTimeUnit the unit of the maximum time
@return a wait strategy that increme... | [
"Returns",
"a",
"strategy",
"which",
"sleeps",
"for",
"an",
"increasing",
"amount",
"of",
"time",
"after",
"the",
"first",
"failed",
"attempt",
"and",
"in",
"Fibonacci",
"increments",
"after",
"each",
"failed",
"attempt",
"up",
"to",
"the",
"{",
"@code",
"ma... | train | https://github.com/rholder/guava-retrying/blob/177b6c9b9f3e7957f404f0bdb8e23374cb1de43f/src/main/java/com/github/rholder/retry/WaitStrategies.java#L178-L182 |
wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/host/controller/ManagedServerBootCmdFactory.java | ManagedServerBootCmdFactory.resolveExpressions | static ModelNode resolveExpressions(final ModelNode unresolved, final ExpressionResolver expressionResolver, boolean excludePostBootSystemProps) {
"""
Resolve expressions in the given model (if there are any)
@param unresolved node with possibly unresolved expressions. Cannot be {@code null}
@param expressionR... | java | static ModelNode resolveExpressions(final ModelNode unresolved, final ExpressionResolver expressionResolver, boolean excludePostBootSystemProps) {
ModelNode toResolve = unresolved.clone();
ModelNode sysProps = null;
if (excludePostBootSystemProps && toResolve.hasDefined(SYSTEM_PROPERTY)) {
... | [
"static",
"ModelNode",
"resolveExpressions",
"(",
"final",
"ModelNode",
"unresolved",
",",
"final",
"ExpressionResolver",
"expressionResolver",
",",
"boolean",
"excludePostBootSystemProps",
")",
"{",
"ModelNode",
"toResolve",
"=",
"unresolved",
".",
"clone",
"(",
")",
... | Resolve expressions in the given model (if there are any)
@param unresolved node with possibly unresolved expressions. Cannot be {@code null}
@param expressionResolver resolver to use. Cannot be {@code null}
@param excludePostBootSystemProps {@code true} if child system-property nodes should be checked
for the 'boot-t... | [
"Resolve",
"expressions",
"in",
"the",
"given",
"model",
"(",
"if",
"there",
"are",
"any",
")"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/ManagedServerBootCmdFactory.java#L197-L225 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.