repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/incubator-shardingsphere | sharding-core/sharding-core-route/src/main/java/org/apache/shardingsphere/core/route/router/sharding/ShardingRouterFactory.java | ShardingRouterFactory.newInstance | public static ShardingRouter newInstance(final ShardingRule shardingRule, final ShardingMetaData shardingMetaData, final DatabaseType databaseType, final ParsingResultCache parsingResultCache) {
"""
Create new instance of sharding router.
@param shardingRule sharding rule
@param shardingMetaData sharding meta ... | java | public static ShardingRouter newInstance(final ShardingRule shardingRule, final ShardingMetaData shardingMetaData, final DatabaseType databaseType, final ParsingResultCache parsingResultCache) {
return HintManager.isDatabaseShardingOnly()
? new DatabaseHintSQLRouter(shardingRule) : new ParsingSQ... | [
"public",
"static",
"ShardingRouter",
"newInstance",
"(",
"final",
"ShardingRule",
"shardingRule",
",",
"final",
"ShardingMetaData",
"shardingMetaData",
",",
"final",
"DatabaseType",
"databaseType",
",",
"final",
"ParsingResultCache",
"parsingResultCache",
")",
"{",
"retu... | Create new instance of sharding router.
@param shardingRule sharding rule
@param shardingMetaData sharding meta data
@param databaseType database type
@param parsingResultCache parsing result cache
@return sharding router instance | [
"Create",
"new",
"instance",
"of",
"sharding",
"router",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-route/src/main/java/org/apache/shardingsphere/core/route/router/sharding/ShardingRouterFactory.java#L46-L49 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildFieldHeader | public void buildFieldHeader(XMLNode node, Content classContentTree) {
"""
Build the field header.
@param node the XML element that specifies which components to document
@param classContentTree content tree to which the documentation will be added
"""
if (currentClass.serializableFields().length >... | java | public void buildFieldHeader(XMLNode node, Content classContentTree) {
if (currentClass.serializableFields().length > 0) {
buildFieldSerializationOverview(currentClass, classContentTree);
}
} | [
"public",
"void",
"buildFieldHeader",
"(",
"XMLNode",
"node",
",",
"Content",
"classContentTree",
")",
"{",
"if",
"(",
"currentClass",
".",
"serializableFields",
"(",
")",
".",
"length",
">",
"0",
")",
"{",
"buildFieldSerializationOverview",
"(",
"currentClass",
... | Build the field header.
@param node the XML element that specifies which components to document
@param classContentTree content tree to which the documentation will be added | [
"Build",
"the",
"field",
"header",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java#L370-L374 |
biojava/biojava | biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastService.java | NCBIQBlastService.sendAlignmentRequest | public String sendAlignmentRequest(int gid, RemotePairwiseAlignmentProperties rpa) throws Exception {
"""
Converts given GenBank GID to String and calls
{@link #sendAlignmentRequest(String, RemotePairwiseAlignmentProperties)}
"""
return sendAlignmentRequest(Integer.toString(gid), rpa);
} | java | public String sendAlignmentRequest(int gid, RemotePairwiseAlignmentProperties rpa) throws Exception {
return sendAlignmentRequest(Integer.toString(gid), rpa);
} | [
"public",
"String",
"sendAlignmentRequest",
"(",
"int",
"gid",
",",
"RemotePairwiseAlignmentProperties",
"rpa",
")",
"throws",
"Exception",
"{",
"return",
"sendAlignmentRequest",
"(",
"Integer",
".",
"toString",
"(",
"gid",
")",
",",
"rpa",
")",
";",
"}"
] | Converts given GenBank GID to String and calls
{@link #sendAlignmentRequest(String, RemotePairwiseAlignmentProperties)} | [
"Converts",
"given",
"GenBank",
"GID",
"to",
"String",
"and",
"calls",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastService.java#L151-L153 |
Impetus/Kundera | src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/GraphEntityMapper.java | GraphEntityMapper.fromNeo4JObject | public Object fromNeo4JObject(Object source, Field field) {
"""
Converts a property stored in Neo4J (nodes or relationship) to
corresponding entity field value
"""
Class<?> targetClass = field.getType();
if (targetClass.isAssignableFrom(BigDecimal.class) || targetClass.isAssignableFrom(BigInt... | java | public Object fromNeo4JObject(Object source, Field field)
{
Class<?> targetClass = field.getType();
if (targetClass.isAssignableFrom(BigDecimal.class) || targetClass.isAssignableFrom(BigInteger.class))
{
return PropertyAccessorHelper.fromSourceToTargetClass(field.getType(), sour... | [
"public",
"Object",
"fromNeo4JObject",
"(",
"Object",
"source",
",",
"Field",
"field",
")",
"{",
"Class",
"<",
"?",
">",
"targetClass",
"=",
"field",
".",
"getType",
"(",
")",
";",
"if",
"(",
"targetClass",
".",
"isAssignableFrom",
"(",
"BigDecimal",
".",
... | Converts a property stored in Neo4J (nodes or relationship) to
corresponding entity field value | [
"Converts",
"a",
"property",
"stored",
"in",
"Neo4J",
"(",
"nodes",
"or",
"relationship",
")",
"to",
"corresponding",
"entity",
"field",
"value"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/GraphEntityMapper.java#L629-L653 |
stephanenicolas/toothpick | toothpick-compiler/src/main/java/toothpick/compiler/common/ToothpickProcessor.java | ToothpickProcessor.isOverride | protected boolean isOverride(TypeElement typeElement, ExecutableElement methodElement) {
"""
the {@code methodElement} would be an override of this method.
"""
TypeElement currentTypeElement = typeElement;
do {
if (currentTypeElement != typeElement) {
List<? extends Element> enclosedEleme... | java | protected boolean isOverride(TypeElement typeElement, ExecutableElement methodElement) {
TypeElement currentTypeElement = typeElement;
do {
if (currentTypeElement != typeElement) {
List<? extends Element> enclosedElements = currentTypeElement.getEnclosedElements();
for (Element enclosedEle... | [
"protected",
"boolean",
"isOverride",
"(",
"TypeElement",
"typeElement",
",",
"ExecutableElement",
"methodElement",
")",
"{",
"TypeElement",
"currentTypeElement",
"=",
"typeElement",
";",
"do",
"{",
"if",
"(",
"currentTypeElement",
"!=",
"typeElement",
")",
"{",
"Li... | the {@code methodElement} would be an override of this method. | [
"the",
"{"
] | train | https://github.com/stephanenicolas/toothpick/blob/54476ca9a5fa48809c15a46e43e38db9ed7e1a75/toothpick-compiler/src/main/java/toothpick/compiler/common/ToothpickProcessor.java#L378-L400 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/StringUtils.java | StringUtils.restoreSet | public static Set<String> restoreSet(final String s, final String delim) {
"""
Break down a string separated by <code>delim</code> into a string set.
@param s String to be splitted
@param delim Delimiter to be used.
@return string set
"""
final Set<String> copytoSet = new HashSet<>();
if (S... | java | public static Set<String> restoreSet(final String s, final String delim) {
final Set<String> copytoSet = new HashSet<>();
if (StringUtils.isEmptyString(s)) {
return copytoSet;
}
final StringTokenizer st = new StringTokenizer(s, delim);
while (st.hasMoreTokens()) {
... | [
"public",
"static",
"Set",
"<",
"String",
">",
"restoreSet",
"(",
"final",
"String",
"s",
",",
"final",
"String",
"delim",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"copytoSet",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"if",
"(",
"StringUtils",
... | Break down a string separated by <code>delim</code> into a string set.
@param s String to be splitted
@param delim Delimiter to be used.
@return string set | [
"Break",
"down",
"a",
"string",
"separated",
"by",
"<code",
">",
"delim<",
"/",
"code",
">",
"into",
"a",
"string",
"set",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/StringUtils.java#L144-L160 |
instacount/appengine-counter | src/main/java/io/instacount/appengine/counter/data/CounterShardData.java | CounterShardData.constructCounterShardIdentifier | @VisibleForTesting
static String constructCounterShardIdentifier(final String counterName, final int shardNumber) {
"""
Helper method to set the internal identifier for this entity.
@param counterName
@param shardNumber A unique identifier to distinguish shards for the same {@code counterName} from each other... | java | @VisibleForTesting
static String constructCounterShardIdentifier(final String counterName, final int shardNumber)
{
Preconditions.checkNotNull(counterName);
Preconditions.checkArgument(!StringUtils.isBlank(counterName),
"CounterData Names may not be null, blank, or empty!");
Preconditions.checkArgument(shard... | [
"@",
"VisibleForTesting",
"static",
"String",
"constructCounterShardIdentifier",
"(",
"final",
"String",
"counterName",
",",
"final",
"int",
"shardNumber",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"counterName",
")",
";",
"Preconditions",
".",
"checkArgume... | Helper method to set the internal identifier for this entity.
@param counterName
@param shardNumber A unique identifier to distinguish shards for the same {@code counterName} from each other. | [
"Helper",
"method",
"to",
"set",
"the",
"internal",
"identifier",
"for",
"this",
"entity",
"."
] | train | https://github.com/instacount/appengine-counter/blob/60aa86ab28f173ec1642539926b69924b8bda238/src/main/java/io/instacount/appengine/counter/data/CounterShardData.java#L150-L159 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsInner.java | ManagedInstanceEncryptionProtectorsInner.beginCreateOrUpdateAsync | public Observable<ManagedInstanceEncryptionProtectorInner> beginCreateOrUpdateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceEncryptionProtectorInner parameters) {
"""
Updates an existing encryption protector.
@param resourceGroupName The name of the resource group that contains the ... | java | public Observable<ManagedInstanceEncryptionProtectorInner> beginCreateOrUpdateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceEncryptionProtectorInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).map(new Func1<Ser... | [
"public",
"Observable",
"<",
"ManagedInstanceEncryptionProtectorInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"ManagedInstanceEncryptionProtectorInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdat... | Updates an existing encryption protector.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param managedInstanceName The name of the managed instance.
@param parameters The requested encryption protector re... | [
"Updates",
"an",
"existing",
"encryption",
"protector",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsInner.java#L411-L418 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.escapeUriPath | public static void escapeUriPath(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform am URI path <strong>escape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding,
writing results to a <tt>Writer</tt>.
</p>
<p>
The following are the only allowe... | java | public static void escapeUriPath(final String text, final Writer writer)
throws IOException {
escapeUriPath(text, writer, DEFAULT_ENCODING);
} | [
"public",
"static",
"void",
"escapeUriPath",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeUriPath",
"(",
"text",
",",
"writer",
",",
"DEFAULT_ENCODING",
")",
";",
"}"
] | <p>
Perform am URI path <strong>escape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding,
writing results to a <tt>Writer</tt>.
</p>
<p>
The following are the only allowed chars in an URI path (will not be escaped):
</p>
<ul>
<li><tt>A-Z a-z 0-9</tt></li>
<li><tt>- . _ ~</tt></li>
<li><tt>!... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"using",
"<tt",
">",
"UTF",
"-",
"8<",
"/",
"tt",
">",
"as",
"encoding",
"writing",
"r... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L447-L450 |
mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.setObjectIndex | @Deprecated
public static Object setObjectIndex(Object obj, double dblIndex,
Object value, Context cx) {
"""
A cheaper and less general version of the above for well-known argument
types.
@deprecated Use {@link #setObjectIndex(Object, double, Object, Context, Scripta... | java | @Deprecated
public static Object setObjectIndex(Object obj, double dblIndex,
Object value, Context cx)
{
return setObjectIndex(obj, dblIndex, value, cx, getTopCallScope(cx));
} | [
"@",
"Deprecated",
"public",
"static",
"Object",
"setObjectIndex",
"(",
"Object",
"obj",
",",
"double",
"dblIndex",
",",
"Object",
"value",
",",
"Context",
"cx",
")",
"{",
"return",
"setObjectIndex",
"(",
"obj",
",",
"dblIndex",
",",
"value",
",",
"cx",
",... | A cheaper and less general version of the above for well-known argument
types.
@deprecated Use {@link #setObjectIndex(Object, double, Object, Context, Scriptable)} instead | [
"A",
"cheaper",
"and",
"less",
"general",
"version",
"of",
"the",
"above",
"for",
"well",
"-",
"known",
"argument",
"types",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L1753-L1758 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java | ReplicationsInner.updateAsync | public Observable<ReplicationInner> updateAsync(String resourceGroupName, String registryName, String replicationName) {
"""
Updates a replication for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param regi... | java | public Observable<ReplicationInner> updateAsync(String resourceGroupName, String registryName, String replicationName) {
return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1<ServiceResponse<ReplicationInner>, ReplicationInner>() {
@Override
... | [
"public",
"Observable",
"<",
"ReplicationInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"replicationName",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
... | Updates a replication for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param replicationName The name of the replication.
@throws IllegalArgumentException thr... | [
"Updates",
"a",
"replication",
"for",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java#L591-L598 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/validation/ecm/OwlValidator.java | OwlValidator.countRelations | private int countRelations(String relationName, Set<RelationshipTuple> objectRelations) {
"""
Private utility method. Counts the number of relations with a given name in a list of relatiosn
@param relationName the relation name
@param objectRelations the list of relations
@return the number of relations wi... | java | private int countRelations(String relationName, Set<RelationshipTuple> objectRelations) {
int count = 0;
if (objectRelations == null) {
return 0;
}
for (RelationshipTuple objectRelation : objectRelations) {
if (objectRelation.predicate.equals(relationName)) {//Th... | [
"private",
"int",
"countRelations",
"(",
"String",
"relationName",
",",
"Set",
"<",
"RelationshipTuple",
">",
"objectRelations",
")",
"{",
"int",
"count",
"=",
"0",
";",
"if",
"(",
"objectRelations",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"for",
... | Private utility method. Counts the number of relations with a given name in a list of relatiosn
@param relationName the relation name
@param objectRelations the list of relations
@return the number of relations with relationName in the list | [
"Private",
"utility",
"method",
".",
"Counts",
"the",
"number",
"of",
"relations",
"with",
"a",
"given",
"name",
"in",
"a",
"list",
"of",
"relatiosn"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/validation/ecm/OwlValidator.java#L367-L380 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/io/GeoPackageIOUtils.java | GeoPackageIOUtils.copyFile | public static void copyFile(File copyFrom, File copyTo) throws IOException {
"""
Copy a file to a file location
@param copyFrom
from file
@param copyTo
to file
@throws IOException
upon failure
"""
InputStream from = new FileInputStream(copyFrom);
OutputStream to = new FileOutputStream(copyTo);
... | java | public static void copyFile(File copyFrom, File copyTo) throws IOException {
InputStream from = new FileInputStream(copyFrom);
OutputStream to = new FileOutputStream(copyTo);
copyStream(from, to);
} | [
"public",
"static",
"void",
"copyFile",
"(",
"File",
"copyFrom",
",",
"File",
"copyTo",
")",
"throws",
"IOException",
"{",
"InputStream",
"from",
"=",
"new",
"FileInputStream",
"(",
"copyFrom",
")",
";",
"OutputStream",
"to",
"=",
"new",
"FileOutputStream",
"(... | Copy a file to a file location
@param copyFrom
from file
@param copyTo
to file
@throws IOException
upon failure | [
"Copy",
"a",
"file",
"to",
"a",
"file",
"location"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/io/GeoPackageIOUtils.java#L103-L109 |
andkulikov/Transitions-Everywhere | library(1.x)/src/main/java/com/transitionseverywhere/Transition.java | Transition.excludeChildren | @NonNull
public Transition excludeChildren(@Nullable Class type, boolean exclude) {
"""
Whether to add the given type to the list of types whose children should
be excluded from this transition. The <code>exclude</code> parameter
specifies whether the target type should be added to or removed from
the exclu... | java | @NonNull
public Transition excludeChildren(@Nullable Class type, boolean exclude) {
mTargetTypeChildExcludes = excludeObject(mTargetTypeChildExcludes, type, exclude);
return this;
} | [
"@",
"NonNull",
"public",
"Transition",
"excludeChildren",
"(",
"@",
"Nullable",
"Class",
"type",
",",
"boolean",
"exclude",
")",
"{",
"mTargetTypeChildExcludes",
"=",
"excludeObject",
"(",
"mTargetTypeChildExcludes",
",",
"type",
",",
"exclude",
")",
";",
"return... | Whether to add the given type to the list of types whose children should
be excluded from this transition. The <code>exclude</code> parameter
specifies whether the target type should be added to or removed from
the excluded list.
<p/>
<p>Excluding targets is a general mechanism for allowing transitions to run on
a view... | [
"Whether",
"to",
"add",
"the",
"given",
"type",
"to",
"the",
"list",
"of",
"types",
"whose",
"children",
"should",
"be",
"excluded",
"from",
"this",
"transition",
".",
"The",
"<code",
">",
"exclude<",
"/",
"code",
">",
"parameter",
"specifies",
"whether",
... | train | https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/Transition.java#L1320-L1324 |
qiujuer/Genius-Android | caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/TouchEffectDrawable.java | TouchEffectDrawable.onDraw | protected void onDraw(Effect shape, Canvas canvas, Paint paint) {
"""
Called from the drawable's draw() method after the canvas has been set to
draw the shape at (0,0). Subclasses can override for special effects such
as multiple layers, stroking, etc.
"""
shape.draw(canvas, paint);
} | java | protected void onDraw(Effect shape, Canvas canvas, Paint paint) {
shape.draw(canvas, paint);
} | [
"protected",
"void",
"onDraw",
"(",
"Effect",
"shape",
",",
"Canvas",
"canvas",
",",
"Paint",
"paint",
")",
"{",
"shape",
".",
"draw",
"(",
"canvas",
",",
"paint",
")",
";",
"}"
] | Called from the drawable's draw() method after the canvas has been set to
draw the shape at (0,0). Subclasses can override for special effects such
as multiple layers, stroking, etc. | [
"Called",
"from",
"the",
"drawable",
"s",
"draw",
"()",
"method",
"after",
"the",
"canvas",
"has",
"been",
"set",
"to",
"draw",
"the",
"shape",
"at",
"(",
"0",
"0",
")",
".",
"Subclasses",
"can",
"override",
"for",
"special",
"effects",
"such",
"as",
"... | train | https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/TouchEffectDrawable.java#L240-L242 |
jenkinsci/jenkins | core/src/main/java/jenkins/security/UserDetailsCache.java | UserDetailsCache.loadUserByUsername | @Nonnull
public UserDetails loadUserByUsername(String idOrFullName) throws UsernameNotFoundException, DataAccessException, ExecutionException {
"""
Locates the user based on the username, by first looking in the cache and then delegate to
{@link hudson.security.SecurityRealm#loadUserByUsername(String)}.
@p... | java | @Nonnull
public UserDetails loadUserByUsername(String idOrFullName) throws UsernameNotFoundException, DataAccessException, ExecutionException {
Boolean exists = existenceCache.getIfPresent(idOrFullName);
if(exists != null && !exists) {
throw new UsernameNotFoundException(String.format("\... | [
"@",
"Nonnull",
"public",
"UserDetails",
"loadUserByUsername",
"(",
"String",
"idOrFullName",
")",
"throws",
"UsernameNotFoundException",
",",
"DataAccessException",
",",
"ExecutionException",
"{",
"Boolean",
"exists",
"=",
"existenceCache",
".",
"getIfPresent",
"(",
"i... | Locates the user based on the username, by first looking in the cache and then delegate to
{@link hudson.security.SecurityRealm#loadUserByUsername(String)}.
@param idOrFullName the username
@return the details
@throws UsernameNotFoundException (normally a {@link hudson.security.UserMayOrMayNotExistException})
if the ... | [
"Locates",
"the",
"user",
"based",
"on",
"the",
"username",
"by",
"first",
"looking",
"in",
"the",
"cache",
"and",
"then",
"delegate",
"to",
"{",
"@link",
"hudson",
".",
"security",
".",
"SecurityRealm#loadUserByUsername",
"(",
"String",
")",
"}",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/UserDetailsCache.java#L120-L138 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java | CommonOps_DDF2.elementMult | public static void elementMult( DMatrix2 a , DMatrix2 b , DMatrix2 c ) {
"""
<p>Performs an element by element multiplication operation:<br>
<br>
c<sub>i</sub> = a<sub>i</sub> * b<sub>j</sub> <br>
</p>
@param a The left vector in the multiplication operation. Not modified.
@param b The right vector in the mul... | java | public static void elementMult( DMatrix2 a , DMatrix2 b , DMatrix2 c ) {
c.a1 = a.a1*b.a1;
c.a2 = a.a2*b.a2;
} | [
"public",
"static",
"void",
"elementMult",
"(",
"DMatrix2",
"a",
",",
"DMatrix2",
"b",
",",
"DMatrix2",
"c",
")",
"{",
"c",
".",
"a1",
"=",
"a",
".",
"a1",
"*",
"b",
".",
"a1",
";",
"c",
".",
"a2",
"=",
"a",
".",
"a2",
"*",
"b",
".",
"a2",
... | <p>Performs an element by element multiplication operation:<br>
<br>
c<sub>i</sub> = a<sub>i</sub> * b<sub>j</sub> <br>
</p>
@param a The left vector in the multiplication operation. Not modified.
@param b The right vector in the multiplication operation. Not modified.
@param c Where the results of the operation are st... | [
"<p",
">",
"Performs",
"an",
"element",
"by",
"element",
"multiplication",
"operation",
":",
"<br",
">",
"<br",
">",
"c<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"*",
"b<sub",
">",
"j<",
"/",
"sub",
">",
"<br",
"... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java#L907-L910 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getPagesContainingTemplateNames | public Iterable<Page> getPagesContainingTemplateNames(List<String> templateNames) throws WikiApiException {
"""
Return an iterable containing all pages that contain a template the name
of which equals any of the given Strings.
@param templateNames
the names of the template that we want to match
@return An it... | java | public Iterable<Page> getPagesContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredPages(templateNames, true);
} | [
"public",
"Iterable",
"<",
"Page",
">",
"getPagesContainingTemplateNames",
"(",
"List",
"<",
"String",
">",
"templateNames",
")",
"throws",
"WikiApiException",
"{",
"return",
"getFilteredPages",
"(",
"templateNames",
",",
"true",
")",
";",
"}"
] | Return an iterable containing all pages that contain a template the name
of which equals any of the given Strings.
@param templateNames
the names of the template that we want to match
@return An iterable with the page objects that contain any of the the
specified templates
@throws WikiApiException
If there was any err... | [
"Return",
"an",
"iterable",
"containing",
"all",
"pages",
"that",
"contain",
"a",
"template",
"the",
"name",
"of",
"which",
"equals",
"any",
"of",
"the",
"given",
"Strings",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L511-L513 |
killme2008/gecko | src/main/java/com/taobao/gecko/service/timer/ConcurrentIdentityHashMap.java | ConcurrentIdentityHashMap.replace | public boolean replace(K key, V oldValue, V newValue) {
"""
{@inheritDoc}
@throws NullPointerException
if any of the arguments are null
"""
if (oldValue == null || newValue == null) {
throw new NullPointerException();
}
int hash = this.hashOf(key);
return this.se... | java | public boolean replace(K key, V oldValue, V newValue) {
if (oldValue == null || newValue == null) {
throw new NullPointerException();
}
int hash = this.hashOf(key);
return this.segmentFor(hash).replace(key, hash, oldValue, newValue);
} | [
"public",
"boolean",
"replace",
"(",
"K",
"key",
",",
"V",
"oldValue",
",",
"V",
"newValue",
")",
"{",
"if",
"(",
"oldValue",
"==",
"null",
"||",
"newValue",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"int",
"... | {@inheritDoc}
@throws NullPointerException
if any of the arguments are null | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/killme2008/gecko/blob/0873b690ffde51e40e6eadfcd5d599eb4e3b642d/src/main/java/com/taobao/gecko/service/timer/ConcurrentIdentityHashMap.java#L1071-L1077 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/cmdline/Utils.java | Utils.getServerConfigDir | public static File getServerConfigDir(String serverName) {
"""
Returns server configuration directory. This directory contains server configuration files
(bootstrap.properties, server.xml, jvm.options, etc). It correspond to the value of ${server.config.dir}
variable in server.xml configuration file.
@param s... | java | public static File getServerConfigDir(String serverName) {
if (serverName == null) {
throw new IllegalArgumentException("Parameter serverName can not be 'null'");
}
File userDir = Utils.getUserDir();
if (userDir != null) {
return new File(new File(userDir, "server... | [
"public",
"static",
"File",
"getServerConfigDir",
"(",
"String",
"serverName",
")",
"{",
"if",
"(",
"serverName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Parameter serverName can not be 'null'\"",
")",
";",
"}",
"File",
"userDir",... | Returns server configuration directory. This directory contains server configuration files
(bootstrap.properties, server.xml, jvm.options, etc). It correspond to the value of ${server.config.dir}
variable in server.xml configuration file.
@param serverName server's name
@return instance of the server configuration dir... | [
"Returns",
"server",
"configuration",
"directory",
".",
"This",
"directory",
"contains",
"server",
"configuration",
"files",
"(",
"bootstrap",
".",
"properties",
"server",
".",
"xml",
"jvm",
".",
"options",
"etc",
")",
".",
"It",
"correspond",
"to",
"the",
"va... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/cmdline/Utils.java#L232-L241 |
spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/common/exceptions/OAuth2Exception.java | OAuth2Exception.valueOf | public static OAuth2Exception valueOf(Map<String, String> errorParams) {
"""
Creates an {@link OAuth2Exception} from a Map<String,String>.
@param errorParams
@return
"""
String errorCode = errorParams.get(ERROR);
String errorMessage = errorParams.containsKey(DESCRIPTION) ? errorParams.get(DESCRIP... | java | public static OAuth2Exception valueOf(Map<String, String> errorParams) {
String errorCode = errorParams.get(ERROR);
String errorMessage = errorParams.containsKey(DESCRIPTION) ? errorParams.get(DESCRIPTION)
: null;
OAuth2Exception ex = create(errorCode, errorMessage);
Set<Map.Entry<String, String>> entries =... | [
"public",
"static",
"OAuth2Exception",
"valueOf",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"errorParams",
")",
"{",
"String",
"errorCode",
"=",
"errorParams",
".",
"get",
"(",
"ERROR",
")",
";",
"String",
"errorMessage",
"=",
"errorParams",
".",
"conta... | Creates an {@link OAuth2Exception} from a Map<String,String>.
@param errorParams
@return | [
"Creates",
"an",
"{",
"@link",
"OAuth2Exception",
"}",
"from",
"a",
"Map<",
";",
"String",
"String>",
";",
"."
] | train | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/common/exceptions/OAuth2Exception.java#L139-L153 |
ZieIony/Carbon | carbon/src/main/java/carbon/shadow/ShapePath.java | ShapePath.applyToPath | public void applyToPath(Matrix transform, Path path) {
"""
Apply the ShapePath sequence to a {@link Path} under a matrix transform.
@param transform the matrix transform under which this ShapePath is applied
@param path the path to which this ShapePath is applied
"""
for (int i = 0, size = ope... | java | public void applyToPath(Matrix transform, Path path) {
for (int i = 0, size = operations.size(); i < size; i++) {
PathOperation operation = operations.get(i);
operation.applyToPath(transform, path);
}
} | [
"public",
"void",
"applyToPath",
"(",
"Matrix",
"transform",
",",
"Path",
"path",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"size",
"=",
"operations",
".",
"size",
"(",
")",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"PathOperation",
... | Apply the ShapePath sequence to a {@link Path} under a matrix transform.
@param transform the matrix transform under which this ShapePath is applied
@param path the path to which this ShapePath is applied | [
"Apply",
"the",
"ShapePath",
"sequence",
"to",
"a",
"{",
"@link",
"Path",
"}",
"under",
"a",
"matrix",
"transform",
"."
] | train | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/shadow/ShapePath.java#L159-L164 |
Jasig/uPortal | uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/localization/UserLocaleHelper.java | UserLocaleHelper.updateUserLocale | public void updateUserLocale(HttpServletRequest request, String localeString) {
"""
Update the current user's locale to match the selected locale. This implementation will
update the session locale, and if the user is not a guest, will also update the locale in the
user's persisted preferences.
@param request... | java | public void updateUserLocale(HttpServletRequest request, String localeString) {
IUserInstance ui = userInstanceManager.getUserInstance(request);
IUserPreferencesManager upm = ui.getPreferencesManager();
final IUserProfile userProfile = upm.getUserProfile();
LocaleManager localeManager =... | [
"public",
"void",
"updateUserLocale",
"(",
"HttpServletRequest",
"request",
",",
"String",
"localeString",
")",
"{",
"IUserInstance",
"ui",
"=",
"userInstanceManager",
".",
"getUserInstance",
"(",
"request",
")",
";",
"IUserPreferencesManager",
"upm",
"=",
"ui",
"."... | Update the current user's locale to match the selected locale. This implementation will
update the session locale, and if the user is not a guest, will also update the locale in the
user's persisted preferences.
@param request
@param localeString | [
"Update",
"the",
"current",
"user",
"s",
"locale",
"to",
"match",
"the",
"selected",
"locale",
".",
"This",
"implementation",
"will",
"update",
"the",
"session",
"locale",
"and",
"if",
"the",
"user",
"is",
"not",
"a",
"guest",
"will",
"also",
"update",
"th... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/localization/UserLocaleHelper.java#L133-L168 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseSdense2csr | public static int cusparseSdense2csr(
cusparseHandle handle,
int m,
int n,
cusparseMatDescr descrA,
Pointer A,
int lda,
Pointer nnzPerRow,
Pointer csrSortedValA,
Pointer csrSortedRowPtrA,
Pointer csrSortedColIndA) {
"... | java | public static int cusparseSdense2csr(
cusparseHandle handle,
int m,
int n,
cusparseMatDescr descrA,
Pointer A,
int lda,
Pointer nnzPerRow,
Pointer csrSortedValA,
Pointer csrSortedRowPtrA,
Pointer csrSortedColIndA)
{
... | [
"public",
"static",
"int",
"cusparseSdense2csr",
"(",
"cusparseHandle",
"handle",
",",
"int",
"m",
",",
"int",
"n",
",",
"cusparseMatDescr",
"descrA",
",",
"Pointer",
"A",
",",
"int",
"lda",
",",
"Pointer",
"nnzPerRow",
",",
"Pointer",
"csrSortedValA",
",",
... | Description: This routine converts a dense matrix to a sparse matrix
in the CSR storage format, using the information computed by the
nnz routine. | [
"Description",
":",
"This",
"routine",
"converts",
"a",
"dense",
"matrix",
"to",
"a",
"sparse",
"matrix",
"in",
"the",
"CSR",
"storage",
"format",
"using",
"the",
"information",
"computed",
"by",
"the",
"nnz",
"routine",
"."
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L11174-L11187 |
windup/windup | reporting/api/src/main/java/org/jboss/windup/reporting/category/IssueCategoryRegistry.java | IssueCategoryRegistry.loadFromGraph | public static IssueCategoryModel loadFromGraph(GraphContext graphContext, IssueCategory issueCategory) {
"""
Loads the related graph vertex for the given {@link IssueCategory}.
"""
return loadFromGraph(graphContext.getFramed(), issueCategory.getCategoryID());
} | java | public static IssueCategoryModel loadFromGraph(GraphContext graphContext, IssueCategory issueCategory)
{
return loadFromGraph(graphContext.getFramed(), issueCategory.getCategoryID());
} | [
"public",
"static",
"IssueCategoryModel",
"loadFromGraph",
"(",
"GraphContext",
"graphContext",
",",
"IssueCategory",
"issueCategory",
")",
"{",
"return",
"loadFromGraph",
"(",
"graphContext",
".",
"getFramed",
"(",
")",
",",
"issueCategory",
".",
"getCategoryID",
"("... | Loads the related graph vertex for the given {@link IssueCategory}. | [
"Loads",
"the",
"related",
"graph",
"vertex",
"for",
"the",
"given",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/category/IssueCategoryRegistry.java#L109-L112 |
networknt/light-4j | utility/src/main/java/com/networknt/utility/DateUtil.java | DateUtil.parseIso8601Date | public static Instant parseIso8601Date(String dateString) {
"""
Parses the specified date string as an ISO 8601 date (yyyy-MM-dd'T'HH:mm:ss.SSSZZ)
and returns the {@link Instant} object.
@param dateString
The date string to parse.
@return The parsed Instant object.
"""
// For EC2 Spot Fleet.
... | java | public static Instant parseIso8601Date(String dateString) {
// For EC2 Spot Fleet.
if (dateString.endsWith("+0000")) {
dateString = dateString
.substring(0, dateString.length() - 5)
.concat("Z");
}
try {
return parseInstant... | [
"public",
"static",
"Instant",
"parseIso8601Date",
"(",
"String",
"dateString",
")",
"{",
"// For EC2 Spot Fleet.",
"if",
"(",
"dateString",
".",
"endsWith",
"(",
"\"+0000\"",
")",
")",
"{",
"dateString",
"=",
"dateString",
".",
"substring",
"(",
"0",
",",
"da... | Parses the specified date string as an ISO 8601 date (yyyy-MM-dd'T'HH:mm:ss.SSSZZ)
and returns the {@link Instant} object.
@param dateString
The date string to parse.
@return The parsed Instant object. | [
"Parses",
"the",
"specified",
"date",
"string",
"as",
"an",
"ISO",
"8601",
"date",
"(",
"yyyy",
"-",
"MM",
"-",
"dd",
"T",
"HH",
":",
"mm",
":",
"ss",
".",
"SSSZZ",
")",
"and",
"returns",
"the",
"{",
"@link",
"Instant",
"}",
"object",
"."
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/utility/src/main/java/com/networknt/utility/DateUtil.java#L56-L69 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/collect/Maps.java | Maps.newLinkedHashMap | public static <K, V> LinkedHashMap<K, V> newLinkedHashMap(Map<? extends K, ? extends V> map) {
"""
Creates a <i>mutable</i>, insertion-ordered {@code LinkedHashMap} instance
with the same mappings as the specified map.
<p><b>Note:</b> if mutability is not required, use {@link
ImmutableMap#copyOf(Map)} instead... | java | public static <K, V> LinkedHashMap<K, V> newLinkedHashMap(Map<? extends K, ? extends V> map) {
return new LinkedHashMap<K, V>(map);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"LinkedHashMap",
"<",
"K",
",",
"V",
">",
"newLinkedHashMap",
"(",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"map",
")",
"{",
"return",
"new",
"LinkedHashMap",
"<",
"K",
",",
"V",
... | Creates a <i>mutable</i>, insertion-ordered {@code LinkedHashMap} instance
with the same mappings as the specified map.
<p><b>Note:</b> if mutability is not required, use {@link
ImmutableMap#copyOf(Map)} instead.
<p><b>Note for Java 7 and later:</b> this method is now unnecessary and
should be treated as deprecated. ... | [
"Creates",
"a",
"<i",
">",
"mutable<",
"/",
"i",
">",
"insertion",
"-",
"ordered",
"{",
"@code",
"LinkedHashMap",
"}",
"instance",
"with",
"the",
"same",
"mappings",
"as",
"the",
"specified",
"map",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/Maps.java#L283-L285 |
HubSpot/Singularity | SingularityExecutor/src/main/java/com/hubspot/singularity/executor/SingularityExecutor.java | SingularityExecutor.registered | @Override
public void registered(ExecutorDriver executorDriver, Protos.ExecutorInfo executorInfo, Protos.FrameworkInfo frameworkInfo, Protos.SlaveInfo slaveInfo) {
"""
Invoked once the executor driver has been able to successfully
connect with Mesos. In particular, a scheduler can pass some
data to it's execut... | java | @Override
public void registered(ExecutorDriver executorDriver, Protos.ExecutorInfo executorInfo, Protos.FrameworkInfo frameworkInfo, Protos.SlaveInfo slaveInfo) {
LOG.debug("Registered {} with Mesos slave {} for framework {}", executorInfo.getExecutorId().getValue(), slaveInfo.getId().getValue(), frameworkInfo.g... | [
"@",
"Override",
"public",
"void",
"registered",
"(",
"ExecutorDriver",
"executorDriver",
",",
"Protos",
".",
"ExecutorInfo",
"executorInfo",
",",
"Protos",
".",
"FrameworkInfo",
"frameworkInfo",
",",
"Protos",
".",
"SlaveInfo",
"slaveInfo",
")",
"{",
"LOG",
".",
... | Invoked once the executor driver has been able to successfully
connect with Mesos. In particular, a scheduler can pass some
data to it's executors through the FrameworkInfo.ExecutorInfo's
data field. | [
"Invoked",
"once",
"the",
"executor",
"driver",
"has",
"been",
"able",
"to",
"successfully",
"connect",
"with",
"Mesos",
".",
"In",
"particular",
"a",
"scheduler",
"can",
"pass",
"some",
"data",
"to",
"it",
"s",
"executors",
"through",
"the",
"FrameworkInfo",
... | train | https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityExecutor/src/main/java/com/hubspot/singularity/executor/SingularityExecutor.java#L42-L46 |
sniffy/sniffy | sniffy-core/src/main/java/io/sniffy/LegacySpy.java | LegacySpy.verifyBetween | @Deprecated
public C verifyBetween(int minAllowedStatements, int maxAllowedStatements, Query query) throws WrongNumberOfQueriesError {
"""
Verifies that at least {@code minAllowedStatements} and at most
{@code maxAllowedStatements} were called between the creation of the current instance
and a call to {@link... | java | @Deprecated
public C verifyBetween(int minAllowedStatements, int maxAllowedStatements, Query query) throws WrongNumberOfQueriesError {
return verify(SqlQueries.queriesBetween(minAllowedStatements, maxAllowedStatements).type(adapter(query)));
} | [
"@",
"Deprecated",
"public",
"C",
"verifyBetween",
"(",
"int",
"minAllowedStatements",
",",
"int",
"maxAllowedStatements",
",",
"Query",
"query",
")",
"throws",
"WrongNumberOfQueriesError",
"{",
"return",
"verify",
"(",
"SqlQueries",
".",
"queriesBetween",
"(",
"min... | Verifies that at least {@code minAllowedStatements} and at most
{@code maxAllowedStatements} were called between the creation of the current instance
and a call to {@link #verify()} method
@throws WrongNumberOfQueriesError if wrong number of queries was executed
@since 2.2 | [
"Verifies",
"that",
"at",
"least",
"{"
] | train | https://github.com/sniffy/sniffy/blob/7bdddb9593e6b6e9fe5c7c87519f864acbc3a5c0/sniffy-core/src/main/java/io/sniffy/LegacySpy.java#L663-L666 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/session/AbstractDocumentQuery.java | AbstractDocumentQuery._whereIn | @Override
public void _whereIn(String fieldName, Collection<Object> values) {
"""
Check that the field has one of the specified value
@param fieldName Field name to use
@param values Values to find
"""
_whereIn(fieldName, values, false);
} | java | @Override
public void _whereIn(String fieldName, Collection<Object> values) {
_whereIn(fieldName, values, false);
} | [
"@",
"Override",
"public",
"void",
"_whereIn",
"(",
"String",
"fieldName",
",",
"Collection",
"<",
"Object",
">",
"values",
")",
"{",
"_whereIn",
"(",
"fieldName",
",",
"values",
",",
"false",
")",
";",
"}"
] | Check that the field has one of the specified value
@param fieldName Field name to use
@param values Values to find | [
"Check",
"that",
"the",
"field",
"has",
"one",
"of",
"the",
"specified",
"value"
] | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/session/AbstractDocumentQuery.java#L577-L580 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.xmlConversionNameUndefined | public static void xmlConversionNameUndefined(String xmlPath, String className) {
"""
Thrown when the conversion name is undefined.
@param xmlPath xml path
@param className class name
"""
throw new XmlConversionNameException(MSG.INSTANCE.message(xmlConversionNameException,xmlPath,className));
} | java | public static void xmlConversionNameUndefined(String xmlPath, String className) {
throw new XmlConversionNameException(MSG.INSTANCE.message(xmlConversionNameException,xmlPath,className));
} | [
"public",
"static",
"void",
"xmlConversionNameUndefined",
"(",
"String",
"xmlPath",
",",
"String",
"className",
")",
"{",
"throw",
"new",
"XmlConversionNameException",
"(",
"MSG",
".",
"INSTANCE",
".",
"message",
"(",
"xmlConversionNameException",
",",
"xmlPath",
",... | Thrown when the conversion name is undefined.
@param xmlPath xml path
@param className class name | [
"Thrown",
"when",
"the",
"conversion",
"name",
"is",
"undefined",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L328-L330 |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/S3Manager.java | S3Manager.downloadLog | public byte[] downloadLog(CloudTrailLog ctLog, CloudTrailSource source) {
"""
Downloads an AWS CloudTrail log from the specified source.
@param ctLog The {@link CloudTrailLog} to download
@param source The {@link CloudTrailSource} to download the log from.
@return A byte array containing the log data.
"""... | java | public byte[] downloadLog(CloudTrailLog ctLog, CloudTrailSource source) {
boolean success = false;
ProgressStatus downloadLogStatus = new ProgressStatus(ProgressState.downloadLog, new BasicProcessLogInfo(source, ctLog, success));
final Object downloadSourceReportObject = progressReporter.reportS... | [
"public",
"byte",
"[",
"]",
"downloadLog",
"(",
"CloudTrailLog",
"ctLog",
",",
"CloudTrailSource",
"source",
")",
"{",
"boolean",
"success",
"=",
"false",
";",
"ProgressStatus",
"downloadLogStatus",
"=",
"new",
"ProgressStatus",
"(",
"ProgressState",
".",
"downloa... | Downloads an AWS CloudTrail log from the specified source.
@param ctLog The {@link CloudTrailLog} to download
@param source The {@link CloudTrailSource} to download the log from.
@return A byte array containing the log data. | [
"Downloads",
"an",
"AWS",
"CloudTrail",
"log",
"from",
"the",
"specified",
"source",
"."
] | train | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/S3Manager.java#L74-L100 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java | JenkinsServer.createFolder | public JenkinsServer createFolder(FolderJob folder, String jobName, Boolean crumbFlag) throws IOException {
"""
Create a job on the server (in the given folder)
@param folder {@link FolderJob}
@param jobName name of the job.
@param crumbFlag <code>true</code> to add <b>crumbIssuer</b>
<code>false</code> othe... | java | public JenkinsServer createFolder(FolderJob folder, String jobName, Boolean crumbFlag) throws IOException {
// https://gist.github.com/stuart-warren/7786892 was slightly helpful
// here
//TODO: JDK9+: Map.of(...)
Map<String, String> params = new HashMap<>();
params.put("mode", "c... | [
"public",
"JenkinsServer",
"createFolder",
"(",
"FolderJob",
"folder",
",",
"String",
"jobName",
",",
"Boolean",
"crumbFlag",
")",
"throws",
"IOException",
"{",
"// https://gist.github.com/stuart-warren/7786892 was slightly helpful",
"// here",
"//TODO: JDK9+: Map.of(...)",
"Ma... | Create a job on the server (in the given folder)
@param folder {@link FolderJob}
@param jobName name of the job.
@param crumbFlag <code>true</code> to add <b>crumbIssuer</b>
<code>false</code> otherwise.
@throws IOException in case of an error. | [
"Create",
"a",
"job",
"on",
"the",
"server",
"(",
"in",
"the",
"given",
"folder",
")"
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L491-L502 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/FormatterFacade.java | FormatterFacade.formatResourceRegion | @Pure
public String formatResourceRegion(XtextResource resource, int offset, int length) {
"""
Format the code in the given region.
<p>This function does not change the resource content.
@param resource the resource to format.
@param offset the offset of the text to format.
@param length the length of the... | java | @Pure
public String formatResourceRegion(XtextResource resource, int offset, int length) {
assert resource != null;
assert offset >= 0;
assert length >= 0;
try {
final ITextRegionAccess regionAccess = this.regionAccessBuilder.get().forNodeModel(resource).create();
final FormatterRequest formatterRequest ... | [
"@",
"Pure",
"public",
"String",
"formatResourceRegion",
"(",
"XtextResource",
"resource",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"assert",
"resource",
"!=",
"null",
";",
"assert",
"offset",
">=",
"0",
";",
"assert",
"length",
">=",
"0",
";"... | Format the code in the given region.
<p>This function does not change the resource content.
@param resource the resource to format.
@param offset the offset of the text to format.
@param length the length of the text.
@return the result of the formatting. | [
"Format",
"the",
"code",
"in",
"the",
"given",
"region",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/FormatterFacade.java#L185-L201 |
amaembo/streamex | src/main/java/one/util/streamex/LongStreamEx.java | LongStreamEx.joining | public String joining(CharSequence delimiter, CharSequence prefix, CharSequence suffix) {
"""
Returns a {@link String} which is the concatenation of the results of
calling {@link String#valueOf(long)} on each element of this stream,
separated by the specified delimiter, with the specified prefix and
suffix in e... | java | public String joining(CharSequence delimiter, CharSequence prefix, CharSequence suffix) {
return collect(LongCollector.joining(delimiter, prefix, suffix));
} | [
"public",
"String",
"joining",
"(",
"CharSequence",
"delimiter",
",",
"CharSequence",
"prefix",
",",
"CharSequence",
"suffix",
")",
"{",
"return",
"collect",
"(",
"LongCollector",
".",
"joining",
"(",
"delimiter",
",",
"prefix",
",",
"suffix",
")",
")",
";",
... | Returns a {@link String} which is the concatenation of the results of
calling {@link String#valueOf(long)} on each element of this stream,
separated by the specified delimiter, with the specified prefix and
suffix in encounter order.
<p>
This is a terminal operation.
@param delimiter the delimiter to be used between ... | [
"Returns",
"a",
"{",
"@link",
"String",
"}",
"which",
"is",
"the",
"concatenation",
"of",
"the",
"results",
"of",
"calling",
"{",
"@link",
"String#valueOf",
"(",
"long",
")",
"}",
"on",
"each",
"element",
"of",
"this",
"stream",
"separated",
"by",
"the",
... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/LongStreamEx.java#L1422-L1424 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/to/GeoJsonTo.java | GeoJsonTo.mergeInto | private static void mergeInto(double[] first, double[] second) {
"""
Merges the second boundingbox into the first. Basically, this extends the first boundingbox to also
encapsulate the second
@param first the first boundingbox
@param second the second boundingbox
"""
for (int j = 0; j < first.len... | java | private static void mergeInto(double[] first, double[] second) {
for (int j = 0; j < first.length / 2; j++) {
first[j] = Math.min(first[j], second[j]);
first[j + first.length / 2] = Math.max(first[j + first.length / 2], second[j + first.length / 2]);
}
} | [
"private",
"static",
"void",
"mergeInto",
"(",
"double",
"[",
"]",
"first",
",",
"double",
"[",
"]",
"second",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"first",
".",
"length",
"/",
"2",
";",
"j",
"++",
")",
"{",
"first",
"[",
... | Merges the second boundingbox into the first. Basically, this extends the first boundingbox to also
encapsulate the second
@param first the first boundingbox
@param second the second boundingbox | [
"Merges",
"the",
"second",
"boundingbox",
"into",
"the",
"first",
".",
"Basically",
"this",
"extends",
"the",
"first",
"boundingbox",
"to",
"also",
"encapsulate",
"the",
"second"
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/to/GeoJsonTo.java#L242-L247 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/model/DateRange.java | DateRange.includes | public final boolean includes(final Date date, final int inclusiveMask) {
"""
Decides whether a date falls within this period.
@param date the date to be tested
@param inclusiveMask specifies whether period start and end are included
in the calculation
@return true if the date is in the period, false otherwise... | java | public final boolean includes(final Date date, final int inclusiveMask) {
boolean includes;
if ((inclusiveMask & INCLUSIVE_START) > 0) {
includes = !rangeStart.after(date);
}
else {
includes = rangeStart.before(date);
}
if ((inclusiveMask & INCLUSI... | [
"public",
"final",
"boolean",
"includes",
"(",
"final",
"Date",
"date",
",",
"final",
"int",
"inclusiveMask",
")",
"{",
"boolean",
"includes",
";",
"if",
"(",
"(",
"inclusiveMask",
"&",
"INCLUSIVE_START",
")",
">",
"0",
")",
"{",
"includes",
"=",
"!",
"r... | Decides whether a date falls within this period.
@param date the date to be tested
@param inclusiveMask specifies whether period start and end are included
in the calculation
@return true if the date is in the period, false otherwise
@see Period#INCLUSIVE_START
@see Period#INCLUSIVE_END | [
"Decides",
"whether",
"a",
"date",
"falls",
"within",
"this",
"period",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/model/DateRange.java#L114-L129 |
opengeospatial/teamengine | teamengine-web/src/main/java/com/occamlab/te/web/CoverageMonitor.java | CoverageMonitor.writeCoverageResults | public void writeCoverageResults() {
"""
Writes the residual ICS document to a file in the test session directory.
"""
File coverageFile = new File(this.testSessionDir,
ICS_MAP.get(this.requestId));
if (coverageFile.exists()) {
return;
}
OutputS... | java | public void writeCoverageResults() {
File coverageFile = new File(this.testSessionDir,
ICS_MAP.get(this.requestId));
if (coverageFile.exists()) {
return;
}
OutputStream fos = null;
try {
fos = new FileOutputStream(coverageFile, fals... | [
"public",
"void",
"writeCoverageResults",
"(",
")",
"{",
"File",
"coverageFile",
"=",
"new",
"File",
"(",
"this",
".",
"testSessionDir",
",",
"ICS_MAP",
".",
"get",
"(",
"this",
".",
"requestId",
")",
")",
";",
"if",
"(",
"coverageFile",
".",
"exists",
"... | Writes the residual ICS document to a file in the test session directory. | [
"Writes",
"the",
"residual",
"ICS",
"document",
"to",
"a",
"file",
"in",
"the",
"test",
"session",
"directory",
"."
] | train | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-web/src/main/java/com/occamlab/te/web/CoverageMonitor.java#L198-L226 |
Red5/red5-server-common | src/main/java/org/red5/server/net/remoting/RemotingClient.java | RemotingClient.invokeMethod | public void invokeMethod(String method, Object[] methodParams, IRemotingCallback callback) {
"""
Invoke a method asynchronously on the remoting server.
@param method
Method name
@param methodParams
Parameters passed to method
@param callback
Callback
"""
try {
RemotingWorker worke... | java | public void invokeMethod(String method, Object[] methodParams, IRemotingCallback callback) {
try {
RemotingWorker worker = new RemotingWorker(this, method, methodParams, callback);
executor.execute(worker);
} catch (Exception err) {
log.warn("Exception invoking m... | [
"public",
"void",
"invokeMethod",
"(",
"String",
"method",
",",
"Object",
"[",
"]",
"methodParams",
",",
"IRemotingCallback",
"callback",
")",
"{",
"try",
"{",
"RemotingWorker",
"worker",
"=",
"new",
"RemotingWorker",
"(",
"this",
",",
"method",
",",
"methodPa... | Invoke a method asynchronously on the remoting server.
@param method
Method name
@param methodParams
Parameters passed to method
@param callback
Callback | [
"Invoke",
"a",
"method",
"asynchronously",
"on",
"the",
"remoting",
"server",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/remoting/RemotingClient.java#L374-L381 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java | AbnormalFinallyBlockReturn.findMethod | @Nullable
private static Method findMethod(JavaClass cls, String name, String sig) {
"""
finds the method in specified class by name and signature
@param cls
the class to look the method in
@param name
the name of the method to look for
@param sig
the signature of the method to look for
@return the ... | java | @Nullable
private static Method findMethod(JavaClass cls, String name, String sig) {
Method[] methods = cls.getMethods();
for (Method m : methods) {
if (m.getName().equals(name) && m.getSignature().equals(sig)) {
return m;
}
}
return null;
... | [
"@",
"Nullable",
"private",
"static",
"Method",
"findMethod",
"(",
"JavaClass",
"cls",
",",
"String",
"name",
",",
"String",
"sig",
")",
"{",
"Method",
"[",
"]",
"methods",
"=",
"cls",
".",
"getMethods",
"(",
")",
";",
"for",
"(",
"Method",
"m",
":",
... | finds the method in specified class by name and signature
@param cls
the class to look the method in
@param name
the name of the method to look for
@param sig
the signature of the method to look for
@return the Method object for the specified information | [
"finds",
"the",
"method",
"in",
"specified",
"class",
"by",
"name",
"and",
"signature"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java#L209-L219 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java | ClassParser.checkConstantPoolIndex | private void checkConstantPoolIndex(int index) throws InvalidClassFileFormatException {
"""
Check that a constant pool index is valid.
@param index
the index to check
@throws InvalidClassFileFormatException
if the index is not valid
"""
if (index < 0 || index >= constantPool.length || constantPoo... | java | private void checkConstantPoolIndex(int index) throws InvalidClassFileFormatException {
if (index < 0 || index >= constantPool.length || constantPool[index] == null) {
throw new InvalidClassFileFormatException(expectedClassDescriptor, codeBaseEntry);
}
} | [
"private",
"void",
"checkConstantPoolIndex",
"(",
"int",
"index",
")",
"throws",
"InvalidClassFileFormatException",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"constantPool",
".",
"length",
"||",
"constantPool",
"[",
"index",
"]",
"==",
"null",
")... | Check that a constant pool index is valid.
@param index
the index to check
@throws InvalidClassFileFormatException
if the index is not valid | [
"Check",
"that",
"a",
"constant",
"pool",
"index",
"is",
"valid",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java#L348-L352 |
wisdom-framework/wisdom-jcr | wisdom-jcr-core/src/main/java/org/wisdom/jcrom/runtime/JcromBundleContext.java | JcromBundleContext.registerCrud | private ServiceRegistration registerCrud(BundleContext context, JcrCrudService crud) {
"""
Register the given Crud service in OSGi registry
@param context
@param crud
@return
"""
Dictionary prop = jcromConfiguration.toDictionary();
prop.put(Crud.ENTITY_CLASS_PROPERTY, crud.getEntityClass());... | java | private ServiceRegistration registerCrud(BundleContext context, JcrCrudService crud) {
Dictionary prop = jcromConfiguration.toDictionary();
prop.put(Crud.ENTITY_CLASS_PROPERTY, crud.getEntityClass());
prop.put(Crud.ENTITY_CLASSNAME_PROPERTY, crud.getEntityClass().getName());
ServiceRegis... | [
"private",
"ServiceRegistration",
"registerCrud",
"(",
"BundleContext",
"context",
",",
"JcrCrudService",
"crud",
")",
"{",
"Dictionary",
"prop",
"=",
"jcromConfiguration",
".",
"toDictionary",
"(",
")",
";",
"prop",
".",
"put",
"(",
"Crud",
".",
"ENTITY_CLASS_PRO... | Register the given Crud service in OSGi registry
@param context
@param crud
@return | [
"Register",
"the",
"given",
"Crud",
"service",
"in",
"OSGi",
"registry"
] | train | https://github.com/wisdom-framework/wisdom-jcr/blob/2711383dde2239a19b90c226b3fd2aecab5715e4/wisdom-jcr-core/src/main/java/org/wisdom/jcrom/runtime/JcromBundleContext.java#L73-L79 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/TagUtil.java | TagUtil.addTagMetaData | public static void addTagMetaData(ConfigWebImpl cw, lucee.commons.io.log.Log log) {
"""
load metadata from cfc based custom tags and add the info to the tag
@param cs
@param config
"""
if (true) return;
PageContextImpl pc = null;
try {
pc = ThreadUtil.createPageContext(cw, DevNullOutputStream.DEV_... | java | public static void addTagMetaData(ConfigWebImpl cw, lucee.commons.io.log.Log log) {
if (true) return;
PageContextImpl pc = null;
try {
pc = ThreadUtil.createPageContext(cw, DevNullOutputStream.DEV_NULL_OUTPUT_STREAM, "localhost", "/", "", new Cookie[0], new Pair[0], null, new Pair[0], new StructImpl(),
f... | [
"public",
"static",
"void",
"addTagMetaData",
"(",
"ConfigWebImpl",
"cw",
",",
"lucee",
".",
"commons",
".",
"io",
".",
"log",
".",
"Log",
"log",
")",
"{",
"if",
"(",
"true",
")",
"return",
";",
"PageContextImpl",
"pc",
"=",
"null",
";",
"try",
"{",
... | load metadata from cfc based custom tags and add the info to the tag
@param cs
@param config | [
"load",
"metadata",
"from",
"cfc",
"based",
"custom",
"tags",
"and",
"add",
"the",
"info",
"to",
"the",
"tag"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/TagUtil.java#L257-L286 |
detro/ghostdriver | binding/java/src/main/java/org/openqa/selenium/phantomjs/PhantomJSDriver.java | PhantomJSDriver.executePhantomJS | public Object executePhantomJS(String script, Object... args) {
"""
Execute a PhantomJS fragment. Provides extra functionality not found in WebDriver
but available in PhantomJS.
<br>
See the <a href="http://phantomjs.org/api/">PhantomJS API</a>
for details on what is available.
<br>
The javascript this keyw... | java | public Object executePhantomJS(String script, Object... args) {
script = script.replaceAll("\"", "\\\"");
Iterable<Object> convertedArgs = Iterables.transform(
Lists.newArrayList(args), new WebElementToJsonConverter());
Map<String, ?> params = ImmutableMap.of(
"s... | [
"public",
"Object",
"executePhantomJS",
"(",
"String",
"script",
",",
"Object",
"...",
"args",
")",
"{",
"script",
"=",
"script",
".",
"replaceAll",
"(",
"\"\\\"\"",
",",
"\"\\\\\\\"\"",
")",
";",
"Iterable",
"<",
"Object",
">",
"convertedArgs",
"=",
"Iterab... | Execute a PhantomJS fragment. Provides extra functionality not found in WebDriver
but available in PhantomJS.
<br>
See the <a href="http://phantomjs.org/api/">PhantomJS API</a>
for details on what is available.
<br>
The javascript this keyword points to the currently selected page that is available for use.
If there i... | [
"Execute",
"a",
"PhantomJS",
"fragment",
".",
"Provides",
"extra",
"functionality",
"not",
"found",
"in",
"WebDriver",
"but",
"available",
"in",
"PhantomJS",
".",
"<br",
">",
"See",
"the",
"<a",
"href",
"=",
"http",
":",
"//",
"phantomjs",
".",
"org",
"/",... | train | https://github.com/detro/ghostdriver/blob/fe3063d52f47ec2781d43970452595c42f729ebf/binding/java/src/main/java/org/openqa/selenium/phantomjs/PhantomJSDriver.java#L164-L173 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ClassUtils.java | ClassUtils.getPublicMethod | @GwtIncompatible("incompatible method")
public static Method getPublicMethod(final Class<?> cls, final String methodName, final Class<?>... parameterTypes)
throws SecurityException, NoSuchMethodException {
"""
<p>Returns the desired Method much like {@code Class.getMethod}, however
it ensures that... | java | @GwtIncompatible("incompatible method")
public static Method getPublicMethod(final Class<?> cls, final String methodName, final Class<?>... parameterTypes)
throws SecurityException, NoSuchMethodException {
final Method declaredMethod = cls.getMethod(methodName, parameterTypes);
if (Modi... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"Method",
"getPublicMethod",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"String",
"methodName",
",",
"final",
"Class",
"<",
"?",
">",
"...",
"parameterTypes",
")",... | <p>Returns the desired Method much like {@code Class.getMethod}, however
it ensures that the returned Method is from a public class or interface and not
from an anonymous inner class. This means that the Method is invokable and
doesn't fall foul of Java bug
<a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=40... | [
"<p",
">",
"Returns",
"the",
"desired",
"Method",
"much",
"like",
"{",
"@code",
"Class",
".",
"getMethod",
"}",
"however",
"it",
"ensures",
"that",
"the",
"returned",
"Method",
"is",
"from",
"a",
"public",
"class",
"or",
"interface",
"and",
"not",
"from",
... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ClassUtils.java#L1100-L1130 |
w3c/epubcheck | src/main/java/com/adobe/epubcheck/vocab/VocabUtil.java | VocabUtil.parsePrefixDeclaration | public static Map<String, Vocab> parsePrefixDeclaration(String value,
Map<String, ? extends Vocab> predefined, Map<String, ? extends Vocab> known,
Set<String> forbidden, Report report, EPUBLocation location) {
"""
Parses a prefix attribute value and returns a map of prefixes to
vocabularies, given a p... | java | public static Map<String, Vocab> parsePrefixDeclaration(String value,
Map<String, ? extends Vocab> predefined, Map<String, ? extends Vocab> known,
Set<String> forbidden, Report report, EPUBLocation location)
{
Map<String, Vocab> vocabs = Maps.newHashMap(predefined);
Map<String, String> mappings = ... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Vocab",
">",
"parsePrefixDeclaration",
"(",
"String",
"value",
",",
"Map",
"<",
"String",
",",
"?",
"extends",
"Vocab",
">",
"predefined",
",",
"Map",
"<",
"String",
",",
"?",
"extends",
"Vocab",
">",
"know... | Parses a prefix attribute value and returns a map of prefixes to
vocabularies, given a pre-existing set of reserved prefixes, known
vocabularies, and default vocabularies that cannot be re-declared.
@param value
the prefix declaration to parse.
@param predefined
a map of reserved prefixes to associated vocabularies.
@... | [
"Parses",
"a",
"prefix",
"attribute",
"value",
"and",
"returns",
"a",
"map",
"of",
"prefixes",
"to",
"vocabularies",
"given",
"a",
"pre",
"-",
"existing",
"set",
"of",
"reserved",
"prefixes",
"known",
"vocabularies",
"and",
"default",
"vocabularies",
"that",
"... | train | https://github.com/w3c/epubcheck/blob/4d5a24d9f2878a2a5497eb11c036cc18fe2c0a78/src/main/java/com/adobe/epubcheck/vocab/VocabUtil.java#L174-L208 |
hal/elemento | core/src/main/java/org/jboss/gwt/elemento/core/Elements.java | Elements.failSafeRemoveFromParent | public static boolean failSafeRemoveFromParent(Element element) {
"""
Removes the element from its parent if the element is not null and has a parent.
@return {@code true} if the the element has been removed from its parent, {@code false} otherwise.
"""
return failSafeRemove(element != null ? elemen... | java | public static boolean failSafeRemoveFromParent(Element element) {
return failSafeRemove(element != null ? element.parentNode : null, element);
} | [
"public",
"static",
"boolean",
"failSafeRemoveFromParent",
"(",
"Element",
"element",
")",
"{",
"return",
"failSafeRemove",
"(",
"element",
"!=",
"null",
"?",
"element",
".",
"parentNode",
":",
"null",
",",
"element",
")",
";",
"}"
] | Removes the element from its parent if the element is not null and has a parent.
@return {@code true} if the the element has been removed from its parent, {@code false} otherwise. | [
"Removes",
"the",
"element",
"from",
"its",
"parent",
"if",
"the",
"element",
"is",
"not",
"null",
"and",
"has",
"a",
"parent",
"."
] | train | https://github.com/hal/elemento/blob/26da2d5a1fe2ec55b779737dbaeda25a942eee61/core/src/main/java/org/jboss/gwt/elemento/core/Elements.java#L718-L720 |
openbase/jul | extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MultiLanguageTextProcessor.java | MultiLanguageTextProcessor.getMultiLanguageTextByLanguage | public static String getMultiLanguageTextByLanguage(final String languageCode, final MultiLanguageTextOrBuilder multiLanguageText) throws NotAvailableException {
"""
Get the multiLanguageText for a languageCode in a multiLanguageText type. This is done by checking if the key matches the languageCode. If it matches... | java | public static String getMultiLanguageTextByLanguage(final String languageCode, final MultiLanguageTextOrBuilder multiLanguageText) throws NotAvailableException {
for (MultiLanguageText.MapFieldEntry entry : multiLanguageText.getEntryList()) {
if (entry.getKey().equalsIgnoreCase(languageCode)) {
... | [
"public",
"static",
"String",
"getMultiLanguageTextByLanguage",
"(",
"final",
"String",
"languageCode",
",",
"final",
"MultiLanguageTextOrBuilder",
"multiLanguageText",
")",
"throws",
"NotAvailableException",
"{",
"for",
"(",
"MultiLanguageText",
".",
"MapFieldEntry",
"entr... | Get the multiLanguageText for a languageCode in a multiLanguageText type. This is done by checking if the key matches the languageCode. If it matches the value list is
returned. Thus the returned list can be empty depending on the multiLanguageText.
@param languageCode the languageCode which is checked
@param multiLan... | [
"Get",
"the",
"multiLanguageText",
"for",
"a",
"languageCode",
"in",
"a",
"multiLanguageText",
"type",
".",
"This",
"is",
"done",
"by",
"checking",
"if",
"the",
"key",
"matches",
"the",
"languageCode",
".",
"If",
"it",
"matches",
"the",
"value",
"list",
"is"... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MultiLanguageTextProcessor.java#L259-L266 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_ovhConfig_id_changeConfiguration_POST | public OvhTask serviceName_ovhConfig_id_changeConfiguration_POST(String serviceName, Long id, OvhContainerEnum container, OvhEngineNameEnum engineName, OvhAvailableEngineVersionEnum engineVersion, OvhEnvironmentEnum environment, OvhHttpFirewallEnum httpFirewall) throws IOException {
"""
Apply a new configuration o... | java | public OvhTask serviceName_ovhConfig_id_changeConfiguration_POST(String serviceName, Long id, OvhContainerEnum container, OvhEngineNameEnum engineName, OvhAvailableEngineVersionEnum engineVersion, OvhEnvironmentEnum environment, OvhHttpFirewallEnum httpFirewall) throws IOException {
String qPath = "/hosting/web/{serv... | [
"public",
"OvhTask",
"serviceName_ovhConfig_id_changeConfiguration_POST",
"(",
"String",
"serviceName",
",",
"Long",
"id",
",",
"OvhContainerEnum",
"container",
",",
"OvhEngineNameEnum",
"engineName",
",",
"OvhAvailableEngineVersionEnum",
"engineVersion",
",",
"OvhEnvironmentEn... | Apply a new configuration on this path
REST: POST /hosting/web/{serviceName}/ovhConfig/{id}/changeConfiguration
@param container [required] Container to run this website
@param environment [required] Environment configuration you want
@param httpFirewall [required] Configuration you want for http firewall
@param engin... | [
"Apply",
"a",
"new",
"configuration",
"on",
"this",
"path"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L162-L173 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuStringUtil.java | GosuStringUtil.indexOfDifference | public static int indexOfDifference(String str1, String str2) {
"""
<p>Compares two Strings, and returns the index at which the
Strings begin to differ.</p>
<p>For example,
<code>indexOfDifference("i am a machine", "i am a robot") -> 7</code></p>
<pre>
GosuStringUtil.indexOfDifference(null, null) = -1
Go... | java | public static int indexOfDifference(String str1, String str2) {
if (str1 == str2) {
return -1;
}
if (str1 == null || str2 == null) {
return 0;
}
int i;
for (i = 0; i < str1.length() && i < str2.length(); ++i) {
if (str1.charAt(i) != str2.charAt(i)) {
... | [
"public",
"static",
"int",
"indexOfDifference",
"(",
"String",
"str1",
",",
"String",
"str2",
")",
"{",
"if",
"(",
"str1",
"==",
"str2",
")",
"{",
"return",
"-",
"1",
";",
"}",
"if",
"(",
"str1",
"==",
"null",
"||",
"str2",
"==",
"null",
")",
"{",
... | <p>Compares two Strings, and returns the index at which the
Strings begin to differ.</p>
<p>For example,
<code>indexOfDifference("i am a machine", "i am a robot") -> 7</code></p>
<pre>
GosuStringUtil.indexOfDifference(null, null) = -1
GosuStringUtil.indexOfDifference("", "") = -1
GosuStringUtil.indexOfDifference("", ... | [
"<p",
">",
"Compares",
"two",
"Strings",
"and",
"returns",
"the",
"index",
"at",
"which",
"the",
"Strings",
"begin",
"to",
"differ",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuStringUtil.java#L5451-L5468 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java | Bidi.fixN0c | private void fixN0c(BracketData bd, int openingIndex, int newPropPosition, byte newProp) {
"""
/* change N0c1 to N0c2 when a preceding bracket is assigned the embedding level
"""
/* This function calls itself recursively */
IsoRun pLastIsoRun = bd.isoRuns[bd.isoRunLast];
Opening qOpenin... | java | private void fixN0c(BracketData bd, int openingIndex, int newPropPosition, byte newProp) {
/* This function calls itself recursively */
IsoRun pLastIsoRun = bd.isoRuns[bd.isoRunLast];
Opening qOpening;
int k, openingPosition, closingPosition;
for (k = openingIndex+1; k < pLastIso... | [
"private",
"void",
"fixN0c",
"(",
"BracketData",
"bd",
",",
"int",
"openingIndex",
",",
"int",
"newPropPosition",
",",
"byte",
"newProp",
")",
"{",
"/* This function calls itself recursively */",
"IsoRun",
"pLastIsoRun",
"=",
"bd",
".",
"isoRuns",
"[",
"bd",
".",
... | /* change N0c1 to N0c2 when a preceding bracket is assigned the embedding level | [
"/",
"*",
"change",
"N0c1",
"to",
"N0c2",
"when",
"a",
"preceding",
"bracket",
"is",
"assigned",
"the",
"embedding",
"level"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java#L2097-L2120 |
inkstand-io/scribble | scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/util/XMLContentHandler.java | XMLContentHandler.endDocument | @Override
public void endDocument() throws SAXException {
"""
Persists the changes in the repository and prints out information such as processing time.
"""
LOG.info("Content Processing finished, saving...");
try {
this.session.save();
} catch (final RepositoryException... | java | @Override
public void endDocument() throws SAXException {
LOG.info("Content Processing finished, saving...");
try {
this.session.save();
} catch (final RepositoryException e) {
throw new AssertionError("Saving failed", e);
}
if (LOG.isInfoEnabled()) {... | [
"@",
"Override",
"public",
"void",
"endDocument",
"(",
")",
"throws",
"SAXException",
"{",
"LOG",
".",
"info",
"(",
"\"Content Processing finished, saving...\"",
")",
";",
"try",
"{",
"this",
".",
"session",
".",
"save",
"(",
")",
";",
"}",
"catch",
"(",
"... | Persists the changes in the repository and prints out information such as processing time. | [
"Persists",
"the",
"changes",
"in",
"the",
"repository",
"and",
"prints",
"out",
"information",
"such",
"as",
"processing",
"time",
"."
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/util/XMLContentHandler.java#L144-L157 |
RestComm/Restcomm-Connect | restcomm/restcomm.application/src/main/java/org/restcomm/connect/application/Bootstrapper.java | Bootstrapper.generateDefaultProfile | private void generateDefaultProfile(final DaoManager storage, final String profileSourcePath) throws SQLException, IOException {
"""
generateDefaultProfile if does not already exists
@throws SQLException
@throws IOException
"""
Profile profile = storage.getProfilesDao().getProfile(DEFAULT_PROFILE_SID... | java | private void generateDefaultProfile(final DaoManager storage, final String profileSourcePath) throws SQLException, IOException{
Profile profile = storage.getProfilesDao().getProfile(DEFAULT_PROFILE_SID);
if (profile == null) {
if(logger.isDebugEnabled()) {
logger.debug("defa... | [
"private",
"void",
"generateDefaultProfile",
"(",
"final",
"DaoManager",
"storage",
",",
"final",
"String",
"profileSourcePath",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"Profile",
"profile",
"=",
"storage",
".",
"getProfilesDao",
"(",
")",
".",
"ge... | generateDefaultProfile if does not already exists
@throws SQLException
@throws IOException | [
"generateDefaultProfile",
"if",
"does",
"not",
"already",
"exists"
] | train | https://github.com/RestComm/Restcomm-Connect/blob/2194dee4fc524cdfd0af77a218ba5f212f97f7c5/restcomm/restcomm.application/src/main/java/org/restcomm/connect/application/Bootstrapper.java#L323-L338 |
Tourenathan-G5organisation/SiliCompressor | silicompressor/src/main/java/com/iceteck/silicompressorr/SiliCompressor.java | SiliCompressor.compressVideo | public String compressVideo(String videoFilePath, String destinationDir, int outWidth, int outHeight, int bitrate) throws URISyntaxException {
"""
Perform background video compression. Make sure the videofileUri and destinationUri are valid
resources because this method does not account for missing directories he... | java | public String compressVideo(String videoFilePath, String destinationDir, int outWidth, int outHeight, int bitrate) throws URISyntaxException {
boolean isconverted = MediaController.getInstance().convertVideo(videoFilePath, new File(destinationDir), outWidth, outHeight, bitrate);
if (isconverted) {
... | [
"public",
"String",
"compressVideo",
"(",
"String",
"videoFilePath",
",",
"String",
"destinationDir",
",",
"int",
"outWidth",
",",
"int",
"outHeight",
",",
"int",
"bitrate",
")",
"throws",
"URISyntaxException",
"{",
"boolean",
"isconverted",
"=",
"MediaController",
... | Perform background video compression. Make sure the videofileUri and destinationUri are valid
resources because this method does not account for missing directories hence your converted file
could be in an unknown location
@param videoFilePath source path for the video file
@param destinationDir destination directory... | [
"Perform",
"background",
"video",
"compression",
".",
"Make",
"sure",
"the",
"videofileUri",
"and",
"destinationUri",
"are",
"valid",
"resources",
"because",
"this",
"method",
"does",
"not",
"account",
"for",
"missing",
"directories",
"hence",
"your",
"converted",
... | train | https://github.com/Tourenathan-G5organisation/SiliCompressor/blob/546f6cd7b2a7a783e1122df46c1e237f8938fe72/silicompressor/src/main/java/com/iceteck/silicompressorr/SiliCompressor.java#L332-L342 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.getFlowLogStatusAsync | public Observable<FlowLogInformationInner> getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) {
"""
Queries status of flow log on a specified resource.
@param resourceGroupName The name of the network watcher resource group.
@param networkWatcherName The name of... | java | public Observable<FlowLogInformationInner> getFlowLogStatusAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) {
return getFlowLogStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1<ServiceResponse<FlowLogInformationInner>, FlowLo... | [
"public",
"Observable",
"<",
"FlowLogInformationInner",
">",
"getFlowLogStatusAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"targetResourceId",
")",
"{",
"return",
"getFlowLogStatusWithServiceResponseAsync",
"(",
"resourceGrou... | Queries status of flow log on a specified resource.
@param resourceGroupName The name of the network watcher resource group.
@param networkWatcherName The name of the network watcher resource.
@param targetResourceId The target resource where getting the flow logging status.
@throws IllegalArgumentException thrown if ... | [
"Queries",
"status",
"of",
"flow",
"log",
"on",
"a",
"specified",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L1997-L2004 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/JodaBeanSer.java | JodaBeanSer.withShortTypes | public JodaBeanSer withShortTypes(boolean shortTypes) {
"""
Returns a copy of this serializer with the short types flag set.
@param shortTypes whether to use short types, not null
@return a copy of this object with the short types flag changed, not null
"""
return new JodaBeanSer(indent, newLine, ... | java | public JodaBeanSer withShortTypes(boolean shortTypes) {
return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived);
} | [
"public",
"JodaBeanSer",
"withShortTypes",
"(",
"boolean",
"shortTypes",
")",
"{",
"return",
"new",
"JodaBeanSer",
"(",
"indent",
",",
"newLine",
",",
"converter",
",",
"iteratorFactory",
",",
"shortTypes",
",",
"deserializers",
",",
"includeDerived",
")",
";",
... | Returns a copy of this serializer with the short types flag set.
@param shortTypes whether to use short types, not null
@return a copy of this object with the short types flag changed, not null | [
"Returns",
"a",
"copy",
"of",
"this",
"serializer",
"with",
"the",
"short",
"types",
"flag",
"set",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/JodaBeanSer.java#L201-L203 |
realtime-framework/RealtimeStorage-Android | library/src/main/java/co/realtime/storage/ItemRef.java | ItemRef.disablePushNotifications | public ItemRef disablePushNotifications() {
"""
Disables mobile push notifications for current item reference.
@return Current item reference
"""
pushNotificationsEnabled = false;
Event ev = new Event(null, this.table.name, this.primaryKeyValue, this.secondaryKeyValue, false, false, pushNotifica... | java | public ItemRef disablePushNotifications(){
pushNotificationsEnabled = false;
Event ev = new Event(null, this.table.name, this.primaryKeyValue, this.secondaryKeyValue, false, false, pushNotificationsEnabled, null);
ArrayList<String> channels = new ArrayList<String>();
channels.add(ev.getChannelName(... | [
"public",
"ItemRef",
"disablePushNotifications",
"(",
")",
"{",
"pushNotificationsEnabled",
"=",
"false",
";",
"Event",
"ev",
"=",
"new",
"Event",
"(",
"null",
",",
"this",
".",
"table",
".",
"name",
",",
"this",
".",
"primaryKeyValue",
",",
"this",
".",
"... | Disables mobile push notifications for current item reference.
@return Current item reference | [
"Disables",
"mobile",
"push",
"notifications",
"for",
"current",
"item",
"reference",
"."
] | train | https://github.com/realtime-framework/RealtimeStorage-Android/blob/05816a6b7a6dcc83f9e7400ac3048494dadca302/library/src/main/java/co/realtime/storage/ItemRef.java#L685-L693 |
apereo/cas | core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/TicketGrantingTicketImpl.java | TicketGrantingTicketImpl.trackServiceSession | protected void trackServiceSession(final String id, final Service service, final boolean onlyTrackMostRecentSession) {
"""
Update service and track session.
@param id the id
@param service the service
@param onlyTrackMostRecentSession the only track most recent sessi... | java | protected void trackServiceSession(final String id, final Service service, final boolean onlyTrackMostRecentSession) {
update();
service.setPrincipal(getRoot().getAuthentication().getPrincipal().getId());
if (onlyTrackMostRecentSession) {
val path = normalizePath(service);
... | [
"protected",
"void",
"trackServiceSession",
"(",
"final",
"String",
"id",
",",
"final",
"Service",
"service",
",",
"final",
"boolean",
"onlyTrackMostRecentSession",
")",
"{",
"update",
"(",
")",
";",
"service",
".",
"setPrincipal",
"(",
"getRoot",
"(",
")",
".... | Update service and track session.
@param id the id
@param service the service
@param onlyTrackMostRecentSession the only track most recent session | [
"Update",
"service",
"and",
"track",
"session",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/TicketGrantingTicketImpl.java#L166-L175 |
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/JSONValue.java | JSONValue.writeJSONString | public static void writeJSONString(Object value, Appendable out) throws IOException {
"""
Encode an object into JSON text and write it to out.
<p>
If this object is a Map or a List, and it's also a JSONStreamAware or a
JSONAware, JSONStreamAware or JSONAware will be considered firstly.
<p>
@see JSONObject#w... | java | public static void writeJSONString(Object value, Appendable out) throws IOException {
writeJSONString(value, out, COMPRESSION);
} | [
"public",
"static",
"void",
"writeJSONString",
"(",
"Object",
"value",
",",
"Appendable",
"out",
")",
"throws",
"IOException",
"{",
"writeJSONString",
"(",
"value",
",",
"out",
",",
"COMPRESSION",
")",
";",
"}"
] | Encode an object into JSON text and write it to out.
<p>
If this object is a Map or a List, and it's also a JSONStreamAware or a
JSONAware, JSONStreamAware or JSONAware will be considered firstly.
<p>
@see JSONObject#writeJSON(Map, Appendable)
@see JSONArray#writeJSONString(List, Appendable) | [
"Encode",
"an",
"object",
"into",
"JSON",
"text",
"and",
"write",
"it",
"to",
"out",
".",
"<p",
">",
"If",
"this",
"object",
"is",
"a",
"Map",
"or",
"a",
"List",
"and",
"it",
"s",
"also",
"a",
"JSONStreamAware",
"or",
"a",
"JSONAware",
"JSONStreamAware... | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/JSONValue.java#L520-L522 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_tcp_farm_farmId_server_POST | public OvhBackendTCPServer serviceName_tcp_farm_farmId_server_POST(String serviceName, Long farmId, String address, Boolean backup, String chain, String displayName, Long port, Boolean probe, OvhProxyProtocolVersionEnum proxyProtocolVersion, Boolean ssl, OvhBackendCustomerServerStatusEnum status, Long weight) throws IO... | java | public OvhBackendTCPServer serviceName_tcp_farm_farmId_server_POST(String serviceName, Long farmId, String address, Boolean backup, String chain, String displayName, Long port, Boolean probe, OvhProxyProtocolVersionEnum proxyProtocolVersion, Boolean ssl, OvhBackendCustomerServerStatusEnum status, Long weight) throws IO... | [
"public",
"OvhBackendTCPServer",
"serviceName_tcp_farm_farmId_server_POST",
"(",
"String",
"serviceName",
",",
"Long",
"farmId",
",",
"String",
"address",
",",
"Boolean",
"backup",
",",
"String",
"chain",
",",
"String",
"displayName",
",",
"Long",
"port",
",",
"Bool... | Add a server to a TCP Farm
REST: POST /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}/server
@param probe [required] Enable/disable probe. Default: 'false'
@param status [required] Enable or disable your server
@param ssl [required] SSL ciphering. Probes will also be sent ciphered. Default: 'false'
@param proxyProtoc... | [
"Add",
"a",
"server",
"to",
"a",
"TCP",
"Farm"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1682-L1698 |
googleapis/google-api-java-client | google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/GoogleAtom.java | GoogleAtom.getFeedFields | public static String getFeedFields(Class<?> feedClass, Class<?> entryClass) {
"""
Returns the fields mask to use for the given data class of key/value pairs for the feed class
and for the entry class. This should only be used if the feed class does not contain the entry
class as a field. The data classes cannot ... | java | public static String getFeedFields(Class<?> feedClass, Class<?> entryClass) {
StringBuilder fieldsBuf = new StringBuilder();
appendFeedFields(fieldsBuf, feedClass, entryClass);
return fieldsBuf.toString();
} | [
"public",
"static",
"String",
"getFeedFields",
"(",
"Class",
"<",
"?",
">",
"feedClass",
",",
"Class",
"<",
"?",
">",
"entryClass",
")",
"{",
"StringBuilder",
"fieldsBuf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"appendFeedFields",
"(",
"fieldsBuf",
",",... | Returns the fields mask to use for the given data class of key/value pairs for the feed class
and for the entry class. This should only be used if the feed class does not contain the entry
class as a field. The data classes cannot be a {@link Map}, {@link GenericData} or a
{@link Collection}.
@param feedClass feed dat... | [
"Returns",
"the",
"fields",
"mask",
"to",
"use",
"for",
"the",
"given",
"data",
"class",
"of",
"key",
"/",
"value",
"pairs",
"for",
"the",
"feed",
"class",
"and",
"for",
"the",
"entry",
"class",
".",
"This",
"should",
"only",
"be",
"used",
"if",
"the",... | train | https://github.com/googleapis/google-api-java-client/blob/88decfd14fc40cae6eb6729a45c7d56a1132e450/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/GoogleAtom.java#L77-L81 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/PublishingScopeUrl.java | PublishingScopeUrl.deletePublishSetUrl | public static MozuUrl deletePublishSetUrl(Boolean discardDrafts, String publishSetCode) {
"""
Get Resource Url for DeletePublishSet
@param discardDrafts Specifies whether to discard all the drafts assigned to the publish set when the publish set is deleted.
@param publishSetCode The unique identifier of the publ... | java | public static MozuUrl deletePublishSetUrl(Boolean discardDrafts, String publishSetCode)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/publishing/publishsets/{publishSetCode}?discardDrafts={discardDrafts}");
formatter.formatUrl("discardDrafts", discardDrafts);
formatter.formatUrl("p... | [
"public",
"static",
"MozuUrl",
"deletePublishSetUrl",
"(",
"Boolean",
"discardDrafts",
",",
"String",
"publishSetCode",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/publishing/publishsets/{publishSetCode}?discardDrafts={di... | Get Resource Url for DeletePublishSet
@param discardDrafts Specifies whether to discard all the drafts assigned to the publish set when the publish set is deleted.
@param publishSetCode The unique identifier of the publish set.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeletePublishSet"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/PublishingScopeUrl.java#L80-L86 |
GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/GoogleCloudStorageMergeInput.java | GoogleCloudStorageMergeInput.createReaderForShard | private MergingReader<ByteBuffer, ByteBuffer> createReaderForShard(
Marshaller<KeyValue<ByteBuffer, ? extends Iterable<ByteBuffer>>> marshaller,
GoogleCloudStorageFileSet inputFileSet) {
"""
Create a {@link MergingReader} that combines all the input files and maintain sort order.
(There are multiple... | java | private MergingReader<ByteBuffer, ByteBuffer> createReaderForShard(
Marshaller<KeyValue<ByteBuffer, ? extends Iterable<ByteBuffer>>> marshaller,
GoogleCloudStorageFileSet inputFileSet) {
ArrayList<PeekingInputReader<KeyValue<ByteBuffer, ? extends Iterable<ByteBuffer>>>> inputFiles =
new ArrayLis... | [
"private",
"MergingReader",
"<",
"ByteBuffer",
",",
"ByteBuffer",
">",
"createReaderForShard",
"(",
"Marshaller",
"<",
"KeyValue",
"<",
"ByteBuffer",
",",
"?",
"extends",
"Iterable",
"<",
"ByteBuffer",
">",
">",
">",
"marshaller",
",",
"GoogleCloudStorageFileSet",
... | Create a {@link MergingReader} that combines all the input files and maintain sort order.
(There are multiple input files in the event that the data didn't fit into the sorter's
memory)
A {@link MergingReader} is used to combine contents while maintaining key-order. This requires
a {@link PeekingInputReader}s to prev... | [
"Create",
"a",
"{",
"@link",
"MergingReader",
"}",
"that",
"combines",
"all",
"the",
"input",
"files",
"and",
"maintain",
"sort",
"order",
"."
] | train | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/GoogleCloudStorageMergeInput.java#L81-L92 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/ProxyReceiveListener.java | ProxyReceiveListener.processSchema | private void processSchema(CommsByteBuffer buffer, Conversation conversation) {
"""
This method will process a schema received from our peer's MFP compoennt.
At the moment this consists of contacting MFP here on the client and
giving it the schema. Schemas are received when the ME is about to send
us a message ... | java | private void processSchema(CommsByteBuffer buffer, Conversation conversation)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "processSchema",
new Object[]
{
... | [
"private",
"void",
"processSchema",
"(",
"CommsByteBuffer",
"buffer",
",",
"Conversation",
"conversation",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"("... | This method will process a schema received from our peer's MFP compoennt.
At the moment this consists of contacting MFP here on the client and
giving it the schema. Schemas are received when the ME is about to send
us a message and realises that we don't have the necessary schema to decode
it. A High priority message i... | [
"This",
"method",
"will",
"process",
"a",
"schema",
"received",
"from",
"our",
"peer",
"s",
"MFP",
"compoennt",
".",
"At",
"the",
"moment",
"this",
"consists",
"of",
"contacting",
"MFP",
"here",
"on",
"the",
"client",
"and",
"giving",
"it",
"the",
"schema"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/ProxyReceiveListener.java#L600-L636 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.setDefaultSipDomain_POST | public void setDefaultSipDomain_POST(OvhNumberCountryEnum country, String domain, OvhSipDomainProductTypeEnum type) throws IOException {
"""
Get all available SIP domains by country
REST: POST /telephony/setDefaultSipDomain
@param domain [required] SIP domain to set
@param type [required] Product type
@param... | java | public void setDefaultSipDomain_POST(OvhNumberCountryEnum country, String domain, OvhSipDomainProductTypeEnum type) throws IOException {
String qPath = "/telephony/setDefaultSipDomain";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "country", country);
ad... | [
"public",
"void",
"setDefaultSipDomain_POST",
"(",
"OvhNumberCountryEnum",
"country",
",",
"String",
"domain",
",",
"OvhSipDomainProductTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/setDefaultSipDomain\"",
";",
"StringBuilder",
... | Get all available SIP domains by country
REST: POST /telephony/setDefaultSipDomain
@param domain [required] SIP domain to set
@param type [required] Product type
@param country [required] Country | [
"Get",
"all",
"available",
"SIP",
"domains",
"by",
"country"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8968-L8976 |
OpenTSDB/opentsdb | src/tsd/GraphHandler.java | GraphHandler.runGnuplot | static int runGnuplot(final HttpQuery query,
final String basepath,
final Plot plot) throws IOException {
"""
Runs Gnuplot in a subprocess to generate the graph.
<strong>This function will block</strong> while Gnuplot is running.
@param query The query being handle... | java | static int runGnuplot(final HttpQuery query,
final String basepath,
final Plot plot) throws IOException {
final int nplotted = plot.dumpToFiles(basepath);
final long start_time = System.nanoTime();
final Process gnuplot = new ProcessBuilder(GNUPLOT,
base... | [
"static",
"int",
"runGnuplot",
"(",
"final",
"HttpQuery",
"query",
",",
"final",
"String",
"basepath",
",",
"final",
"Plot",
"plot",
")",
"throws",
"IOException",
"{",
"final",
"int",
"nplotted",
"=",
"plot",
".",
"dumpToFiles",
"(",
"basepath",
")",
";",
... | Runs Gnuplot in a subprocess to generate the graph.
<strong>This function will block</strong> while Gnuplot is running.
@param query The query being handled (for logging purposes).
@param basepath The base path used for the Gnuplot files.
@param plot The plot object to generate Gnuplot's input files.
@return The number... | [
"Runs",
"Gnuplot",
"in",
"a",
"subprocess",
"to",
"generate",
"the",
"graph",
".",
"<strong",
">",
"This",
"function",
"will",
"block<",
"/",
"strong",
">",
"while",
"Gnuplot",
"is",
"running",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/GraphHandler.java#L780-L818 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/ValueMap.java | ValueMap.coerceToValueMap | private <T extends ValueMap> T coerceToValueMap(Object object, Class<T> clazz) {
"""
Coerce an object to a JsonMap. It will first check if the object is already of the expected
type. If not, it checks if the object a {@link Map} type, and feeds it to the constructor by
reflection.
"""
if (object == null)... | java | private <T extends ValueMap> T coerceToValueMap(Object object, Class<T> clazz) {
if (object == null) return null;
if (clazz.isAssignableFrom(object.getClass())) {
//noinspection unchecked
return (T) object;
}
if (object instanceof Map) return createValueMap((Map) object, clazz);
return n... | [
"private",
"<",
"T",
"extends",
"ValueMap",
">",
"T",
"coerceToValueMap",
"(",
"Object",
"object",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"clazz",
".",
"isAssignableFrom... | Coerce an object to a JsonMap. It will first check if the object is already of the expected
type. If not, it checks if the object a {@link Map} type, and feeds it to the constructor by
reflection. | [
"Coerce",
"an",
"object",
"to",
"a",
"JsonMap",
".",
"It",
"will",
"first",
"check",
"if",
"the",
"object",
"is",
"already",
"of",
"the",
"expected",
"type",
".",
"If",
"not",
"it",
"checks",
"if",
"the",
"object",
"a",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/ValueMap.java#L337-L345 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.getViewOnRecyclerItemIndex | private View getViewOnRecyclerItemIndex(ViewGroup recyclerView, int recyclerViewIndex, int itemIndex) {
"""
Returns the view in the specified item index
@param recyclerView the RecyclerView to use
@param itemIndex the item index of the View
@return the View located at a specified item index
"""
final lo... | java | private View getViewOnRecyclerItemIndex(ViewGroup recyclerView, int recyclerViewIndex, int itemIndex){
final long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();
View view = recyclerView.getChildAt(itemIndex);
while(view == null){
final boolean timedOut = SystemClock.uptimeMillis() > endTime... | [
"private",
"View",
"getViewOnRecyclerItemIndex",
"(",
"ViewGroup",
"recyclerView",
",",
"int",
"recyclerViewIndex",
",",
"int",
"itemIndex",
")",
"{",
"final",
"long",
"endTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
"+",
"Timeout",
".",
"getSmallTime... | Returns the view in the specified item index
@param recyclerView the RecyclerView to use
@param itemIndex the item index of the View
@return the View located at a specified item index | [
"Returns",
"the",
"view",
"in",
"the",
"specified",
"item",
"index"
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L689-L711 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/thread/MainThread.java | MainThread.runOnMainThreadAtTime | public boolean runOnMainThreadAtTime(Runnable r, long uptimeMillis) {
"""
Queues a Runnable to be run on the main thread at the time specified by
{@code uptimeMillis}. The time base is {@link SystemClock#uptimeMillis()
uptimeMillis()} . A pause in application execution may add an additional
delay.
@param r
... | java | public boolean runOnMainThreadAtTime(Runnable r, long uptimeMillis) {
assert handler != null;
if (!sanityCheck("runOnMainThreadAtTime " + r)) {
return false;
}
return handler.postAtTime(r, uptimeMillis);
} | [
"public",
"boolean",
"runOnMainThreadAtTime",
"(",
"Runnable",
"r",
",",
"long",
"uptimeMillis",
")",
"{",
"assert",
"handler",
"!=",
"null",
";",
"if",
"(",
"!",
"sanityCheck",
"(",
"\"runOnMainThreadAtTime \"",
"+",
"r",
")",
")",
"{",
"return",
"false",
"... | Queues a Runnable to be run on the main thread at the time specified by
{@code uptimeMillis}. The time base is {@link SystemClock#uptimeMillis()
uptimeMillis()} . A pause in application execution may add an additional
delay.
@param r
The Runnable to run on the main thread.
@param uptimeMillis
The absolute time at whic... | [
"Queues",
"a",
"Runnable",
"to",
"be",
"run",
"on",
"the",
"main",
"thread",
"at",
"the",
"time",
"specified",
"by",
"{",
"@code",
"uptimeMillis",
"}",
".",
"The",
"time",
"base",
"is",
"{",
"@link",
"SystemClock#uptimeMillis",
"()",
"uptimeMillis",
"()",
... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/thread/MainThread.java#L146-L153 |
ocelotds/ocelot | ocelot-dashboard/src/main/java/org/ocelotds/dashboard/services/ServiceTools.java | ServiceTools._getTemplateOfType | String _getTemplateOfType(Type type, IJsonMarshaller jsonMarshaller) {
"""
Get template for unknown type (class or parameterizedType)
@param type
@param jsonUnmarshaller
@return
"""
if (ParameterizedType.class.isAssignableFrom(type.getClass())) {
return getTemplateOfParameterizedType((Parameterized... | java | String _getTemplateOfType(Type type, IJsonMarshaller jsonMarshaller) {
if (ParameterizedType.class.isAssignableFrom(type.getClass())) {
return getTemplateOfParameterizedType((ParameterizedType) type, jsonMarshaller);
}
try {
return jsonMarshaller.toJson(getInstanceOfClass((Class) type));
} catch (Js... | [
"String",
"_getTemplateOfType",
"(",
"Type",
"type",
",",
"IJsonMarshaller",
"jsonMarshaller",
")",
"{",
"if",
"(",
"ParameterizedType",
".",
"class",
".",
"isAssignableFrom",
"(",
"type",
".",
"getClass",
"(",
")",
")",
")",
"{",
"return",
"getTemplateOfParamet... | Get template for unknown type (class or parameterizedType)
@param type
@param jsonUnmarshaller
@return | [
"Get",
"template",
"for",
"unknown",
"type",
"(",
"class",
"or",
"parameterizedType",
")"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-dashboard/src/main/java/org/ocelotds/dashboard/services/ServiceTools.java#L167-L176 |
greese/dasein-util | src/main/java/org/dasein/attributes/types/BooleanFactory.java | BooleanFactory.getType | public DataType<Boolean> getType(String grp, Number idx, boolean ml, boolean mv, boolean req, String... params) {
"""
Technically, you can have a multi-lingual or multi-valued boolean, but why would you?
@param ml true if the boolean is multi-lingual
@param mv true if the boolean can support multiple values
@pa... | java | public DataType<Boolean> getType(String grp, Number idx, boolean ml, boolean mv, boolean req, String... params) {
return new BooleanAttribute(grp, idx, ml, mv, req);
} | [
"public",
"DataType",
"<",
"Boolean",
">",
"getType",
"(",
"String",
"grp",
",",
"Number",
"idx",
",",
"boolean",
"ml",
",",
"boolean",
"mv",
",",
"boolean",
"req",
",",
"String",
"...",
"params",
")",
"{",
"return",
"new",
"BooleanAttribute",
"(",
"grp"... | Technically, you can have a multi-lingual or multi-valued boolean, but why would you?
@param ml true if the boolean is multi-lingual
@param mv true if the boolean can support multiple values
@param req true if the boolean is required
@param params unused
@return a boolean instance | [
"Technically",
"you",
"can",
"have",
"a",
"multi",
"-",
"lingual",
"or",
"multi",
"-",
"valued",
"boolean",
"but",
"why",
"would",
"you?"
] | train | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/attributes/types/BooleanFactory.java#L94-L96 |
Netflix/karyon | karyon2-governator/src/main/java/netflix/karyon/Karyon.java | Karyon.forTcpServer | public static KaryonServer forTcpServer(RxServer<?, ?> server, Module... modules) {
"""
Creates a new {@link KaryonServer} which combines lifecycle of the passed {@link RxServer} with
it's own lifecycle.
@param server TCP server
@param modules Additional modules if any.
@return {@link KaryonServer} which i... | java | public static KaryonServer forTcpServer(RxServer<?, ?> server, Module... modules) {
return forTcpServer(server, toBootstrapModule(modules));
} | [
"public",
"static",
"KaryonServer",
"forTcpServer",
"(",
"RxServer",
"<",
"?",
",",
"?",
">",
"server",
",",
"Module",
"...",
"modules",
")",
"{",
"return",
"forTcpServer",
"(",
"server",
",",
"toBootstrapModule",
"(",
"modules",
")",
")",
";",
"}"
] | Creates a new {@link KaryonServer} which combines lifecycle of the passed {@link RxServer} with
it's own lifecycle.
@param server TCP server
@param modules Additional modules if any.
@return {@link KaryonServer} which is to be used to start the created server. | [
"Creates",
"a",
"new",
"{",
"@link",
"KaryonServer",
"}",
"which",
"combines",
"lifecycle",
"of",
"the",
"passed",
"{",
"@link",
"RxServer",
"}",
"with",
"it",
"s",
"own",
"lifecycle",
"."
] | train | https://github.com/Netflix/karyon/blob/d50bc0ff37693ef3fbda373e90a109d1f92e0b9a/karyon2-governator/src/main/java/netflix/karyon/Karyon.java#L151-L153 |
JOML-CI/JOML | src/org/joml/Matrix3x2d.java | Matrix3x2d.scaleAround | public Matrix3x2d scaleAround(double factor, double ox, double oy, Matrix3x2d dest) {
"""
Apply scaling to this matrix by scaling the base axes by the given <code>factor</code>
while using <code>(ox, oy)</code> as the scaling origin,
and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>thi... | java | public Matrix3x2d scaleAround(double factor, double ox, double oy, Matrix3x2d dest) {
return scaleAround(factor, factor, ox, oy, this);
} | [
"public",
"Matrix3x2d",
"scaleAround",
"(",
"double",
"factor",
",",
"double",
"ox",
",",
"double",
"oy",
",",
"Matrix3x2d",
"dest",
")",
"{",
"return",
"scaleAround",
"(",
"factor",
",",
"factor",
",",
"ox",
",",
"oy",
",",
"this",
")",
";",
"}"
] | Apply scaling to this matrix by scaling the base axes by the given <code>factor</code>
while using <code>(ox, oy)</code> as the scaling origin,
and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
then the new matrix will be <code>M * S</cod... | [
"Apply",
"scaling",
"to",
"this",
"matrix",
"by",
"scaling",
"the",
"base",
"axes",
"by",
"the",
"given",
"<code",
">",
"factor<",
"/",
"code",
">",
"while",
"using",
"<code",
">",
"(",
"ox",
"oy",
")",
"<",
"/",
"code",
">",
"as",
"the",
"scaling",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2d.java#L1490-L1492 |
liuyukuai/commons | commons-core/src/main/java/com/itxiaoer/commons/core/date/LocalDateUtil.java | LocalDateUtil.untilDays | public static List<LocalDate> untilDays(String startDate, String endDate) {
"""
计算两个时间内的日期
@param startDate 开始时间
@param endDate 结束时间
@return 日期集合
"""
return untilDays(parse(startDate, DEFAULT_PATTERN), parse(endDate, DEFAULT_PATTERN));
} | java | public static List<LocalDate> untilDays(String startDate, String endDate) {
return untilDays(parse(startDate, DEFAULT_PATTERN), parse(endDate, DEFAULT_PATTERN));
} | [
"public",
"static",
"List",
"<",
"LocalDate",
">",
"untilDays",
"(",
"String",
"startDate",
",",
"String",
"endDate",
")",
"{",
"return",
"untilDays",
"(",
"parse",
"(",
"startDate",
",",
"DEFAULT_PATTERN",
")",
",",
"parse",
"(",
"endDate",
",",
"DEFAULT_PA... | 计算两个时间内的日期
@param startDate 开始时间
@param endDate 结束时间
@return 日期集合 | [
"计算两个时间内的日期"
] | train | https://github.com/liuyukuai/commons/blob/ba67eddb542446b12f419f1866dbaa82e47fbf35/commons-core/src/main/java/com/itxiaoer/commons/core/date/LocalDateUtil.java#L130-L132 |
OpenLiberty/open-liberty | dev/com.ibm.ws.classloading.bells/src/com/ibm/ws/classloading/bells/internal/Bell.java | Bell.update | void update() {
"""
Configures this bell with a specific library and a possible set of service names
@param context the bundle context
@param executor the executor service
@param config the configuration settings
"""
final BundleContext context = componentContext.getBundleContext();
// ... | java | void update() {
final BundleContext context = componentContext.getBundleContext();
// determine the service filter to use for discovering the Library service this bell is for
String libraryRef = library.id();
// it is unclear if only looking at the id would work here.
// other ex... | [
"void",
"update",
"(",
")",
"{",
"final",
"BundleContext",
"context",
"=",
"componentContext",
".",
"getBundleContext",
"(",
")",
";",
"// determine the service filter to use for discovering the Library service this bell is for",
"String",
"libraryRef",
"=",
"library",
".",
... | Configures this bell with a specific library and a possible set of service names
@param context the bundle context
@param executor the executor service
@param config the configuration settings | [
"Configures",
"this",
"bell",
"with",
"a",
"specific",
"library",
"and",
"a",
"possible",
"set",
"of",
"service",
"names"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading.bells/src/com/ibm/ws/classloading/bells/internal/Bell.java#L137-L195 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java | EnglishEnums.valueOf | public static <T extends Enum<T>> T valueOf(final Class<T> enumType, final String name, final T defaultValue) {
"""
Returns an enum value for the given string.
<p>
The {@code name} is converted internally to upper case with the {@linkplain Locale#ENGLISH ENGLISH} locale to
avoid problems on the Turkish locale. ... | java | public static <T extends Enum<T>> T valueOf(final Class<T> enumType, final String name, final T defaultValue) {
return name == null ? defaultValue : Enum.valueOf(enumType, name.toUpperCase(Locale.ENGLISH));
} | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"valueOf",
"(",
"final",
"Class",
"<",
"T",
">",
"enumType",
",",
"final",
"String",
"name",
",",
"final",
"T",
"defaultValue",
")",
"{",
"return",
"name",
"==",
"null",
"?",
... | Returns an enum value for the given string.
<p>
The {@code name} is converted internally to upper case with the {@linkplain Locale#ENGLISH ENGLISH} locale to
avoid problems on the Turkish locale. Do not use with Turkish enum values.
</p>
@param name The enum name, case-insensitive. If null, returns {@code defaultValue... | [
"Returns",
"an",
"enum",
"value",
"for",
"the",
"given",
"string",
".",
"<p",
">",
"The",
"{",
"@code",
"name",
"}",
"is",
"converted",
"internally",
"to",
"upper",
"case",
"with",
"the",
"{",
"@linkplain",
"Locale#ENGLISH",
"ENGLISH",
"}",
"locale",
"to",... | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java#L66-L68 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java | FaceletViewDeclarationLanguage.getComponentMetadata | @Override
public BeanInfo getComponentMetadata(FacesContext context, Resource componentResource) {
"""
retargetMethodExpressions(FacesContext, UIComponent) has some clues about the behavior of this method
{@inheritDoc}
"""
BeanInfo beanInfo = null;
checkNull(context, "context");
... | java | @Override
public BeanInfo getComponentMetadata(FacesContext context, Resource componentResource)
{
BeanInfo beanInfo = null;
checkNull(context, "context");
try
{
Facelet compositeComponentFacelet;
FaceletFactory.setInstance(_faceletFactory);
... | [
"@",
"Override",
"public",
"BeanInfo",
"getComponentMetadata",
"(",
"FacesContext",
"context",
",",
"Resource",
"componentResource",
")",
"{",
"BeanInfo",
"beanInfo",
"=",
"null",
";",
"checkNull",
"(",
"context",
",",
"\"context\"",
")",
";",
"try",
"{",
"Facel... | retargetMethodExpressions(FacesContext, UIComponent) has some clues about the behavior of this method
{@inheritDoc} | [
"retargetMethodExpressions",
"(",
"FacesContext",
"UIComponent",
")",
"has",
"some",
"clues",
"about",
"the",
"behavior",
"of",
"this",
"method"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java#L729-L797 |
osglworks/java-tool | src/main/java/org/osgl/Lang.java | F3.andThen | public <T> Func3<P1, P2, P3, T> andThen(final Function<? super R, ? extends T> f) {
"""
Returns a composed function from this function and the specified function that takes the
result of this function. When applying the composed function, this function is applied
first to given parameter and then the specified f... | java | public <T> Func3<P1, P2, P3, T> andThen(final Function<? super R, ? extends T> f) {
E.NPE(f);
final Func3<P1, P2, P3, R> me = this;
return new F3<P1, P2, P3, T>() {
@Override
public T apply(P1 p1, P2 p2, P3 p3) {
R r = me.apply(p1, ... | [
"public",
"<",
"T",
">",
"Func3",
"<",
"P1",
",",
"P2",
",",
"P3",
",",
"T",
">",
"andThen",
"(",
"final",
"Function",
"<",
"?",
"super",
"R",
",",
"?",
"extends",
"T",
">",
"f",
")",
"{",
"E",
".",
"NPE",
"(",
"f",
")",
";",
"final",
"Func... | Returns a composed function from this function and the specified function that takes the
result of this function. When applying the composed function, this function is applied
first to given parameter and then the specified function is applied to the result of
this function.
@param f
the function takes the <code>R</co... | [
"Returns",
"a",
"composed",
"function",
"from",
"this",
"function",
"and",
"the",
"specified",
"function",
"that",
"takes",
"the",
"result",
"of",
"this",
"function",
".",
"When",
"applying",
"the",
"composed",
"function",
"this",
"function",
"is",
"applied",
... | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L1255-L1265 |
coursera/courier | android/generator/src/main/java/org/coursera/courier/android/JavadocEscaping.java | JavadocEscaping.stringToJavadoc | public static String stringToJavadoc(String doc, Object deprecatedProp) {
"""
Returns a javadoc comment, as a string of java source, for the given documentation string
and deprecated property.
@param doc provides the javadoc for the symbol, if any. May be null.
@param deprecatedProp provides the deprecated P... | java | public static String stringToJavadoc(String doc, Object deprecatedProp) {
boolean emptyDoc = (doc == null || doc.trim().isEmpty());
boolean emptyDeprecated = (deprecatedProp == null || !(deprecatedProp instanceof String));
if (emptyDoc && emptyDeprecated) return "";
String javadocBody = emptyDoc ? "" ... | [
"public",
"static",
"String",
"stringToJavadoc",
"(",
"String",
"doc",
",",
"Object",
"deprecatedProp",
")",
"{",
"boolean",
"emptyDoc",
"=",
"(",
"doc",
"==",
"null",
"||",
"doc",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
";",
"boolean",
"... | Returns a javadoc comment, as a string of java source, for the given documentation string
and deprecated property.
@param doc provides the javadoc for the symbol, if any. May be null.
@param deprecatedProp provides the deprecated Pegasus schema property, if any. May be a
Boolean, a String, or null.
@return an escape... | [
"Returns",
"a",
"javadoc",
"comment",
"as",
"a",
"string",
"of",
"java",
"source",
"for",
"the",
"given",
"documentation",
"string",
"and",
"deprecated",
"property",
"."
] | train | https://github.com/coursera/courier/blob/749674fa7ee33804ad11b6c8ecb560f455cb4c22/android/generator/src/main/java/org/coursera/courier/android/JavadocEscaping.java#L34-L45 |
aws/aws-sdk-java | aws-java-sdk-iot1clickdevices/src/main/java/com/amazonaws/services/iot1clickdevices/model/FinalizeDeviceClaimRequest.java | FinalizeDeviceClaimRequest.withTags | public FinalizeDeviceClaimRequest withTags(java.util.Map<String, String> tags) {
"""
<p>
A collection of key/value pairs defining the resource tags. For example, { "tags": {"key1": "value1", "key2":
"value2"} }. For more information, see <a
href="https://aws.amazon.com/answers/account-management/aws-tagging-str... | java | public FinalizeDeviceClaimRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"FinalizeDeviceClaimRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A collection of key/value pairs defining the resource tags. For example, { "tags": {"key1": "value1", "key2":
"value2"} }. For more information, see <a
href="https://aws.amazon.com/answers/account-management/aws-tagging-strategies/">AWS Tagging Strategies</a>.
</p>
<p>
</p>
@param tags
A collection of key/value p... | [
"<p",
">",
"A",
"collection",
"of",
"key",
"/",
"value",
"pairs",
"defining",
"the",
"resource",
"tags",
".",
"For",
"example",
"{",
"tags",
":",
"{",
"key1",
":",
"value1",
"key2",
":",
"value2",
"}",
"}",
".",
"For",
"more",
"information",
"see",
"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot1clickdevices/src/main/java/com/amazonaws/services/iot1clickdevices/model/FinalizeDeviceClaimRequest.java#L148-L151 |
michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/AbstractValidateableView.java | AbstractValidateableView.setError | public void setError(@Nullable final CharSequence error, @Nullable final Drawable icon) {
"""
Sets an error message and an icon, which should be displayed.
@param error
The error message, which should be displayed, as an instance of the type {@link
CharSequence} or null, if a previously set error message shou... | java | public void setError(@Nullable final CharSequence error, @Nullable final Drawable icon) {
setLeftMessage(error, icon);
setActivated(error != null);
} | [
"public",
"void",
"setError",
"(",
"@",
"Nullable",
"final",
"CharSequence",
"error",
",",
"@",
"Nullable",
"final",
"Drawable",
"icon",
")",
"{",
"setLeftMessage",
"(",
"error",
",",
"icon",
")",
";",
"setActivated",
"(",
"error",
"!=",
"null",
")",
";",
... | Sets an error message and an icon, which should be displayed.
@param error
The error message, which should be displayed, as an instance of the type {@link
CharSequence} or null, if a previously set error message should be cleared be
cleared
@param icon
The icon, which should be displayed,as an instance of the type {@l... | [
"Sets",
"an",
"error",
"message",
"and",
"an",
"icon",
"which",
"should",
"be",
"displayed",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/AbstractValidateableView.java#L918-L921 |
facebookarchive/hadoop-20 | src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorJobTracker.java | SimulatorJobTracker.startTracker | public static SimulatorJobTracker startTracker(JobConf conf, long startTime, SimulatorEngine engine)
throws IOException {
"""
Starts the JobTracker with given configuration and a given time. It also
starts the JobNotifier thread.
@param conf the starting configuration of the SimulatorJobTracker.
@param startT... | java | public static SimulatorJobTracker startTracker(JobConf conf, long startTime, SimulatorEngine engine)
throws IOException {
SimulatorJobTracker result = null;
try {
SimulatorClock simClock = new SimulatorClock(startTime);
result = new SimulatorJobTracker(conf, simClock, engine);
result.taskSch... | [
"public",
"static",
"SimulatorJobTracker",
"startTracker",
"(",
"JobConf",
"conf",
",",
"long",
"startTime",
",",
"SimulatorEngine",
"engine",
")",
"throws",
"IOException",
"{",
"SimulatorJobTracker",
"result",
"=",
"null",
";",
"try",
"{",
"SimulatorClock",
"simClo... | Starts the JobTracker with given configuration and a given time. It also
starts the JobNotifier thread.
@param conf the starting configuration of the SimulatorJobTracker.
@param startTime the starting time of simulation -- this is used to
initialize the clock.
@param engine the SimulatorEngine that we talk to.
@throws ... | [
"Starts",
"the",
"JobTracker",
"with",
"given",
"configuration",
"and",
"a",
"given",
"time",
".",
"It",
"also",
"starts",
"the",
"JobNotifier",
"thread",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorJobTracker.java#L94-L113 |
EXIficient/exificient | src/main/java/com/siemens/ct/exi/main/api/stream/StAXEncoder.java | StAXEncoder.writeNamespace | public void writeNamespace(String prefix, String namespaceURI)
throws XMLStreamException {
"""
/*
Writes a namespace to the output stream If the prefix argument to this
method is the empty string, "xmlns", or null this method will delegate to
writeDefaultNamespace
(non-Javadoc)
@see javax.xml.stream.X... | java | public void writeNamespace(String prefix, String namespaceURI)
throws XMLStreamException {
try {
this.exiAttributes.addNamespaceDeclaration(namespaceURI, prefix);
// encoder.encodeNamespaceDeclaration(namespaceURI, prefix);
} catch (Exception e) {
throw new XMLStreamException(e.getLocalizedMessage... | [
"public",
"void",
"writeNamespace",
"(",
"String",
"prefix",
",",
"String",
"namespaceURI",
")",
"throws",
"XMLStreamException",
"{",
"try",
"{",
"this",
".",
"exiAttributes",
".",
"addNamespaceDeclaration",
"(",
"namespaceURI",
",",
"prefix",
")",
";",
"// encode... | /*
Writes a namespace to the output stream If the prefix argument to this
method is the empty string, "xmlns", or null this method will delegate to
writeDefaultNamespace
(non-Javadoc)
@see javax.xml.stream.XMLStreamWriter#writeNamespace(java.lang.String,
java.lang.String) | [
"/",
"*",
"Writes",
"a",
"namespace",
"to",
"the",
"output",
"stream",
"If",
"the",
"prefix",
"argument",
"to",
"this",
"method",
"is",
"the",
"empty",
"string",
"xmlns",
"or",
"null",
"this",
"method",
"will",
"delegate",
"to",
"writeDefaultNamespace"
] | train | https://github.com/EXIficient/exificient/blob/93c7c0d63d74cfccf6ab1d5041b203745ef9ddb8/src/main/java/com/siemens/ct/exi/main/api/stream/StAXEncoder.java#L459-L467 |
arquillian/arquillian-core | core/impl-base/src/main/java/org/jboss/arquillian/core/impl/loadable/JavaSPIExtensionLoader.java | JavaSPIExtensionLoader.loadVetoed | public Map<Class<?>, Set<Class<?>>> loadVetoed(ClassLoader classLoader) {
"""
This method first finds all files that are in claspath placed at META-INF/exclusions
Each of this file has a name that represents the service type that needs to veto.
The content of this file is a list of real implementations that you ... | java | public Map<Class<?>, Set<Class<?>>> loadVetoed(ClassLoader classLoader) {
Validate.notNull(classLoader, "ClassLoader must be provided");
final Map<Class<?>, Set<Class<?>>> vetoed = new LinkedHashMap<Class<?>, Set<Class<?>>>();
try {
final Enumeration<URL> exclusions = classLoader.... | [
"public",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
">",
"loadVetoed",
"(",
"ClassLoader",
"classLoader",
")",
"{",
"Validate",
".",
"notNull",
"(",
"classLoader",
",",
"\"ClassLoader must be provided\"",
")",
";",
... | This method first finds all files that are in claspath placed at META-INF/exclusions
Each of this file has a name that represents the service type that needs to veto.
The content of this file is a list of real implementations that you want to veto.
@return List of vetos | [
"This",
"method",
"first",
"finds",
"all",
"files",
"that",
"are",
"in",
"claspath",
"placed",
"at",
"META",
"-",
"INF",
"/",
"exclusions",
"Each",
"of",
"this",
"file",
"has",
"a",
"name",
"that",
"represents",
"the",
"service",
"type",
"that",
"needs",
... | train | https://github.com/arquillian/arquillian-core/blob/a85b91789b80cc77e0f0c2e2abac65c2255c0a81/core/impl-base/src/main/java/org/jboss/arquillian/core/impl/loadable/JavaSPIExtensionLoader.java#L84-L120 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/ringsearch/FiguerasSSSRFinder.java | FiguerasSSSRFinder.breakBond | private void breakBond(IAtom atom, IAtomContainer molecule) {
"""
Eliminates one bond of this atom from the molecule
@param atom The atom one bond is eliminated of
@param molecule The molecule that contains the atom
"""
Iterator<IBond> bonds = molecule.bonds().iterator();
while (bonds... | java | private void breakBond(IAtom atom, IAtomContainer molecule) {
Iterator<IBond> bonds = molecule.bonds().iterator();
while (bonds.hasNext()) {
IBond bond = (IBond) bonds.next();
if (bond.contains(atom)) {
molecule.removeElectronContainer(bond);
break... | [
"private",
"void",
"breakBond",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"molecule",
")",
"{",
"Iterator",
"<",
"IBond",
">",
"bonds",
"=",
"molecule",
".",
"bonds",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"bonds",
".",
"hasNext",
"... | Eliminates one bond of this atom from the molecule
@param atom The atom one bond is eliminated of
@param molecule The molecule that contains the atom | [
"Eliminates",
"one",
"bond",
"of",
"this",
"atom",
"from",
"the",
"molecule"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/ringsearch/FiguerasSSSRFinder.java#L354-L363 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/spi/discovery/AbstractDiscoveryStrategy.java | AbstractDiscoveryStrategy.getOrNull | protected <T extends Comparable> T getOrNull(String prefix, PropertyDefinition property) {
"""
Returns the value of the requested {@link PropertyDefinition} if available in the
declarative or programmatic configuration (XML or Config API), can be found in the
system's environment, or passed as a JVM property. Ot... | java | protected <T extends Comparable> T getOrNull(String prefix, PropertyDefinition property) {
return getOrDefault(prefix, property, null);
} | [
"protected",
"<",
"T",
"extends",
"Comparable",
">",
"T",
"getOrNull",
"(",
"String",
"prefix",
",",
"PropertyDefinition",
"property",
")",
"{",
"return",
"getOrDefault",
"(",
"prefix",
",",
"property",
",",
"null",
")",
";",
"}"
] | Returns the value of the requested {@link PropertyDefinition} if available in the
declarative or programmatic configuration (XML or Config API), can be found in the
system's environment, or passed as a JVM property. Otherwise it will return <tt>null</tt>.
<p/>
This overload will resolve the requested property in the fo... | [
"Returns",
"the",
"value",
"of",
"the",
"requested",
"{",
"@link",
"PropertyDefinition",
"}",
"if",
"available",
"in",
"the",
"declarative",
"or",
"programmatic",
"configuration",
"(",
"XML",
"or",
"Config",
"API",
")",
"can",
"be",
"found",
"in",
"the",
"sy... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/discovery/AbstractDiscoveryStrategy.java#L124-L126 |
enioka/jqm | jqm-all/jqm-model/src/main/java/com/enioka/jqm/jdbc/Db.java | Db.getConn | public DbConn getConn() {
"""
A connection to the database. Should be short-lived. No transaction active by default.
@return a new open connection.
"""
Connection cnx = null;
try
{
Thread.interrupted(); // this is VERY sad. Needed for Oracle driver which otherwise fails s... | java | public DbConn getConn()
{
Connection cnx = null;
try
{
Thread.interrupted(); // this is VERY sad. Needed for Oracle driver which otherwise fails spectacularly.
cnx = _ds.getConnection();
if (cnx.getAutoCommit())
{
cnx.setAutoCom... | [
"public",
"DbConn",
"getConn",
"(",
")",
"{",
"Connection",
"cnx",
"=",
"null",
";",
"try",
"{",
"Thread",
".",
"interrupted",
"(",
")",
";",
"// this is VERY sad. Needed for Oracle driver which otherwise fails spectacularly.",
"cnx",
"=",
"_ds",
".",
"getConnection",... | A connection to the database. Should be short-lived. No transaction active by default.
@return a new open connection. | [
"A",
"connection",
"to",
"the",
"database",
".",
"Should",
"be",
"short",
"-",
"lived",
".",
"No",
"transaction",
"active",
"by",
"default",
"."
] | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-model/src/main/java/com/enioka/jqm/jdbc/Db.java#L513-L538 |
milaboratory/milib | src/main/java/com/milaboratory/core/clustering/Clustering.java | Clustering.getComparatorOfClusters | static <T, S extends Sequence> Comparator<Cluster<T>>
getComparatorOfClusters(final Comparator<T> objectComparator, final SequenceExtractor<T, S> extractor) {
"""
First REVERSE compare cluster heads (bigger objects comes first), if equal, REVERSE compare by head sequence.
"""
return new Comparator<... | java | static <T, S extends Sequence> Comparator<Cluster<T>>
getComparatorOfClusters(final Comparator<T> objectComparator, final SequenceExtractor<T, S> extractor) {
return new Comparator<Cluster<T>>() {
@Override
public int compare(Cluster<T> o1, Cluster<T> o2) {
int i = ob... | [
"static",
"<",
"T",
",",
"S",
"extends",
"Sequence",
">",
"Comparator",
"<",
"Cluster",
"<",
"T",
">",
">",
"getComparatorOfClusters",
"(",
"final",
"Comparator",
"<",
"T",
">",
"objectComparator",
",",
"final",
"SequenceExtractor",
"<",
"T",
",",
"S",
">"... | First REVERSE compare cluster heads (bigger objects comes first), if equal, REVERSE compare by head sequence. | [
"First",
"REVERSE",
"compare",
"cluster",
"heads",
"(",
"bigger",
"objects",
"comes",
"first",
")",
"if",
"equal",
"REVERSE",
"compare",
"by",
"head",
"sequence",
"."
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/clustering/Clustering.java#L230-L241 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java | XSLTAttributeDef.setDefAttrValue | void setDefAttrValue(StylesheetHandler handler, ElemTemplateElement elem)
throws org.xml.sax.SAXException {
"""
Set the default value of an attribute.
@param handler non-null reference to current StylesheetHandler that is constructing the Templates.
@param elem The object on which the property will b... | java | void setDefAttrValue(StylesheetHandler handler, ElemTemplateElement elem)
throws org.xml.sax.SAXException
{
setAttrValue(handler, this.getNamespace(), this.getName(),
this.getName(), this.getDefault(), elem);
} | [
"void",
"setDefAttrValue",
"(",
"StylesheetHandler",
"handler",
",",
"ElemTemplateElement",
"elem",
")",
"throws",
"org",
".",
"xml",
".",
"sax",
".",
"SAXException",
"{",
"setAttrValue",
"(",
"handler",
",",
"this",
".",
"getNamespace",
"(",
")",
",",
"this",... | Set the default value of an attribute.
@param handler non-null reference to current StylesheetHandler that is constructing the Templates.
@param elem The object on which the property will be set.
@throws org.xml.sax.SAXException wraps an invocation exception if the
setter method can not be invoked on the object. | [
"Set",
"the",
"default",
"value",
"of",
"an",
"attribute",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java#L1471-L1476 |
couchbase/CouchbaseMock | src/main/java/com/couchbase/mock/http/ControlHandler.java | ControlHandler.sendHelpText | private static void sendHelpText(HttpResponse response, int code) throws IOException {
"""
Sends a help text with the provided code
@param response The response
@param code The HTTP status code to be used in the response
"""
HandlerUtil.makeStringResponse(response, MockHelpCommandHandler.getIndentedH... | java | private static void sendHelpText(HttpResponse response, int code) throws IOException {
HandlerUtil.makeStringResponse(response, MockHelpCommandHandler.getIndentedHelp());
response.setStatusCode(code);
} | [
"private",
"static",
"void",
"sendHelpText",
"(",
"HttpResponse",
"response",
",",
"int",
"code",
")",
"throws",
"IOException",
"{",
"HandlerUtil",
".",
"makeStringResponse",
"(",
"response",
",",
"MockHelpCommandHandler",
".",
"getIndentedHelp",
"(",
")",
")",
";... | Sends a help text with the provided code
@param response The response
@param code The HTTP status code to be used in the response | [
"Sends",
"a",
"help",
"text",
"with",
"the",
"provided",
"code"
] | train | https://github.com/couchbase/CouchbaseMock/blob/2085bbebade1d5b6356480e7bf335139d08383da/src/main/java/com/couchbase/mock/http/ControlHandler.java#L59-L62 |
opengeospatial/teamengine | teamengine-core/src/main/java/com/occamlab/te/util/Utils.java | Utils.evaluateXPointer | public static String evaluateXPointer(String xpointer, InputStream is) {
"""
Converts an XPointer to XPath and evaulates the result (JAXP)
"""
String results = "";
// Parse the XPointer into usable namespaces and XPath expressions
int xmlnsStart = xpointer.indexOf("xmlns(") + "xmlns(... | java | public static String evaluateXPointer(String xpointer, InputStream is) {
String results = "";
// Parse the XPointer into usable namespaces and XPath expressions
int xmlnsStart = xpointer.indexOf("xmlns(") + "xmlns(".length();
int xmlnsEnd = xpointer.indexOf(")", xmlnsStart);
... | [
"public",
"static",
"String",
"evaluateXPointer",
"(",
"String",
"xpointer",
",",
"InputStream",
"is",
")",
"{",
"String",
"results",
"=",
"\"\"",
";",
"// Parse the XPointer into usable namespaces and XPath expressions\r",
"int",
"xmlnsStart",
"=",
"xpointer",
".",
"in... | Converts an XPointer to XPath and evaulates the result (JAXP) | [
"Converts",
"an",
"XPointer",
"to",
"XPath",
"and",
"evaulates",
"the",
"result",
"(",
"JAXP",
")"
] | train | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/Utils.java#L117-L148 |
akquinet/androlog | androlog/src/main/java/de/akquinet/android/androlog/Log.java | Log.wtf | public static int wtf(Object object, String msg, Throwable tr) {
"""
What a Terrible Failure: Report a condition that should never happen. The
error will always be logged at level Constants.ASSERT despite the logging is
disabled. Depending on system configuration, and on Android 2.2+, a
report may be added to t... | java | public static int wtf(Object object, String msg, Throwable tr) {
if (object != null) {
return wtf(object.getClass().getName(), msg, tr);
}
return 0;
} | [
"public",
"static",
"int",
"wtf",
"(",
"Object",
"object",
",",
"String",
"msg",
",",
"Throwable",
"tr",
")",
"{",
"if",
"(",
"object",
"!=",
"null",
")",
"{",
"return",
"wtf",
"(",
"object",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
","... | What a Terrible Failure: Report a condition that should never happen. The
error will always be logged at level Constants.ASSERT despite the logging is
disabled. Depending on system configuration, and on Android 2.2+, a
report may be added to the DropBoxManager and/or the process may be
terminated immediately with an er... | [
"What",
"a",
"Terrible",
"Failure",
":",
"Report",
"a",
"condition",
"that",
"should",
"never",
"happen",
".",
"The",
"error",
"will",
"always",
"be",
"logged",
"at",
"level",
"Constants",
".",
"ASSERT",
"despite",
"the",
"logging",
"is",
"disabled",
".",
... | train | https://github.com/akquinet/androlog/blob/82fa81354c01c9b1d1928062b634ba21f14be560/androlog/src/main/java/de/akquinet/android/androlog/Log.java#L1080-L1085 |
diffplug/JMatIO | src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java | MLStructure.setField | public void setField(String name, MLArray value, int index) {
"""
Sets filed for structure described by index in struct array
@param name - name of the field
@param value - <code>MLArray</code> field value
@param index
"""
keys.add(name);
currentIndex = index;
if ( mlStruc... | java | public void setField(String name, MLArray value, int index)
{
keys.add(name);
currentIndex = index;
if ( mlStructArray.isEmpty() || mlStructArray.size() <= index )
{
mlStructArray.add(index, new LinkedHashMap<String, MLArray>() );
}
mlStructArray.... | [
"public",
"void",
"setField",
"(",
"String",
"name",
",",
"MLArray",
"value",
",",
"int",
"index",
")",
"{",
"keys",
".",
"add",
"(",
"name",
")",
";",
"currentIndex",
"=",
"index",
";",
"if",
"(",
"mlStructArray",
".",
"isEmpty",
"(",
")",
"||",
"ml... | Sets filed for structure described by index in struct array
@param name - name of the field
@param value - <code>MLArray</code> field value
@param index | [
"Sets",
"filed",
"for",
"structure",
"described",
"by",
"index",
"in",
"struct",
"array"
] | train | https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java#L80-L90 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java | TmdbAccount.getRatedMovies | public ResultList<MovieBasic> getRatedMovies(String sessionId, int accountId, Integer page, String sortBy, String language) throws MovieDbException {
"""
Get the list of rated movies (and associated rating) for an account.
@param sessionId
@param accountId
@param page
@param sortBy
@param language
@return
... | java | public ResultList<MovieBasic> getRatedMovies(String sessionId, int accountId, Integer page, String sortBy, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.SESSION_ID, sessionId);
parameters.add(Param.ID, accountId);
parame... | [
"public",
"ResultList",
"<",
"MovieBasic",
">",
"getRatedMovies",
"(",
"String",
"sessionId",
",",
"int",
"accountId",
",",
"Integer",
"page",
",",
"String",
"sortBy",
",",
"String",
"language",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters... | Get the list of rated movies (and associated rating) for an account.
@param sessionId
@param accountId
@param page
@param sortBy
@param language
@return
@throws MovieDbException | [
"Get",
"the",
"list",
"of",
"rated",
"movies",
"(",
"and",
"associated",
"rating",
")",
"for",
"an",
"account",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java#L179-L190 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Long.java | Long.divideUnsigned | public static long divideUnsigned(long dividend, long divisor) {
"""
Returns the unsigned quotient of dividing the first argument by
the second where each argument and the result is interpreted as
an unsigned value.
<p>Note that in two's complement arithmetic, the three other
basic arithmetic operations of a... | java | public static long divideUnsigned(long dividend, long divisor) {
if (divisor < 0L) { // signed comparison
// Answer must be 0 or 1 depending on relative magnitude
// of dividend and divisor.
return (compareUnsigned(dividend, divisor)) < 0 ? 0L :1L;
}
if (divi... | [
"public",
"static",
"long",
"divideUnsigned",
"(",
"long",
"dividend",
",",
"long",
"divisor",
")",
"{",
"if",
"(",
"divisor",
"<",
"0L",
")",
"{",
"// signed comparison",
"// Answer must be 0 or 1 depending on relative magnitude",
"// of dividend and divisor.",
"return",... | Returns the unsigned quotient of dividing the first argument by
the second where each argument and the result is interpreted as
an unsigned value.
<p>Note that in two's complement arithmetic, the three other
basic arithmetic operations of add, subtract, and multiply are
bit-wise identical if the two operands are regar... | [
"Returns",
"the",
"unsigned",
"quotient",
"of",
"dividing",
"the",
"first",
"argument",
"by",
"the",
"second",
"where",
"each",
"argument",
"and",
"the",
"result",
"is",
"interpreted",
"as",
"an",
"unsigned",
"value",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Long.java#L1138-L1157 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java | FlowController.addActionErrorExpression | protected void addActionErrorExpression( String propertyName, String expression, Object[] messageArgs ) {
"""
Add a property-related message as an expression that will be evaluated and shown with the Errors and Error tags.
@param propertyName the name of the property with which to associate this error.
@param ... | java | protected void addActionErrorExpression( String propertyName, String expression, Object[] messageArgs )
{
PageFlowUtils.addActionErrorExpression( getRequest(), propertyName, expression, messageArgs );
} | [
"protected",
"void",
"addActionErrorExpression",
"(",
"String",
"propertyName",
",",
"String",
"expression",
",",
"Object",
"[",
"]",
"messageArgs",
")",
"{",
"PageFlowUtils",
".",
"addActionErrorExpression",
"(",
"getRequest",
"(",
")",
",",
"propertyName",
",",
... | Add a property-related message as an expression that will be evaluated and shown with the Errors and Error tags.
@param propertyName the name of the property with which to associate this error.
@param expression the expression that will be evaluated to generate the error message.
@param messageArgs zero or more argume... | [
"Add",
"a",
"property",
"-",
"related",
"message",
"as",
"an",
"expression",
"that",
"will",
"be",
"evaluated",
"and",
"shown",
"with",
"the",
"Errors",
"and",
"Error",
"tags",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java#L1483-L1486 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.getAttributeDateWithDefault | @Pure
public static Date getAttributeDateWithDefault(Node document, boolean caseSensitive, Date defaultValue, String... path) {
"""
Replies the date that corresponds to the specified attribute's path.
<p>The path is an ordered list of tag's names and ended by the name of
the attribute.
@param document is t... | java | @Pure
public static Date getAttributeDateWithDefault(Node document, boolean caseSensitive, Date defaultValue, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
final String v = getAttributeValue(document, caseSensitive, 0, path);
if (v != null) {
try {
return parseDate(v);
... | [
"@",
"Pure",
"public",
"static",
"Date",
"getAttributeDateWithDefault",
"(",
"Node",
"document",
",",
"boolean",
"caseSensitive",
",",
"Date",
"defaultValue",
",",
"String",
"...",
"path",
")",
"{",
"assert",
"document",
"!=",
"null",
":",
"AssertMessages",
".",... | Replies the date that corresponds to the specified attribute's path.
<p>The path is an ordered list of tag's names and ended by the name of
the attribute.
@param document is the XML document to explore.
@param caseSensitive indicates of the {@code path}'s components are case sensitive.
@param defaultValue is the defa... | [
"Replies",
"the",
"date",
"that",
"corresponds",
"to",
"the",
"specified",
"attribute",
"s",
"path",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L533-L545 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java | ZipUtil.addFile | private static void addFile(File file, String path, ZipOutputStream out) throws UtilException {
"""
添加文件到压缩包
@param file 需要压缩的文件
@param path 在压缩文件中的路径
@param out 压缩文件存储对象
@throws UtilException IO异常
@since 4.0.5
"""
BufferedInputStream in = null;
try {
in = FileUtil.getInputStream(file);
ad... | java | private static void addFile(File file, String path, ZipOutputStream out) throws UtilException {
BufferedInputStream in = null;
try {
in = FileUtil.getInputStream(file);
addFile(in, path, out);
} finally {
IoUtil.close(in);
}
} | [
"private",
"static",
"void",
"addFile",
"(",
"File",
"file",
",",
"String",
"path",
",",
"ZipOutputStream",
"out",
")",
"throws",
"UtilException",
"{",
"BufferedInputStream",
"in",
"=",
"null",
";",
"try",
"{",
"in",
"=",
"FileUtil",
".",
"getInputStream",
"... | 添加文件到压缩包
@param file 需要压缩的文件
@param path 在压缩文件中的路径
@param out 压缩文件存储对象
@throws UtilException IO异常
@since 4.0.5 | [
"添加文件到压缩包"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L802-L810 |
banq/jdonframework | src/main/java/com/jdon/util/jdom/DataUnformatFilter.java | DataUnformatFilter.endElement | public void endElement(String uri, String localName, String qName) throws SAXException {
"""
Filter an end element event.
@param uri
The element's Namespace URI.
@param localName
The element's local name.
@param qName
The element's qualified (prefixed) name.
@exception org.xml.sax.SAXException
If a filte... | java | public void endElement(String uri, String localName, String qName) throws SAXException {
if (state == SEEN_ELEMENT) {
clearWhitespace();
} else {
emitWhitespace();
}
state = stateStack.pop();
super.endElement(uri, localName, qName);
} | [
"public",
"void",
"endElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"state",
"==",
"SEEN_ELEMENT",
")",
"{",
"clearWhitespace",
"(",
")",
";",
"}",
"else",
"{",
"emitWhite... | Filter an end element event.
@param uri
The element's Namespace URI.
@param localName
The element's local name.
@param qName
The element's qualified (prefixed) name.
@exception org.xml.sax.SAXException
If a filter further down the chain raises an exception.
@see org.xml.sax.ContentHandler#endElement | [
"Filter",
"an",
"end",
"element",
"event",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/jdom/DataUnformatFilter.java#L177-L185 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetRollingUpgradesInner.java | VirtualMachineScaleSetRollingUpgradesInner.startOSUpgradeAsync | public Observable<OperationStatusResponseInner> startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName) {
"""
Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version ... | java | public Observable<OperationStatusResponseInner> startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName) {
return startOSUpgradeWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Over... | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"startOSUpgradeAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"startOSUpgradeWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetName",
")",
... | Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
... | [
"Starts",
"a",
"rolling",
"upgrade",
"to",
"move",
"all",
"virtual",
"machine",
"scale",
"set",
"instances",
"to",
"the",
"latest",
"available",
"Platform",
"Image",
"OS",
"version",
".",
"Instances",
"which",
"are",
"already",
"running",
"the",
"latest",
"ava... | 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/VirtualMachineScaleSetRollingUpgradesInner.java#L268-L275 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.