repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 192 | func_name stringlengths 5 108 | whole_func_string stringlengths 75 3.91k | language stringclasses 1
value | func_code_string stringlengths 75 3.91k | func_code_tokens listlengths 21 629 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 111 306 |
|---|---|---|---|---|---|---|---|---|---|---|
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/contrib/ComparatorChain.java | ComparatorChain.setComparator | public void setComparator(int index, Comparator<T> comparator) throws IndexOutOfBoundsException {
setComparator(index, comparator, false);
} | java | public void setComparator(int index, Comparator<T> comparator) throws IndexOutOfBoundsException {
setComparator(index, comparator, false);
} | [
"public",
"void",
"setComparator",
"(",
"int",
"index",
",",
"Comparator",
"<",
"T",
">",
"comparator",
")",
"throws",
"IndexOutOfBoundsException",
"{",
"setComparator",
"(",
"index",
",",
"comparator",
",",
"false",
")",
";",
"}"
] | Replace the Comparator at the given index, maintaining the existing sortFields order.
@param index index of the Comparator to replace
@param comparator Comparator to place at the given index
@throws IndexOutOfBoundsException if index < 0 or index >= size() | [
"Replace",
"the",
"Comparator",
"at",
"the",
"given",
"index",
"maintaining",
"the",
"existing",
"sortFields",
"order",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/contrib/ComparatorChain.java#L151-L153 |
GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PerformanceCachingGoogleCloudStorage.java | PerformanceCachingGoogleCloudStorage.getItemInfo | @Override
public GoogleCloudStorageItemInfo getItemInfo(StorageResourceId resourceId) throws IOException {
// Get the item from cache.
GoogleCloudStorageItemInfo item = cache.getItem(resourceId);
// If it wasn't in the cache, list all the objects in the parent directory and cache them
// and then ret... | java | @Override
public GoogleCloudStorageItemInfo getItemInfo(StorageResourceId resourceId) throws IOException {
// Get the item from cache.
GoogleCloudStorageItemInfo item = cache.getItem(resourceId);
// If it wasn't in the cache, list all the objects in the parent directory and cache them
// and then ret... | [
"@",
"Override",
"public",
"GoogleCloudStorageItemInfo",
"getItemInfo",
"(",
"StorageResourceId",
"resourceId",
")",
"throws",
"IOException",
"{",
"// Get the item from cache.",
"GoogleCloudStorageItemInfo",
"item",
"=",
"cache",
".",
"getItem",
"(",
"resourceId",
")",
";... | This function may return cached copies of GoogleCloudStorageItemInfo. | [
"This",
"function",
"may",
"return",
"cached",
"copies",
"of",
"GoogleCloudStorageItemInfo",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PerformanceCachingGoogleCloudStorage.java#L256-L289 |
cdapio/tigon | tigon-queue/src/main/java/co/cask/tigon/data/transaction/queue/QueueEntryRow.java | QueueEntryRow.getQueueName | public static QueueName getQueueName(String appName, String flowName,
byte[] rowBuffer, int rowOffset, int rowLength) {
// Entry key is always (salt bytes + 1 MD5 byte + queueName + longWritePointer + intCounter)
int queueNameEnd = rowOffset + rowLength - Bytes.SIZEOF_LONG... | java | public static QueueName getQueueName(String appName, String flowName,
byte[] rowBuffer, int rowOffset, int rowLength) {
// Entry key is always (salt bytes + 1 MD5 byte + queueName + longWritePointer + intCounter)
int queueNameEnd = rowOffset + rowLength - Bytes.SIZEOF_LONG... | [
"public",
"static",
"QueueName",
"getQueueName",
"(",
"String",
"appName",
",",
"String",
"flowName",
",",
"byte",
"[",
"]",
"rowBuffer",
",",
"int",
"rowOffset",
",",
"int",
"rowLength",
")",
"{",
"// Entry key is always (salt bytes + 1 MD5 byte + queueName + longWrite... | Extracts the queue name from the KeyValue row, which the row must be a queue entry. | [
"Extracts",
"the",
"queue",
"name",
"from",
"the",
"KeyValue",
"row",
"which",
"the",
"row",
"must",
"be",
"a",
"queue",
"entry",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-queue/src/main/java/co/cask/tigon/data/transaction/queue/QueueEntryRow.java#L115-L129 |
lionsoul2014/jcseg | jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java | Unzipper.getAndTick | private Object getAndTick(Keep keep, BitReader bitreader)
throws JSONException {
try {
int width = keep.bitsize();
int integer = bitreader.read(width);
Object value = keep.value(integer);
if (JSONzip.probe) {
JSONzip.log("\"" + value + ... | java | private Object getAndTick(Keep keep, BitReader bitreader)
throws JSONException {
try {
int width = keep.bitsize();
int integer = bitreader.read(width);
Object value = keep.value(integer);
if (JSONzip.probe) {
JSONzip.log("\"" + value + ... | [
"private",
"Object",
"getAndTick",
"(",
"Keep",
"keep",
",",
"BitReader",
"bitreader",
")",
"throws",
"JSONException",
"{",
"try",
"{",
"int",
"width",
"=",
"keep",
".",
"bitsize",
"(",
")",
";",
"int",
"integer",
"=",
"bitreader",
".",
"read",
"(",
"wid... | Read enough bits to obtain an integer from the keep, and increase that
integer's weight.
@param keep The keep providing the context.
@param bitreader The bitreader that is the source of bits.
@return The value associated with the number.
@throws JSONException | [
"Read",
"enough",
"bits",
"to",
"obtain",
"an",
"integer",
"from",
"the",
"keep",
"and",
"increase",
"that",
"integer",
"s",
"weight",
"."
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java#L87-L105 |
aws/aws-sdk-java | aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/MessageMD5ChecksumHandler.java | MessageMD5ChecksumHandler.updateLengthAndBytes | private static void updateLengthAndBytes(MessageDigest digest, String str) throws UnsupportedEncodingException {
byte[] utf8Encoded = str.getBytes(UTF8);
ByteBuffer lengthBytes = ByteBuffer.allocate(INTEGER_SIZE_IN_BYTES).putInt(utf8Encoded.length);
digest.update(lengthBytes.array());
di... | java | private static void updateLengthAndBytes(MessageDigest digest, String str) throws UnsupportedEncodingException {
byte[] utf8Encoded = str.getBytes(UTF8);
ByteBuffer lengthBytes = ByteBuffer.allocate(INTEGER_SIZE_IN_BYTES).putInt(utf8Encoded.length);
digest.update(lengthBytes.array());
di... | [
"private",
"static",
"void",
"updateLengthAndBytes",
"(",
"MessageDigest",
"digest",
",",
"String",
"str",
")",
"throws",
"UnsupportedEncodingException",
"{",
"byte",
"[",
"]",
"utf8Encoded",
"=",
"str",
".",
"getBytes",
"(",
"UTF8",
")",
";",
"ByteBuffer",
"len... | Update the digest using a sequence of bytes that consists of the length (in 4 bytes) of the
input String and the actual utf8-encoded byte values. | [
"Update",
"the",
"digest",
"using",
"a",
"sequence",
"of",
"bytes",
"that",
"consists",
"of",
"the",
"length",
"(",
"in",
"4",
"bytes",
")",
"of",
"the",
"input",
"String",
"and",
"the",
"actual",
"utf8",
"-",
"encoded",
"byte",
"values",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/MessageMD5ChecksumHandler.java#L269-L274 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java | RobustResilienceStrategy.putIfAbsentFailure | @Override
public V putIfAbsentFailure(K key, V value, StoreAccessException e) {
cleanup(key, e);
return null;
} | java | @Override
public V putIfAbsentFailure(K key, V value, StoreAccessException e) {
cleanup(key, e);
return null;
} | [
"@",
"Override",
"public",
"V",
"putIfAbsentFailure",
"(",
"K",
"key",
",",
"V",
"value",
",",
"StoreAccessException",
"e",
")",
"{",
"cleanup",
"(",
"key",
",",
"e",
")",
";",
"return",
"null",
";",
"}"
] | Do nothing and return null.
@param key the key being put
@param value the value being put
@param e the triggered failure
@return null | [
"Do",
"nothing",
"and",
"return",
"null",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java#L114-L118 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/InstanceTypeFactory.java | InstanceTypeFactory.constructFromDescription | public static InstanceType constructFromDescription(String description) {
final Matcher m = INSTANCE_TYPE_PATTERN.matcher(description);
if (!m.matches()) {
LOG.error("Cannot extract instance type from string " + description);
return null;
}
final String identifier = m.group(1);
final int numComputeUni... | java | public static InstanceType constructFromDescription(String description) {
final Matcher m = INSTANCE_TYPE_PATTERN.matcher(description);
if (!m.matches()) {
LOG.error("Cannot extract instance type from string " + description);
return null;
}
final String identifier = m.group(1);
final int numComputeUni... | [
"public",
"static",
"InstanceType",
"constructFromDescription",
"(",
"String",
"description",
")",
"{",
"final",
"Matcher",
"m",
"=",
"INSTANCE_TYPE_PATTERN",
".",
"matcher",
"(",
"description",
")",
";",
"if",
"(",
"!",
"m",
".",
"matches",
"(",
")",
")",
"... | Constructs an {@link InstanceType} object by parsing a hardware description string.
@param description
the hardware description reflected by this instance type
@return an instance type reflecting the given hardware description or <code>null</code> if the description cannot
be parsed | [
"Constructs",
"an",
"{",
"@link",
"InstanceType",
"}",
"object",
"by",
"parsing",
"a",
"hardware",
"description",
"string",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/InstanceTypeFactory.java#L52-L68 |
wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/util/ExtractUtil.java | ExtractUtil.extractValueByName | public static String extractValueByName(List<MemberValuePair> pairs, String name){
for(MemberValuePair pair : pairs){
if(pair.getName().equals(name)){
return pair.getValue().toString();
}
}
return null;
} | java | public static String extractValueByName(List<MemberValuePair> pairs, String name){
for(MemberValuePair pair : pairs){
if(pair.getName().equals(name)){
return pair.getValue().toString();
}
}
return null;
} | [
"public",
"static",
"String",
"extractValueByName",
"(",
"List",
"<",
"MemberValuePair",
">",
"pairs",
",",
"String",
"name",
")",
"{",
"for",
"(",
"MemberValuePair",
"pair",
":",
"pairs",
")",
"{",
"if",
"(",
"pair",
".",
"getName",
"(",
")",
".",
"equa... | Get the value of a {@link MemberValuePair} present in a list from its name.
@param pairs The list of MemberValuePair
@param name The name of the MemberValuePair we want to get the value from.
@return The value of the MemberValuePair of given name, or null if it's not present in the list. | [
"Get",
"the",
"value",
"of",
"a",
"{",
"@link",
"MemberValuePair",
"}",
"present",
"in",
"a",
"list",
"from",
"its",
"name",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/util/ExtractUtil.java#L242-L249 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/UtilIO.java | UtilIO.pathExampleURL | public static URL pathExampleURL( String path ) {
try {
File fpath = new File(path);
if (fpath.isAbsolute())
return fpath.toURI().toURL();
// Assume we are running inside of the project come
String pathToBase = getPathToBase();
if( pathToBase != null ) {
File pathExample = new File(pathToBase, ... | java | public static URL pathExampleURL( String path ) {
try {
File fpath = new File(path);
if (fpath.isAbsolute())
return fpath.toURI().toURL();
// Assume we are running inside of the project come
String pathToBase = getPathToBase();
if( pathToBase != null ) {
File pathExample = new File(pathToBase, ... | [
"public",
"static",
"URL",
"pathExampleURL",
"(",
"String",
"path",
")",
"{",
"try",
"{",
"File",
"fpath",
"=",
"new",
"File",
"(",
"path",
")",
";",
"if",
"(",
"fpath",
".",
"isAbsolute",
"(",
")",
")",
"return",
"fpath",
".",
"toURI",
"(",
")",
"... | Returns an absolute path to the file that is relative to the example directory
@param path File path relative to root directory
@return Absolute path to file | [
"Returns",
"an",
"absolute",
"path",
"to",
"the",
"file",
"that",
"is",
"relative",
"to",
"the",
"example",
"directory"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/UtilIO.java#L44-L81 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java | StrSubstitutor.replaceIn | public boolean replaceIn(final StringBuffer source) {
if (source == null) {
return false;
}
return replaceIn(source, 0, source.length());
} | java | public boolean replaceIn(final StringBuffer source) {
if (source == null) {
return false;
}
return replaceIn(source, 0, source.length());
} | [
"public",
"boolean",
"replaceIn",
"(",
"final",
"StringBuffer",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"replaceIn",
"(",
"source",
",",
"0",
",",
"source",
".",
"length",
"(",
")",
")",
... | Replaces all the occurrences of variables within the given source buffer
with their matching values from the resolver.
The buffer is updated with the result.
@param source the buffer to replace in, updated, null returns zero
@return true if altered | [
"Replaces",
"all",
"the",
"occurrences",
"of",
"variables",
"within",
"the",
"given",
"source",
"buffer",
"with",
"their",
"matching",
"values",
"from",
"the",
"resolver",
".",
"The",
"buffer",
"is",
"updated",
"with",
"the",
"result",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java#L621-L626 |
pebble/pebble-android-sdk | PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java | PebbleKit.registerPebbleConnectedReceiver | public static BroadcastReceiver registerPebbleConnectedReceiver(final Context context,
final BroadcastReceiver receiver) {
return registerBroadcastReceiverInternal(context, INTENT_PEBBLE_CONNECTED, receiver);
} | java | public static BroadcastReceiver registerPebbleConnectedReceiver(final Context context,
final BroadcastReceiver receiver) {
return registerBroadcastReceiverInternal(context, INTENT_PEBBLE_CONNECTED, receiver);
} | [
"public",
"static",
"BroadcastReceiver",
"registerPebbleConnectedReceiver",
"(",
"final",
"Context",
"context",
",",
"final",
"BroadcastReceiver",
"receiver",
")",
"{",
"return",
"registerBroadcastReceiverInternal",
"(",
"context",
",",
"INTENT_PEBBLE_CONNECTED",
",",
"rece... | A convenience function to assist in programatically registering a broadcast receiver for the 'CONNECTED' intent.
To avoid leaking memory, activities registering BroadcastReceivers <em>must</em> unregister them in the
Activity's {@link android.app.Activity#onPause()} method.
@param context
The context in which to regi... | [
"A",
"convenience",
"function",
"to",
"assist",
"in",
"programatically",
"registering",
"a",
"broadcast",
"receiver",
"for",
"the",
"CONNECTED",
"intent",
"."
] | train | https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java#L385-L388 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.publish0 | private PubsubFuture<List<String>> publish0(final List<Message> messages, final String canonicalTopic) {
final String path = canonicalTopic + ":publish";
for (final Message message : messages) {
if (!isEncoded(message)) {
throw new IllegalArgumentException("Message data must be Base64 encoded: " +... | java | private PubsubFuture<List<String>> publish0(final List<Message> messages, final String canonicalTopic) {
final String path = canonicalTopic + ":publish";
for (final Message message : messages) {
if (!isEncoded(message)) {
throw new IllegalArgumentException("Message data must be Base64 encoded: " +... | [
"private",
"PubsubFuture",
"<",
"List",
"<",
"String",
">",
">",
"publish0",
"(",
"final",
"List",
"<",
"Message",
">",
"messages",
",",
"final",
"String",
"canonicalTopic",
")",
"{",
"final",
"String",
"path",
"=",
"canonicalTopic",
"+",
"\":publish\"",
";"... | Publish a batch of messages.
@param messages The batch of messages.
@param canonicalTopic The canonical topic to publish on.
@return a future that is completed with a list of message ID's for the published messages. | [
"Publish",
"a",
"batch",
"of",
"messages",
"."
] | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L518-L527 |
bazaarvoice/jolt | complete/src/main/java/com/bazaarvoice/jolt/ChainrFactory.java | ChainrFactory.fromFile | public static Chainr fromFile( File chainrSpecFile, ChainrInstantiator chainrInstantiator ) {
Object chainrSpec;
try {
FileInputStream fileInputStream = new FileInputStream( chainrSpecFile );
chainrSpec = JsonUtils.jsonToObject( fileInputStream );
} catch ( Exception e ) ... | java | public static Chainr fromFile( File chainrSpecFile, ChainrInstantiator chainrInstantiator ) {
Object chainrSpec;
try {
FileInputStream fileInputStream = new FileInputStream( chainrSpecFile );
chainrSpec = JsonUtils.jsonToObject( fileInputStream );
} catch ( Exception e ) ... | [
"public",
"static",
"Chainr",
"fromFile",
"(",
"File",
"chainrSpecFile",
",",
"ChainrInstantiator",
"chainrInstantiator",
")",
"{",
"Object",
"chainrSpec",
";",
"try",
"{",
"FileInputStream",
"fileInputStream",
"=",
"new",
"FileInputStream",
"(",
"chainrSpecFile",
")"... | Builds a Chainr instance using the spec described in the File that is passed in.
@param chainrSpecFile The File which contains the chainr spec.
@param chainrInstantiator the ChainrInstantiator to use to initialze the Chainr instance
@return a Chainr instance | [
"Builds",
"a",
"Chainr",
"instance",
"using",
"the",
"spec",
"described",
"in",
"the",
"File",
"that",
"is",
"passed",
"in",
"."
] | train | https://github.com/bazaarvoice/jolt/blob/4cf866a9f4222142da41b50dbcccce022a956bff/complete/src/main/java/com/bazaarvoice/jolt/ChainrFactory.java#L89-L98 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.createVariable | public Variable createVariable(Object projectIdOrPath, String key, String value, Boolean isProtected, String environmentScope) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("key", key, true)
.withParam("value", value, true)
.... | java | public Variable createVariable(Object projectIdOrPath, String key, String value, Boolean isProtected, String environmentScope) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("key", key, true)
.withParam("value", value, true)
.... | [
"public",
"Variable",
"createVariable",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"key",
",",
"String",
"value",
",",
"Boolean",
"isProtected",
",",
"String",
"environmentScope",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new... | Create a new project variable.
<p>NOTE: Setting the environmentScope is only available on GitLab EE.</p>
<pre><code>GitLab Endpoint: POST /projects/:id/variables</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param key the k... | [
"Create",
"a",
"new",
"project",
"variable",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L2519-L2528 |
classgraph/classgraph | src/main/java/io/github/classgraph/TypeArgument.java | TypeArgument.parseList | static List<TypeArgument> parseList(final Parser parser, final String definingClassName) throws ParseException {
if (parser.peek() == '<') {
parser.expect('<');
final List<TypeArgument> typeArguments = new ArrayList<>(2);
while (parser.peek() != '>') {
if (!pa... | java | static List<TypeArgument> parseList(final Parser parser, final String definingClassName) throws ParseException {
if (parser.peek() == '<') {
parser.expect('<');
final List<TypeArgument> typeArguments = new ArrayList<>(2);
while (parser.peek() != '>') {
if (!pa... | [
"static",
"List",
"<",
"TypeArgument",
">",
"parseList",
"(",
"final",
"Parser",
"parser",
",",
"final",
"String",
"definingClassName",
")",
"throws",
"ParseException",
"{",
"if",
"(",
"parser",
".",
"peek",
"(",
")",
"==",
"'",
"'",
")",
"{",
"parser",
... | Parse a list of type arguments.
@param parser
The parser.
@param definingClassName
The name of the defining class (for resolving type variables).
@return The list of type arguments.
@throws ParseException
If type signature could not be parsed. | [
"Parse",
"a",
"list",
"of",
"type",
"arguments",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/TypeArgument.java#L153-L168 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java | DiSHPreferenceVectorIndex.maxIntersection | private int maxIntersection(Map<Integer, ModifiableDBIDs> candidates, ModifiableDBIDs set) {
int maxDim = -1;
ModifiableDBIDs maxIntersection = null;
for(Integer nextDim : candidates.keySet()) {
DBIDs nextSet = candidates.get(nextDim);
ModifiableDBIDs nextIntersection = DBIDUtil.intersection(set... | java | private int maxIntersection(Map<Integer, ModifiableDBIDs> candidates, ModifiableDBIDs set) {
int maxDim = -1;
ModifiableDBIDs maxIntersection = null;
for(Integer nextDim : candidates.keySet()) {
DBIDs nextSet = candidates.get(nextDim);
ModifiableDBIDs nextIntersection = DBIDUtil.intersection(set... | [
"private",
"int",
"maxIntersection",
"(",
"Map",
"<",
"Integer",
",",
"ModifiableDBIDs",
">",
"candidates",
",",
"ModifiableDBIDs",
"set",
")",
"{",
"int",
"maxDim",
"=",
"-",
"1",
";",
"ModifiableDBIDs",
"maxIntersection",
"=",
"null",
";",
"for",
"(",
"Int... | Returns the index of the set having the maximum intersection set with the
specified set contained in the specified map.
@param candidates the map containing the sets
@param set the set to intersect with and output the result to
@return the set with the maximum size | [
"Returns",
"the",
"index",
"of",
"the",
"set",
"having",
"the",
"maximum",
"intersection",
"set",
"with",
"the",
"specified",
"set",
"contained",
"in",
"the",
"specified",
"map",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java#L334-L350 |
osglworks/java-tool | src/main/java/org/osgl/util/FastStr.java | FastStr.unsafeOf | @SuppressWarnings("unused")
public static FastStr unsafeOf(char[] buf) {
E.NPE(buf);
return new FastStr(buf, 0, buf.length);
} | java | @SuppressWarnings("unused")
public static FastStr unsafeOf(char[] buf) {
E.NPE(buf);
return new FastStr(buf, 0, buf.length);
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"static",
"FastStr",
"unsafeOf",
"(",
"char",
"[",
"]",
"buf",
")",
"{",
"E",
".",
"NPE",
"(",
"buf",
")",
";",
"return",
"new",
"FastStr",
"(",
"buf",
",",
"0",
",",
"buf",
".",
"length",
... | Construct a FastStr instance from char array without array copying
@param buf the char array
@return a FastStr instance from the char array | [
"Construct",
"a",
"FastStr",
"instance",
"from",
"char",
"array",
"without",
"array",
"copying"
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/FastStr.java#L1674-L1678 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java | NetworkServiceDescriptorAgent.deleteSecurity | @Help(help = "Delete the Security of a NetworkServiceDescriptor with specific id")
public void deleteSecurity(final String idNsd, final String idSecurity) throws SDKException {
String url = idNsd + "/security" + "/" + idSecurity;
requestDelete(url);
} | java | @Help(help = "Delete the Security of a NetworkServiceDescriptor with specific id")
public void deleteSecurity(final String idNsd, final String idSecurity) throws SDKException {
String url = idNsd + "/security" + "/" + idSecurity;
requestDelete(url);
} | [
"@",
"Help",
"(",
"help",
"=",
"\"Delete the Security of a NetworkServiceDescriptor with specific id\"",
")",
"public",
"void",
"deleteSecurity",
"(",
"final",
"String",
"idNsd",
",",
"final",
"String",
"idSecurity",
")",
"throws",
"SDKException",
"{",
"String",
"url",
... | Delete a Security object.
@param idNsd the NetworkServiceDescriptor's ID
@param idSecurity the Security object's ID
@throws SDKException if the request fails | [
"Delete",
"a",
"Security",
"object",
"."
] | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java#L412-L416 |
radkovo/CSSBox | src/main/java/org/fit/cssbox/layout/VisualContext.java | VisualContext.getFontName | private String getFontName(TermList list, CSSProperty.FontWeight weight, CSSProperty.FontStyle style)
{
for (Term<?> term : list)
{
Object value = term.getValue();
if (value instanceof CSSProperty.FontFamily)
return ((CSSProperty.FontFamily) value).getAWTValue... | java | private String getFontName(TermList list, CSSProperty.FontWeight weight, CSSProperty.FontStyle style)
{
for (Term<?> term : list)
{
Object value = term.getValue();
if (value instanceof CSSProperty.FontFamily)
return ((CSSProperty.FontFamily) value).getAWTValue... | [
"private",
"String",
"getFontName",
"(",
"TermList",
"list",
",",
"CSSProperty",
".",
"FontWeight",
"weight",
",",
"CSSProperty",
".",
"FontStyle",
"style",
")",
"{",
"for",
"(",
"Term",
"<",
"?",
">",
"term",
":",
"list",
")",
"{",
"Object",
"value",
"=... | Scans a list of font definitions and chooses the first one that is available
@param list of terms obtained from the font-family property
@return a font name string according to java.awt.Font | [
"Scans",
"a",
"list",
"of",
"font",
"definitions",
"and",
"chooses",
"the",
"first",
"one",
"that",
"is",
"available"
] | train | https://github.com/radkovo/CSSBox/blob/38aaf8f22d233d7b4dbc12a56cdbc72b447bc559/src/main/java/org/fit/cssbox/layout/VisualContext.java#L609-L624 |
dmerkushov/log-helper | src/main/java/ru/dmerkushov/loghelper/LoggerWrapper.java | LoggerWrapper.logDomNode | public void logDomNode (String msg, Node node, Level level, StackTraceElement caller) {
String toLog = (msg != null ? msg + "\n" : "DOM node:\n") + domNodeDescription (node, 0);
if (caller != null) {
logger.logp (level, caller.getClassName (), caller.getMethodName () + "():" + caller.getLineNumber (), toLog);
... | java | public void logDomNode (String msg, Node node, Level level, StackTraceElement caller) {
String toLog = (msg != null ? msg + "\n" : "DOM node:\n") + domNodeDescription (node, 0);
if (caller != null) {
logger.logp (level, caller.getClassName (), caller.getMethodName () + "():" + caller.getLineNumber (), toLog);
... | [
"public",
"void",
"logDomNode",
"(",
"String",
"msg",
",",
"Node",
"node",
",",
"Level",
"level",
",",
"StackTraceElement",
"caller",
")",
"{",
"String",
"toLog",
"=",
"(",
"msg",
"!=",
"null",
"?",
"msg",
"+",
"\"\\n\"",
":",
"\"DOM node:\\n\"",
")",
"+... | Log a DOM node at a given logging level and a specified caller
@param msg The message to show with the node, or null if no message needed
@param node
@param level
@param caller The caller's stack trace element
@see ru.dmerkushov.loghelper.StackTraceUtils#getMyStackTraceElement() | [
"Log",
"a",
"DOM",
"node",
"at",
"a",
"given",
"logging",
"level",
"and",
"a",
"specified",
"caller"
] | train | https://github.com/dmerkushov/log-helper/blob/3b7d3d30faa7f1437b27cd07c10fa579a995de23/src/main/java/ru/dmerkushov/loghelper/LoggerWrapper.java#L466-L474 |
apereo/cas | support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/response/callback/OAuth20TokenAuthorizationResponseBuilder.java | OAuth20TokenAuthorizationResponseBuilder.buildCallbackUrlResponseType | protected ModelAndView buildCallbackUrlResponseType(final AccessTokenRequestDataHolder holder,
final String redirectUri,
final AccessToken accessToken,
... | java | protected ModelAndView buildCallbackUrlResponseType(final AccessTokenRequestDataHolder holder,
final String redirectUri,
final AccessToken accessToken,
... | [
"protected",
"ModelAndView",
"buildCallbackUrlResponseType",
"(",
"final",
"AccessTokenRequestDataHolder",
"holder",
",",
"final",
"String",
"redirectUri",
",",
"final",
"AccessToken",
"accessToken",
",",
"final",
"List",
"<",
"NameValuePair",
">",
"params",
",",
"final... | Build callback url response type string.
@param holder the holder
@param redirectUri the redirect uri
@param accessToken the access token
@param params the params
@param refreshToken the refresh token
@param context the context
@return the string
@throws Exception the exception | [
"Build",
"callback",
"url",
"response",
"type",
"string",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/response/callback/OAuth20TokenAuthorizationResponseBuilder.java#L67-L131 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.unmarshallPlanVersion | public static PlanVersionBean unmarshallPlanVersion(Map<String, Object> source) {
if (source == null) {
return null;
}
PlanVersionBean bean = new PlanVersionBean();
bean.setVersion(asString(source.get("version")));
bean.setStatus(asEnum(source.get("status"), PlanStatu... | java | public static PlanVersionBean unmarshallPlanVersion(Map<String, Object> source) {
if (source == null) {
return null;
}
PlanVersionBean bean = new PlanVersionBean();
bean.setVersion(asString(source.get("version")));
bean.setStatus(asEnum(source.get("status"), PlanStatu... | [
"public",
"static",
"PlanVersionBean",
"unmarshallPlanVersion",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"PlanVersionBean",
"bean",
"=",
"new",
"PlanVersionBea... | Unmarshals the given map source into a bean.
@param source the source
@return the plan version | [
"Unmarshals",
"the",
"given",
"map",
"source",
"into",
"a",
"bean",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L864-L878 |
google/error-prone-javac | src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java | ElementFilter.exportsIn | public static List<ExportsDirective>
exportsIn(Iterable<? extends Directive> directives) {
return listFilter(directives, DirectiveKind.EXPORTS, ExportsDirective.class);
} | java | public static List<ExportsDirective>
exportsIn(Iterable<? extends Directive> directives) {
return listFilter(directives, DirectiveKind.EXPORTS, ExportsDirective.class);
} | [
"public",
"static",
"List",
"<",
"ExportsDirective",
">",
"exportsIn",
"(",
"Iterable",
"<",
"?",
"extends",
"Directive",
">",
"directives",
")",
"{",
"return",
"listFilter",
"(",
"directives",
",",
"DirectiveKind",
".",
"EXPORTS",
",",
"ExportsDirective",
".",
... | Returns a list of {@code exports} directives in {@code directives}.
@return a list of {@code exports} directives in {@code directives}
@param directives the directives to filter
@since 9
@spec JPMS | [
"Returns",
"a",
"list",
"of",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java#L243-L246 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ClassUtils.java | ClassUtils.isAssignable | @GwtIncompatible("incompatible method")
public static boolean isAssignable(final Class<?>[] classArray, final Class<?>... toClassArray) {
return isAssignable(classArray, toClassArray, SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_5));
} | java | @GwtIncompatible("incompatible method")
public static boolean isAssignable(final Class<?>[] classArray, final Class<?>... toClassArray) {
return isAssignable(classArray, toClassArray, SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_5));
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"boolean",
"isAssignable",
"(",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"classArray",
",",
"final",
"Class",
"<",
"?",
">",
"...",
"toClassArray",
")",
"{",
"return",
"isAssi... | <p>Checks if an array of Classes can be assigned to another array of Classes.</p>
<p>This method calls {@link #isAssignable(Class, Class) isAssignable} for each
Class pair in the input arrays. It can be used to check if a set of arguments
(the first parameter) are suitably compatible with a set of method parameter typ... | [
"<p",
">",
"Checks",
"if",
"an",
"array",
"of",
"Classes",
"can",
"be",
"assigned",
"to",
"another",
"array",
"of",
"Classes",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ClassUtils.java#L648-L651 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_options_PUT | public void billingAccount_line_serviceName_options_PUT(String billingAccount, String serviceName, OvhLineOptions body) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/options";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body)... | java | public void billingAccount_line_serviceName_options_PUT(String billingAccount, String serviceName, OvhLineOptions body) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/options";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body)... | [
"public",
"void",
"billingAccount_line_serviceName_options_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhLineOptions",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/line/{serviceName}/options\""... | Alter this object properties
REST: PUT /telephony/{billingAccount}/line/{serviceName}/options
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L1710-L1714 |
hubrick/vertx-rest-client | src/main/java/com/hubrick/vertx/rest/RestClientOptions.java | RestClientOptions.putGlobalHeader | public RestClientOptions putGlobalHeader(String name, String value) {
globalHeaders.add(name, value);
return this;
} | java | public RestClientOptions putGlobalHeader(String name, String value) {
globalHeaders.add(name, value);
return this;
} | [
"public",
"RestClientOptions",
"putGlobalHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"globalHeaders",
".",
"add",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add a global header which will be appended to every HTTP request.
The headers defined per request will override this headers.
@param name The name of the header
@param value The value of the header
@return a reference to this so multiple method calls can be chained together | [
"Add",
"a",
"global",
"header",
"which",
"will",
"be",
"appended",
"to",
"every",
"HTTP",
"request",
".",
"The",
"headers",
"defined",
"per",
"request",
"will",
"override",
"this",
"headers",
"."
] | train | https://github.com/hubrick/vertx-rest-client/blob/4e6715bc2fb031555fc635adbf94a53b9cfba81e/src/main/java/com/hubrick/vertx/rest/RestClientOptions.java#L134-L137 |
Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/grpc/UfsFallbackBlockWriteHandler.java | UfsFallbackBlockWriteHandler.transferToUfsBlock | private void transferToUfsBlock(BlockWriteRequestContext context, long pos) throws Exception {
OutputStream ufsOutputStream = context.getOutputStream();
long sessionId = context.getRequest().getSessionId();
long blockId = context.getRequest().getId();
TempBlockMeta block = mWorker.getBlockStore().getTe... | java | private void transferToUfsBlock(BlockWriteRequestContext context, long pos) throws Exception {
OutputStream ufsOutputStream = context.getOutputStream();
long sessionId = context.getRequest().getSessionId();
long blockId = context.getRequest().getId();
TempBlockMeta block = mWorker.getBlockStore().getTe... | [
"private",
"void",
"transferToUfsBlock",
"(",
"BlockWriteRequestContext",
"context",
",",
"long",
"pos",
")",
"throws",
"Exception",
"{",
"OutputStream",
"ufsOutputStream",
"=",
"context",
".",
"getOutputStream",
"(",
")",
";",
"long",
"sessionId",
"=",
"context",
... | Transfers data from block store to UFS.
@param context context of this request
@param pos number of bytes in block store to write in the UFS block | [
"Transfers",
"data",
"from",
"block",
"store",
"to",
"UFS",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/UfsFallbackBlockWriteHandler.java#L242-L252 |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/SynchroReader.java | SynchroReader.processPredecessor | private void processPredecessor(Task task, MapRow row)
{
Task predecessor = m_taskMap.get(row.getUUID("PREDECESSOR_UUID"));
if (predecessor != null)
{
task.addPredecessor(predecessor, row.getRelationType("RELATION_TYPE"), row.getDuration("LAG"));
}
} | java | private void processPredecessor(Task task, MapRow row)
{
Task predecessor = m_taskMap.get(row.getUUID("PREDECESSOR_UUID"));
if (predecessor != null)
{
task.addPredecessor(predecessor, row.getRelationType("RELATION_TYPE"), row.getDuration("LAG"));
}
} | [
"private",
"void",
"processPredecessor",
"(",
"Task",
"task",
",",
"MapRow",
"row",
")",
"{",
"Task",
"predecessor",
"=",
"m_taskMap",
".",
"get",
"(",
"row",
".",
"getUUID",
"(",
"\"PREDECESSOR_UUID\"",
")",
")",
";",
"if",
"(",
"predecessor",
"!=",
"null... | Extract data for a single predecessor.
@param task parent task
@param row Synchro predecessor data | [
"Extract",
"data",
"for",
"a",
"single",
"predecessor",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/SynchroReader.java#L396-L403 |
OpenLiberty/open-liberty | dev/com.ibm.rls.jdbc/src/com/ibm/rls/jdbc/SQLRecoveryLogFactory.java | SQLRecoveryLogFactory.createRecoveryLog | @Override
public RecoveryLog createRecoveryLog(CustomLogProperties props, RecoveryAgent agent, RecoveryLogComponent logComp, FailureScope fs) throws InvalidLogPropertiesException {
if (tc.isEntryEnabled())
Tr.entry(tc, "createRecoveryLog", new Object[] { props, agent, logComp, fs });
SQ... | java | @Override
public RecoveryLog createRecoveryLog(CustomLogProperties props, RecoveryAgent agent, RecoveryLogComponent logComp, FailureScope fs) throws InvalidLogPropertiesException {
if (tc.isEntryEnabled())
Tr.entry(tc, "createRecoveryLog", new Object[] { props, agent, logComp, fs });
SQ... | [
"@",
"Override",
"public",
"RecoveryLog",
"createRecoveryLog",
"(",
"CustomLogProperties",
"props",
",",
"RecoveryAgent",
"agent",
",",
"RecoveryLogComponent",
"logComp",
",",
"FailureScope",
"fs",
")",
"throws",
"InvalidLogPropertiesException",
"{",
"if",
"(",
"tc",
... | /*
createRecoveryLog
@param props properties to be associated with the new recovery log (eg DBase config)
@param agent RecoveryAgent which provides client service data eg clientId
@param logcomp RecoveryLogComponent which can be used by the recovery log to notify failures
@param failureScope the failurescope (serve... | [
"/",
"*",
"createRecoveryLog"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.rls.jdbc/src/com/ibm/rls/jdbc/SQLRecoveryLogFactory.java#L67-L77 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/reflect/TypeMatcher.java | TypeMatcher.matchValueByName | public static boolean matchValueByName(String expectedType, Object actualValue) {
if (expectedType == null)
return true;
if (actualValue == null)
throw new NullPointerException("Actual value cannot be null");
return matchTypeByName(expectedType, actualValue.getClass());
} | java | public static boolean matchValueByName(String expectedType, Object actualValue) {
if (expectedType == null)
return true;
if (actualValue == null)
throw new NullPointerException("Actual value cannot be null");
return matchTypeByName(expectedType, actualValue.getClass());
} | [
"public",
"static",
"boolean",
"matchValueByName",
"(",
"String",
"expectedType",
",",
"Object",
"actualValue",
")",
"{",
"if",
"(",
"expectedType",
"==",
"null",
")",
"return",
"true",
";",
"if",
"(",
"actualValue",
"==",
"null",
")",
"throw",
"new",
"NullP... | Matches expected type to a type of a value.
@param expectedType an expected type name to match.
@param actualValue a value to match its type to the expected one.
@return true if types are matching and false if they don't. | [
"Matches",
"expected",
"type",
"to",
"a",
"type",
"of",
"a",
"value",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/reflect/TypeMatcher.java#L74-L81 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/GlobusCredential.java | GlobusCredential.verify | public void verify() throws GlobusCredentialException {
try {
String caCertsLocation = "file:" + CoGProperties.getDefault().getCaCertLocations();
String crlPattern = caCertsLocation + "/*.r*";
String sigPolPattern = caCertsLocation + "/*.signing_policy";
KeyStore ... | java | public void verify() throws GlobusCredentialException {
try {
String caCertsLocation = "file:" + CoGProperties.getDefault().getCaCertLocations();
String crlPattern = caCertsLocation + "/*.r*";
String sigPolPattern = caCertsLocation + "/*.signing_policy";
KeyStore ... | [
"public",
"void",
"verify",
"(",
")",
"throws",
"GlobusCredentialException",
"{",
"try",
"{",
"String",
"caCertsLocation",
"=",
"\"file:\"",
"+",
"CoGProperties",
".",
"getDefault",
"(",
")",
".",
"getCaCertLocations",
"(",
")",
";",
"String",
"crlPattern",
"=",... | Verifies the validity of the credentials. All certificate path validation is performed using trusted
certificates in default locations.
@exception GlobusCredentialException
if one of the certificates in the chain expired or if path validiation fails. | [
"Verifies",
"the",
"validity",
"of",
"the",
"credentials",
".",
"All",
"certificate",
"path",
"validation",
"is",
"performed",
"using",
"trusted",
"certificates",
"in",
"default",
"locations",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/GlobusCredential.java#L158-L174 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseKeepAliveEnabled | private void parseKeepAliveEnabled(Map<Object, Object> props) {
boolean flag = this.bKeepAliveEnabled;
Object value = props.get(HttpConfigConstants.PROPNAME_KEEPALIVE_ENABLED);
if (null != value) {
flag = convertBoolean(value);
}
this.bKeepAliveEnabled = flag;
... | java | private void parseKeepAliveEnabled(Map<Object, Object> props) {
boolean flag = this.bKeepAliveEnabled;
Object value = props.get(HttpConfigConstants.PROPNAME_KEEPALIVE_ENABLED);
if (null != value) {
flag = convertBoolean(value);
}
this.bKeepAliveEnabled = flag;
... | [
"private",
"void",
"parseKeepAliveEnabled",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"boolean",
"flag",
"=",
"this",
".",
"bKeepAliveEnabled",
";",
"Object",
"value",
"=",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNA... | Check the input configuration for the default flag on whether to use
persistent connections or not. If this is false, then the other related
configuration values will be ignored (such as MaxKeepAliveRequests).
@param props | [
"Check",
"the",
"input",
"configuration",
"for",
"the",
"default",
"flag",
"on",
"whether",
"to",
"use",
"persistent",
"connections",
"or",
"not",
".",
"If",
"this",
"is",
"false",
"then",
"the",
"other",
"related",
"configuration",
"values",
"will",
"be",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L490-L500 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/protocol/authentication/DefaultAuthenticationProvider.java | DefaultAuthenticationProvider.processAuthPlugin | public static AuthenticationPlugin processAuthPlugin(String plugin,
String password,
byte[] authData,
Options options)
throws SQLException {
swit... | java | public static AuthenticationPlugin processAuthPlugin(String plugin,
String password,
byte[] authData,
Options options)
throws SQLException {
swit... | [
"public",
"static",
"AuthenticationPlugin",
"processAuthPlugin",
"(",
"String",
"plugin",
",",
"String",
"password",
",",
"byte",
"[",
"]",
"authData",
",",
"Options",
"options",
")",
"throws",
"SQLException",
"{",
"switch",
"(",
"plugin",
")",
"{",
"case",
"M... | Process AuthenticationSwitch.
@param plugin plugin name
@param password password
@param authData auth data
@param options connection string options
@return authentication response according to parameters
@throws SQLException if error occur. | [
"Process",
"AuthenticationSwitch",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/authentication/DefaultAuthenticationProvider.java#L86-L110 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CciConnFactoryCodeGen.java | CciConnFactoryCodeGen.writeConnection | private void writeConnection(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Gets a connection to an EIS instance. \n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent, " * @return Connecti... | java | private void writeConnection(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Gets a connection to an EIS instance. \n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent, " * @return Connecti... | [
"private",
"void",
"writeConnection",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"ind... | Output Connection method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"Connection",
"method"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CciConnFactoryCodeGen.java#L117-L153 |
sagiegurari/fax4j | src/main/java/org/fax4j/bridge/AbstractRequestParser.java | AbstractRequestParser.updateFaxJobFromInputData | public void updateFaxJobFromInputData(T inputData,FaxJob faxJob)
{
if(!this.initialized)
{
throw new FaxException("Fax bridge not initialized.");
}
//get fax job
this.updateFaxJobFromInputDataImpl(inputData,faxJob);
} | java | public void updateFaxJobFromInputData(T inputData,FaxJob faxJob)
{
if(!this.initialized)
{
throw new FaxException("Fax bridge not initialized.");
}
//get fax job
this.updateFaxJobFromInputDataImpl(inputData,faxJob);
} | [
"public",
"void",
"updateFaxJobFromInputData",
"(",
"T",
"inputData",
",",
"FaxJob",
"faxJob",
")",
"{",
"if",
"(",
"!",
"this",
".",
"initialized",
")",
"{",
"throw",
"new",
"FaxException",
"(",
"\"Fax bridge not initialized.\"",
")",
";",
"}",
"//get fax job",... | This function update the fax job from the input data.<br>
This fax job will not have any file data.
@param inputData
The input data
@param faxJob
The fax job to update | [
"This",
"function",
"update",
"the",
"fax",
"job",
"from",
"the",
"input",
"data",
".",
"<br",
">",
"This",
"fax",
"job",
"will",
"not",
"have",
"any",
"file",
"data",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/bridge/AbstractRequestParser.java#L82-L91 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/LegacyAddress.java | LegacyAddress.fromPubKeyHash | public static LegacyAddress fromPubKeyHash(NetworkParameters params, byte[] hash160) throws AddressFormatException {
return new LegacyAddress(params, false, hash160);
} | java | public static LegacyAddress fromPubKeyHash(NetworkParameters params, byte[] hash160) throws AddressFormatException {
return new LegacyAddress(params, false, hash160);
} | [
"public",
"static",
"LegacyAddress",
"fromPubKeyHash",
"(",
"NetworkParameters",
"params",
",",
"byte",
"[",
"]",
"hash160",
")",
"throws",
"AddressFormatException",
"{",
"return",
"new",
"LegacyAddress",
"(",
"params",
",",
"false",
",",
"hash160",
")",
";",
"}... | Construct a {@link LegacyAddress} that represents the given pubkey hash. The resulting address will be a P2PKH type of
address.
@param params
network this address is valid for
@param hash160
20-byte pubkey hash
@return constructed address | [
"Construct",
"a",
"{",
"@link",
"LegacyAddress",
"}",
"that",
"represents",
"the",
"given",
"pubkey",
"hash",
".",
"The",
"resulting",
"address",
"will",
"be",
"a",
"P2PKH",
"type",
"of",
"address",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/LegacyAddress.java#L84-L86 |
beihaifeiwu/dolphin | dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/plugin/upsert/AbstractUpsertPlugin.java | AbstractUpsertPlugin.addSingleUpsertToSqlMap | protected void addSingleUpsertToSqlMap(Document document, IntrospectedTable introspectedTable) {
XmlElement update = new XmlElement("update");
update.addAttribute(new Attribute("id", UPSERT));
update.addAttribute(new Attribute("parameterType", "map"));
generateSqlMapContent(introspectedTable, update);
... | java | protected void addSingleUpsertToSqlMap(Document document, IntrospectedTable introspectedTable) {
XmlElement update = new XmlElement("update");
update.addAttribute(new Attribute("id", UPSERT));
update.addAttribute(new Attribute("parameterType", "map"));
generateSqlMapContent(introspectedTable, update);
... | [
"protected",
"void",
"addSingleUpsertToSqlMap",
"(",
"Document",
"document",
",",
"IntrospectedTable",
"introspectedTable",
")",
"{",
"XmlElement",
"update",
"=",
"new",
"XmlElement",
"(",
"\"update\"",
")",
";",
"update",
".",
"addAttribute",
"(",
"new",
"Attribute... | add update xml element to mapper.xml for upsert
@param document The generated xml mapper dom
@param introspectedTable The metadata for database table | [
"add",
"update",
"xml",
"element",
"to",
"mapper",
".",
"xml",
"for",
"upsert"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/plugin/upsert/AbstractUpsertPlugin.java#L91-L99 |
authorjapps/zerocode | core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java | BasicHttpClient.handleHeaders | public RequestBuilder handleHeaders(Map<String, Object> headers, RequestBuilder requestBuilder) {
Map<String, Object> amendedHeaders = amendRequestHeaders(headers);
processFrameworkDefault(amendedHeaders, requestBuilder);
return requestBuilder;
} | java | public RequestBuilder handleHeaders(Map<String, Object> headers, RequestBuilder requestBuilder) {
Map<String, Object> amendedHeaders = amendRequestHeaders(headers);
processFrameworkDefault(amendedHeaders, requestBuilder);
return requestBuilder;
} | [
"public",
"RequestBuilder",
"handleHeaders",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"RequestBuilder",
"requestBuilder",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"amendedHeaders",
"=",
"amendRequestHeaders",
"(",
"headers",
")",... | The framework will fall back to this default implementation to handle the headers.
If you want to override any headers, you can do that by overriding the
amendRequestHeaders(headers) method.
@param headers
@param requestBuilder
@return : An effective Apache http request builder object with processed headers. | [
"The",
"framework",
"will",
"fall",
"back",
"to",
"this",
"default",
"implementation",
"to",
"handle",
"the",
"headers",
".",
"If",
"you",
"want",
"to",
"override",
"any",
"headers",
"you",
"can",
"do",
"that",
"by",
"overriding",
"the",
"amendRequestHeaders",... | train | https://github.com/authorjapps/zerocode/blob/d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef/core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java#L236-L240 |
OpenLiberty/open-liberty | dev/com.ibm.ws.springboot.utility/src/com/ibm/ws/springboot/utility/tasks/BaseCommandTask.java | BaseCommandTask.validateArgumentList | protected void validateArgumentList(String[] args) {
checkRequiredArguments(args);
// Skip the first argument as it is the task name
// Arguments and values come in pairs (expect -password).
// Anything outside of that pattern is invalid.
// Loop through, jumping in pairs except... | java | protected void validateArgumentList(String[] args) {
checkRequiredArguments(args);
// Skip the first argument as it is the task name
// Arguments and values come in pairs (expect -password).
// Anything outside of that pattern is invalid.
// Loop through, jumping in pairs except... | [
"protected",
"void",
"validateArgumentList",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"checkRequiredArguments",
"(",
"args",
")",
";",
"// Skip the first argument as it is the task name",
"// Arguments and values come in pairs (expect -password).",
"// Anything outside of that pa... | Validates that there are no unknown arguments or values specified
to the task.
@param args The script arguments
@throws IllegalArgumentException if an argument is defined is unknown | [
"Validates",
"that",
"there",
"are",
"no",
"unknown",
"arguments",
"or",
"values",
"specified",
"to",
"the",
"task",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.springboot.utility/src/com/ibm/ws/springboot/utility/tasks/BaseCommandTask.java#L196-L224 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/internal/EC2CredentialsUtils.java | EC2CredentialsUtils.readResource | public String readResource(URI endpoint) throws IOException {
return readResource(endpoint, CredentialsEndpointRetryPolicy.NO_RETRY, null);
} | java | public String readResource(URI endpoint) throws IOException {
return readResource(endpoint, CredentialsEndpointRetryPolicy.NO_RETRY, null);
} | [
"public",
"String",
"readResource",
"(",
"URI",
"endpoint",
")",
"throws",
"IOException",
"{",
"return",
"readResource",
"(",
"endpoint",
",",
"CredentialsEndpointRetryPolicy",
".",
"NO_RETRY",
",",
"null",
")",
";",
"}"
] | Connects to the given endpoint to read the resource
and returns the text contents.
If the connection fails, the request will not be retried.
@param endpoint
The service endpoint to connect to.
@return The text payload returned from the Amazon EC2 endpoint
service for the specified resource path.
@throws IOException... | [
"Connects",
"to",
"the",
"given",
"endpoint",
"to",
"read",
"the",
"resource",
"and",
"returns",
"the",
"text",
"contents",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/internal/EC2CredentialsUtils.java#L81-L83 |
groupon/robo-remote | RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java | Solo2.getView | public View getView(int id, int timeout) {
View v = null;
int RETRY_PERIOD = 250;
int retryNum = timeout / RETRY_PERIOD;
for (int i = 0; i < retryNum; i++) {
try {
v = super.getView(id);
} catch (Exception e) {}
if (v != null) {
... | java | public View getView(int id, int timeout) {
View v = null;
int RETRY_PERIOD = 250;
int retryNum = timeout / RETRY_PERIOD;
for (int i = 0; i < retryNum; i++) {
try {
v = super.getView(id);
} catch (Exception e) {}
if (v != null) {
... | [
"public",
"View",
"getView",
"(",
"int",
"id",
",",
"int",
"timeout",
")",
"{",
"View",
"v",
"=",
"null",
";",
"int",
"RETRY_PERIOD",
"=",
"250",
";",
"int",
"retryNum",
"=",
"timeout",
"/",
"RETRY_PERIOD",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";... | Extend the normal robotium getView to retry every 250ms over 10s to get the view requested
@param id Resource id of the view
@param timeout amount of time to retry getting the view
@return View that we want to find by id | [
"Extend",
"the",
"normal",
"robotium",
"getView",
"to",
"retry",
"every",
"250ms",
"over",
"10s",
"to",
"get",
"the",
"view",
"requested"
] | train | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java#L114-L130 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/simple/RDBMUserLayoutStore.java | RDBMUserLayoutStore.getLayoutID | private int getLayoutID(final int userId, final int profileId) {
return jdbcOperations.execute(
(ConnectionCallback<Integer>)
con -> {
String query =
"SELECT LAYOUT_ID "
... | java | private int getLayoutID(final int userId, final int profileId) {
return jdbcOperations.execute(
(ConnectionCallback<Integer>)
con -> {
String query =
"SELECT LAYOUT_ID "
... | [
"private",
"int",
"getLayoutID",
"(",
"final",
"int",
"userId",
",",
"final",
"int",
"profileId",
")",
"{",
"return",
"jdbcOperations",
".",
"execute",
"(",
"(",
"ConnectionCallback",
"<",
"Integer",
">",
")",
"con",
"->",
"{",
"String",
"query",
"=",
"\"S... | Returns the current layout ID for the user and profile. If the profile doesn't exist or the
layout_id field is null 0 is returned.
@param userId The userId for the profile
@param profileId The profileId for the profile
@return The layout_id field or 0 if it does not exist or is null | [
"Returns",
"the",
"current",
"layout",
"ID",
"for",
"the",
"user",
"and",
"profile",
".",
"If",
"the",
"profile",
"doesn",
"t",
"exist",
"or",
"the",
"layout_id",
"field",
"is",
"null",
"0",
"is",
"returned",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/simple/RDBMUserLayoutStore.java#L1491-L1525 |
davidmoten/rxjava-jdbc | src/main/java/com/github/davidmoten/rx/jdbc/QuerySelect.java | QuerySelect.executeOnce | private <T> Func1<List<Parameter>, Observable<T>> executeOnce(
final ResultSetMapper<? extends T> function) {
return new Func1<List<Parameter>, Observable<T>>() {
@Override
public Observable<T> call(List<Parameter> params) {
return executeOnce(params, function... | java | private <T> Func1<List<Parameter>, Observable<T>> executeOnce(
final ResultSetMapper<? extends T> function) {
return new Func1<List<Parameter>, Observable<T>>() {
@Override
public Observable<T> call(List<Parameter> params) {
return executeOnce(params, function... | [
"private",
"<",
"T",
">",
"Func1",
"<",
"List",
"<",
"Parameter",
">",
",",
"Observable",
"<",
"T",
">",
">",
"executeOnce",
"(",
"final",
"ResultSetMapper",
"<",
"?",
"extends",
"T",
">",
"function",
")",
"{",
"return",
"new",
"Func1",
"<",
"List",
... | Returns a {@link Func1} that itself returns the results of pushing one
set of parameters through a select query.
@param query
@return | [
"Returns",
"a",
"{",
"@link",
"Func1",
"}",
"that",
"itself",
"returns",
"the",
"results",
"of",
"pushing",
"one",
"set",
"of",
"parameters",
"through",
"a",
"select",
"query",
"."
] | train | https://github.com/davidmoten/rxjava-jdbc/blob/81e157d7071a825086bde81107b8694684cdff14/src/main/java/com/github/davidmoten/rx/jdbc/QuerySelect.java#L118-L126 |
structurizr/java | structurizr-core/src/com/structurizr/model/Container.java | Container.addComponent | public Component addComponent(String name, String description) {
return this.addComponent(name, description, null);
} | java | public Component addComponent(String name, String description) {
return this.addComponent(name, description, null);
} | [
"public",
"Component",
"addComponent",
"(",
"String",
"name",
",",
"String",
"description",
")",
"{",
"return",
"this",
".",
"addComponent",
"(",
"name",
",",
"description",
",",
"null",
")",
";",
"}"
] | Adds a component to this container.
@param name the name of the component
@param description a description of the component
@return the resulting Component instance
@throws IllegalArgumentException if the component name is null or empty, or a component with the same name already exists | [
"Adds",
"a",
"component",
"to",
"this",
"container",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/Container.java#L72-L74 |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java | DefaultComparisonFormatter.getFormattedNodeXml | protected String getFormattedNodeXml(final Node nodeToConvert, boolean formatXml) {
String formattedNodeXml;
try {
final int numberOfBlanksToIndent = formatXml ? 2 : -1;
final Transformer transformer = createXmlTransformer(numberOfBlanksToIndent);
final StringWriter b... | java | protected String getFormattedNodeXml(final Node nodeToConvert, boolean formatXml) {
String formattedNodeXml;
try {
final int numberOfBlanksToIndent = formatXml ? 2 : -1;
final Transformer transformer = createXmlTransformer(numberOfBlanksToIndent);
final StringWriter b... | [
"protected",
"String",
"getFormattedNodeXml",
"(",
"final",
"Node",
"nodeToConvert",
",",
"boolean",
"formatXml",
")",
"{",
"String",
"formattedNodeXml",
";",
"try",
"{",
"final",
"int",
"numberOfBlanksToIndent",
"=",
"formatXml",
"?",
"2",
":",
"-",
"1",
";",
... | Formats a node with the help of an identity XML transformation.
@param nodeToConvert the node to format
@param formatXml true if the Comparison was generated with {@link
org.xmlunit.builder.DiffBuilder#ignoreWhitespace()} - this affects the indentation of the generated output
@return the fomatted XML
@since XMLUnit 2... | [
"Formats",
"a",
"node",
"with",
"the",
"help",
"of",
"an",
"identity",
"XML",
"transformation",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java#L433-L445 |
GCRC/nunaliit | nunaliit2-auth-cookie/src/main/java/ca/carleton/gcrc/auth/cookie/AuthServlet.java | AuthServlet.performAdjustCookies | private void performAdjustCookies(HttpServletRequest request, HttpServletResponse response) throws Exception {
boolean loggedIn = false;
User user = null;
try {
Cookie cookie = getCookieFromRequest(request);
if( null != cookie ) {
user = CookieAuthentication.verifyCookieString(userRepository, cookie.ge... | java | private void performAdjustCookies(HttpServletRequest request, HttpServletResponse response) throws Exception {
boolean loggedIn = false;
User user = null;
try {
Cookie cookie = getCookieFromRequest(request);
if( null != cookie ) {
user = CookieAuthentication.verifyCookieString(userRepository, cookie.ge... | [
"private",
"void",
"performAdjustCookies",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"Exception",
"{",
"boolean",
"loggedIn",
"=",
"false",
";",
"User",
"user",
"=",
"null",
";",
"try",
"{",
"Cookie",
"cookie",
... | Adjusts the information cookie based on the authentication token
@param request
@param response
@throws ServletException
@throws IOException | [
"Adjusts",
"the",
"information",
"cookie",
"based",
"on",
"the",
"authentication",
"token"
] | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-auth-cookie/src/main/java/ca/carleton/gcrc/auth/cookie/AuthServlet.java#L186-L205 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_timeCondition_serviceName_condition_id_GET | public OvhTimeCondition billingAccount_timeCondition_serviceName_condition_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
String qPath = "/telephony/{billingAccount}/timeCondition/{serviceName}/condition/{id}";
StringBuilder sb = path(qPath, billingAccount, serviceName, id);
Strin... | java | public OvhTimeCondition billingAccount_timeCondition_serviceName_condition_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
String qPath = "/telephony/{billingAccount}/timeCondition/{serviceName}/condition/{id}";
StringBuilder sb = path(qPath, billingAccount, serviceName, id);
Strin... | [
"public",
"OvhTimeCondition",
"billingAccount_timeCondition_serviceName_condition_id_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/timeCondition/{... | Get this object properties
REST: GET /telephony/{billingAccount}/timeCondition/{serviceName}/condition/{id}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param id [required] Id of the object | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5825-L5830 |
arxanchain/java-common | src/main/java/com/arxanfintech/common/util/ByteUtils.java | ByteUtils.toBase58 | public static String toBase58(byte[] b) {
if (b.length == 0) {
return "";
}
int lz = 0;
while (lz < b.length && b[lz] == 0) {
++lz;
}
StringBuilder s = new StringBuilder();
BigInteger n = new BigInteger(1, b);
while (n.compareTo(B... | java | public static String toBase58(byte[] b) {
if (b.length == 0) {
return "";
}
int lz = 0;
while (lz < b.length && b[lz] == 0) {
++lz;
}
StringBuilder s = new StringBuilder();
BigInteger n = new BigInteger(1, b);
while (n.compareTo(B... | [
"public",
"static",
"String",
"toBase58",
"(",
"byte",
"[",
"]",
"b",
")",
"{",
"if",
"(",
"b",
".",
"length",
"==",
"0",
")",
"{",
"return",
"\"\"",
";",
"}",
"int",
"lz",
"=",
"0",
";",
"while",
"(",
"lz",
"<",
"b",
".",
"length",
"&&",
"b"... | convert a byte array to a human readable base58 string. Base58 is a Bitcoin
specific encoding similar to widely used base64 but avoids using characters
of similar shape, such as 1 and l or O an 0
@param b
byte data
@return base58 data | [
"convert",
"a",
"byte",
"array",
"to",
"a",
"human",
"readable",
"base58",
"string",
".",
"Base58",
"is",
"a",
"Bitcoin",
"specific",
"encoding",
"similar",
"to",
"widely",
"used",
"base64",
"but",
"avoids",
"using",
"characters",
"of",
"similar",
"shape",
"... | train | https://github.com/arxanchain/java-common/blob/3ddfedfd948f5bab3fee0b74b85cdce4702ed84e/src/main/java/com/arxanfintech/common/util/ByteUtils.java#L52-L75 |
dnsjava/dnsjava | org/xbill/DNS/SimpleResolver.java | SimpleResolver.sendAsync | public Object
sendAsync(final Message query, final ResolverListener listener) {
final Object id;
synchronized (this) {
id = new Integer(uniqueID++);
}
Record question = query.getQuestion();
String qname;
if (question != null)
qname = question.getName().toString();
else
qname = "(none)";
String name = this... | java | public Object
sendAsync(final Message query, final ResolverListener listener) {
final Object id;
synchronized (this) {
id = new Integer(uniqueID++);
}
Record question = query.getQuestion();
String qname;
if (question != null)
qname = question.getName().toString();
else
qname = "(none)";
String name = this... | [
"public",
"Object",
"sendAsync",
"(",
"final",
"Message",
"query",
",",
"final",
"ResolverListener",
"listener",
")",
"{",
"final",
"Object",
"id",
";",
"synchronized",
"(",
"this",
")",
"{",
"id",
"=",
"new",
"Integer",
"(",
"uniqueID",
"++",
")",
";",
... | Asynchronously sends a message to a single server, registering a listener
to receive a callback on success or exception. Multiple asynchronous
lookups can be performed in parallel. Since the callback may be invoked
before the function returns, external synchronization is necessary.
@param query The query to send
@par... | [
"Asynchronously",
"sends",
"a",
"message",
"to",
"a",
"single",
"server",
"registering",
"a",
"listener",
"to",
"receive",
"a",
"callback",
"on",
"success",
"or",
"exception",
".",
"Multiple",
"asynchronous",
"lookups",
"can",
"be",
"performed",
"in",
"parallel"... | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/SimpleResolver.java#L308-L326 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java | AptControlImplementation.initClients | protected ArrayList<AptClientField> initClients()
{
ArrayList<AptClientField> clients = new ArrayList<AptClientField>();
if ( _implDecl == null || _implDecl.getFields() == null )
return clients;
Collection<FieldDeclaration> declaredFields = _implDecl.getFields();
... | java | protected ArrayList<AptClientField> initClients()
{
ArrayList<AptClientField> clients = new ArrayList<AptClientField>();
if ( _implDecl == null || _implDecl.getFields() == null )
return clients;
Collection<FieldDeclaration> declaredFields = _implDecl.getFields();
... | [
"protected",
"ArrayList",
"<",
"AptClientField",
">",
"initClients",
"(",
")",
"{",
"ArrayList",
"<",
"AptClientField",
">",
"clients",
"=",
"new",
"ArrayList",
"<",
"AptClientField",
">",
"(",
")",
";",
"if",
"(",
"_implDecl",
"==",
"null",
"||",
"_implDecl... | Initializes the list of ClientFields declared directly by this ControlImpl | [
"Initializes",
"the",
"list",
"of",
"ClientFields",
"declared",
"directly",
"by",
"this",
"ControlImpl"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java#L188-L202 |
mikepenz/Materialize | library/src/main/java/com/mikepenz/materialize/holder/ColorHolder.java | ColorHolder.applyToOr | public void applyToOr(TextView textView, ColorStateList colorDefault) {
if (mColorInt != 0) {
textView.setTextColor(mColorInt);
} else if (mColorRes != -1) {
textView.setTextColor(ContextCompat.getColor(textView.getContext(), mColorRes));
} else if (colorDefault != null) ... | java | public void applyToOr(TextView textView, ColorStateList colorDefault) {
if (mColorInt != 0) {
textView.setTextColor(mColorInt);
} else if (mColorRes != -1) {
textView.setTextColor(ContextCompat.getColor(textView.getContext(), mColorRes));
} else if (colorDefault != null) ... | [
"public",
"void",
"applyToOr",
"(",
"TextView",
"textView",
",",
"ColorStateList",
"colorDefault",
")",
"{",
"if",
"(",
"mColorInt",
"!=",
"0",
")",
"{",
"textView",
".",
"setTextColor",
"(",
"mColorInt",
")",
";",
"}",
"else",
"if",
"(",
"mColorRes",
"!="... | a small helper to set the text color to a textView null save
@param textView
@param colorDefault | [
"a",
"small",
"helper",
"to",
"set",
"the",
"text",
"color",
"to",
"a",
"textView",
"null",
"save"
] | train | https://github.com/mikepenz/Materialize/blob/2612c10c7570191a78d57f23620e945d61370e3d/library/src/main/java/com/mikepenz/materialize/holder/ColorHolder.java#L89-L97 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthService.java | HttpAuthService.newDecorator | @SafeVarargs
public static Function<Service<HttpRequest, HttpResponse>, HttpAuthService>
newDecorator(Authorizer<HttpRequest>... authorizers) {
return newDecorator(ImmutableList.copyOf(requireNonNull(authorizers, "authorizers")));
} | java | @SafeVarargs
public static Function<Service<HttpRequest, HttpResponse>, HttpAuthService>
newDecorator(Authorizer<HttpRequest>... authorizers) {
return newDecorator(ImmutableList.copyOf(requireNonNull(authorizers, "authorizers")));
} | [
"@",
"SafeVarargs",
"public",
"static",
"Function",
"<",
"Service",
"<",
"HttpRequest",
",",
"HttpResponse",
">",
",",
"HttpAuthService",
">",
"newDecorator",
"(",
"Authorizer",
"<",
"HttpRequest",
">",
"...",
"authorizers",
")",
"{",
"return",
"newDecorator",
"... | Creates a new HTTP authorization {@link Service} decorator using the specified
{@link Authorizer}s.
@param authorizers the array of {@link Authorizer}s. | [
"Creates",
"a",
"new",
"HTTP",
"authorization",
"{",
"@link",
"Service",
"}",
"decorator",
"using",
"the",
"specified",
"{",
"@link",
"Authorizer",
"}",
"s",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthService.java#L61-L65 |
andrehertwig/admintool | admin-tools-core/src/main/java/de/chandre/admintool/core/controller/AbstractAdminController.java | AbstractAdminController.resolveLocale | protected void resolveLocale(Locale language, HttpServletRequest request, HttpServletResponse response){
final LocaleResolver localeResolver = RequestContextUtils.getLocaleResolver(request);
localeResolver.setLocale(request, response, language);
} | java | protected void resolveLocale(Locale language, HttpServletRequest request, HttpServletResponse response){
final LocaleResolver localeResolver = RequestContextUtils.getLocaleResolver(request);
localeResolver.setLocale(request, response, language);
} | [
"protected",
"void",
"resolveLocale",
"(",
"Locale",
"language",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"final",
"LocaleResolver",
"localeResolver",
"=",
"RequestContextUtils",
".",
"getLocaleResolver",
"(",
"request",
")... | manually resolve of locale ... to request. useful for path variables
@param language
@param request
@param response | [
"manually",
"resolve",
"of",
"locale",
"...",
"to",
"request",
".",
"useful",
"for",
"path",
"variables"
] | train | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-core/src/main/java/de/chandre/admintool/core/controller/AbstractAdminController.java#L149-L152 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java | GraphBackedSearchIndexer.onAdd | @Override
public void onAdd(Collection<? extends IDataType> dataTypes) throws AtlasException {
AtlasGraphManagement management = provider.get().getManagementSystem();
for (IDataType dataType : dataTypes) {
if (LOG.isDebugEnabled()) {
LOG.debug("Creating in... | java | @Override
public void onAdd(Collection<? extends IDataType> dataTypes) throws AtlasException {
AtlasGraphManagement management = provider.get().getManagementSystem();
for (IDataType dataType : dataTypes) {
if (LOG.isDebugEnabled()) {
LOG.debug("Creating in... | [
"@",
"Override",
"public",
"void",
"onAdd",
"(",
"Collection",
"<",
"?",
"extends",
"IDataType",
">",
"dataTypes",
")",
"throws",
"AtlasException",
"{",
"AtlasGraphManagement",
"management",
"=",
"provider",
".",
"get",
"(",
")",
".",
"getManagementSystem",
"(",... | This is upon adding a new type to Store.
@param dataTypes data type
@throws AtlasException | [
"This",
"is",
"upon",
"adding",
"a",
"new",
"type",
"to",
"Store",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java#L226-L248 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.setStyle | public static boolean setStyle(MarkerOptions markerOptions, StyleRow style) {
boolean styleSet = false;
if (style != null) {
Color color = style.getColorOrDefault();
float hue = color.getHue();
markerOptions.icon(BitmapDescriptorFactory.defaultMarker(hue));
... | java | public static boolean setStyle(MarkerOptions markerOptions, StyleRow style) {
boolean styleSet = false;
if (style != null) {
Color color = style.getColorOrDefault();
float hue = color.getHue();
markerOptions.icon(BitmapDescriptorFactory.defaultMarker(hue));
... | [
"public",
"static",
"boolean",
"setStyle",
"(",
"MarkerOptions",
"markerOptions",
",",
"StyleRow",
"style",
")",
"{",
"boolean",
"styleSet",
"=",
"false",
";",
"if",
"(",
"style",
"!=",
"null",
")",
"{",
"Color",
"color",
"=",
"style",
".",
"getColorOrDefaul... | Set the style into the marker options
@param markerOptions marker options
@param style style row
@return true if style was set into the marker options | [
"Set",
"the",
"style",
"into",
"the",
"marker",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L328-L340 |
StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java | ViewHelper.setVisibility | public static void setVisibility(EfficientCacheView cacheView, int viewId, int visibility) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view != null) {
view.setVisibility(visibility);
}
} | java | public static void setVisibility(EfficientCacheView cacheView, int viewId, int visibility) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view != null) {
view.setVisibility(visibility);
}
} | [
"public",
"static",
"void",
"setVisibility",
"(",
"EfficientCacheView",
"cacheView",
",",
"int",
"viewId",
",",
"int",
"visibility",
")",
"{",
"View",
"view",
"=",
"cacheView",
".",
"findViewByIdEfficient",
"(",
"viewId",
")",
";",
"if",
"(",
"view",
"!=",
"... | Equivalent to calling View.setVisibility
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose visibility should change
@param visibility The new visibility for the view | [
"Equivalent",
"to",
"calling",
"View",
".",
"setVisibility"
] | train | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java#L24-L29 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Metric.java | Metric.averageExistingDatapoints | public void averageExistingDatapoints(Map<Long, Double> datapoints) {
if (datapoints != null) {
for(Entry<Long, Double> entry : datapoints.entrySet()){
_datapoints.put(entry.getKey(), entry.getValue());
}
}
} | java | public void averageExistingDatapoints(Map<Long, Double> datapoints) {
if (datapoints != null) {
for(Entry<Long, Double> entry : datapoints.entrySet()){
_datapoints.put(entry.getKey(), entry.getValue());
}
}
} | [
"public",
"void",
"averageExistingDatapoints",
"(",
"Map",
"<",
"Long",
",",
"Double",
">",
"datapoints",
")",
"{",
"if",
"(",
"datapoints",
"!=",
"null",
")",
"{",
"for",
"(",
"Entry",
"<",
"Long",
",",
"Double",
">",
"entry",
":",
"datapoints",
".",
... | If current set already has a value at that timestamp then replace the latest average value for that timestamp at coinciding cutoff boundary,
else adds the new data points to the current set.
@param datapoints The set of data points to add. If null or empty, no operation is performed. | [
"If",
"current",
"set",
"already",
"has",
"a",
"value",
"at",
"that",
"timestamp",
"then",
"replace",
"the",
"latest",
"average",
"value",
"for",
"that",
"timestamp",
"at",
"coinciding",
"cutoff",
"boundary",
"else",
"adds",
"the",
"new",
"data",
"points",
"... | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Metric.java#L248-L255 |
agapsys/embedded-servlet-container | src/main/java/com/agapsys/jee/ServletContainer.java | ServletContainer.registerServlet | public final SC registerServlet(Class<? extends HttpServlet> servletClass) {
WebServlet webServlet = servletClass.getAnnotation(WebServlet.class);
if (webServlet == null)
throw new IllegalArgumentException(String.format("Missing annotation '%s' for class '%s'", WebFilter.class.getName(), s... | java | public final SC registerServlet(Class<? extends HttpServlet> servletClass) {
WebServlet webServlet = servletClass.getAnnotation(WebServlet.class);
if (webServlet == null)
throw new IllegalArgumentException(String.format("Missing annotation '%s' for class '%s'", WebFilter.class.getName(), s... | [
"public",
"final",
"SC",
"registerServlet",
"(",
"Class",
"<",
"?",
"extends",
"HttpServlet",
">",
"servletClass",
")",
"{",
"WebServlet",
"webServlet",
"=",
"servletClass",
".",
"getAnnotation",
"(",
"WebServlet",
".",
"class",
")",
";",
"if",
"(",
"webServle... | Registers a servlet.
@param servletClass servlet class to be registered. This class must be annotated with {@linkplain WebServlet}.
@return this. | [
"Registers",
"a",
"servlet",
"."
] | train | https://github.com/agapsys/embedded-servlet-container/blob/28314a2600ad8550ed2c901d8e35d86583c26bb0/src/main/java/com/agapsys/jee/ServletContainer.java#L360-L380 |
BlueBrain/bluima | modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/tools/tokenize/TokenizerME.java | TokenizerME.tokenizePos | public Span[] tokenizePos(String d) {
Span[] tokens = split(d);
newTokens.clear();
tokProbs.clear();
for (int i = 0, il = tokens.length; i < il; i++) {
Span s = tokens[i];
String tok = d.substring(s.getStart(), s.getEnd());
// Can't tokenize single characters
if (tok.length() < 2... | java | public Span[] tokenizePos(String d) {
Span[] tokens = split(d);
newTokens.clear();
tokProbs.clear();
for (int i = 0, il = tokens.length; i < il; i++) {
Span s = tokens[i];
String tok = d.substring(s.getStart(), s.getEnd());
// Can't tokenize single characters
if (tok.length() < 2... | [
"public",
"Span",
"[",
"]",
"tokenizePos",
"(",
"String",
"d",
")",
"{",
"Span",
"[",
"]",
"tokens",
"=",
"split",
"(",
"d",
")",
";",
"newTokens",
".",
"clear",
"(",
")",
";",
"tokProbs",
".",
"clear",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=... | Tokenizes the string.
@param d The string to be tokenized.
@return A span array containing individual tokens as elements. | [
"Tokenizes",
"the",
"string",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/tools/tokenize/TokenizerME.java#L108-L150 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Maps.java | Maps.removeEntries | public static boolean removeEntries(final Map<?, ?> map, final Map<?, ?> entriesToRemove) {
if (N.isNullOrEmpty(map) || N.isNullOrEmpty(entriesToRemove)) {
return false;
}
final int originalSize = map.size();
for (Map.Entry<?, ?> entry : entriesToRemove.entrySet()) {... | java | public static boolean removeEntries(final Map<?, ?> map, final Map<?, ?> entriesToRemove) {
if (N.isNullOrEmpty(map) || N.isNullOrEmpty(entriesToRemove)) {
return false;
}
final int originalSize = map.size();
for (Map.Entry<?, ?> entry : entriesToRemove.entrySet()) {... | [
"public",
"static",
"boolean",
"removeEntries",
"(",
"final",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"final",
"Map",
"<",
"?",
",",
"?",
">",
"entriesToRemove",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"map",
")",
"||",
"N",
".",
... | The the entries from the specified <code>Map</code>
@param map
@param entriesToRemove
@return <code>true</code> if any key/value was removed, otherwise <code>false</code>. | [
"The",
"the",
"entries",
"from",
"the",
"specified",
"<code",
">",
"Map<",
"/",
"code",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Maps.java#L575-L589 |
meertensinstituut/mtas | src/main/java/mtas/parser/function/util/MtasFunctionParserFunction.java | MtasFunctionParserFunction.getResponse | public final MtasFunctionParserFunctionResponse getResponse(long[] args,
long n) {
if (dataType.equals(CodecUtil.DATA_TYPE_LONG)) {
try {
long l = getValueLong(args, n);
return new MtasFunctionParserFunctionResponseLong(l, true);
} catch (IOException e) {
log.debug(e);
... | java | public final MtasFunctionParserFunctionResponse getResponse(long[] args,
long n) {
if (dataType.equals(CodecUtil.DATA_TYPE_LONG)) {
try {
long l = getValueLong(args, n);
return new MtasFunctionParserFunctionResponseLong(l, true);
} catch (IOException e) {
log.debug(e);
... | [
"public",
"final",
"MtasFunctionParserFunctionResponse",
"getResponse",
"(",
"long",
"[",
"]",
"args",
",",
"long",
"n",
")",
"{",
"if",
"(",
"dataType",
".",
"equals",
"(",
"CodecUtil",
".",
"DATA_TYPE_LONG",
")",
")",
"{",
"try",
"{",
"long",
"l",
"=",
... | Gets the response.
@param args the args
@param n the n
@return the response | [
"Gets",
"the",
"response",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/parser/function/util/MtasFunctionParserFunction.java#L57-L78 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.removeToNextSeparator | public boolean removeToNextSeparator(Issue issue, IXtextDocument document, String separator)
throws BadLocationException {
// Skip spaces after the identifier until the separator
int index = issue.getOffset() + issue.getLength();
char c = document.getChar(index);
while (Character.isWhitespace(c)) {
index+... | java | public boolean removeToNextSeparator(Issue issue, IXtextDocument document, String separator)
throws BadLocationException {
// Skip spaces after the identifier until the separator
int index = issue.getOffset() + issue.getLength();
char c = document.getChar(index);
while (Character.isWhitespace(c)) {
index+... | [
"public",
"boolean",
"removeToNextSeparator",
"(",
"Issue",
"issue",
",",
"IXtextDocument",
"document",
",",
"String",
"separator",
")",
"throws",
"BadLocationException",
"{",
"// Skip spaces after the identifier until the separator",
"int",
"index",
"=",
"issue",
".",
"g... | Remove the element related to the issue, and the whitespaces after the element until the given separator.
@param issue the issue.
@param document the document.
@param separator the separator to consider.
@return <code>true</code> if the separator was found, <code>false</code> if not.
@throws BadLocationException if th... | [
"Remove",
"the",
"element",
"related",
"to",
"the",
"issue",
"and",
"the",
"whitespaces",
"after",
"the",
"element",
"until",
"the",
"given",
"separator",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L383-L409 |
Coveros/selenified | src/main/java/com/coveros/selenified/application/WaitFor.java | WaitFor.alertMatches | public void alertMatches(double seconds, String expectedAlertPattern) {
try {
double timeTook = popup(seconds);
timeTook = popupMatches(seconds - timeTook, expectedAlertPattern);
checkAlertMatches(expectedAlertPattern, seconds, timeTook);
} catch (TimeoutException e) ... | java | public void alertMatches(double seconds, String expectedAlertPattern) {
try {
double timeTook = popup(seconds);
timeTook = popupMatches(seconds - timeTook, expectedAlertPattern);
checkAlertMatches(expectedAlertPattern, seconds, timeTook);
} catch (TimeoutException e) ... | [
"public",
"void",
"alertMatches",
"(",
"double",
"seconds",
",",
"String",
"expectedAlertPattern",
")",
"{",
"try",
"{",
"double",
"timeTook",
"=",
"popup",
"(",
"seconds",
")",
";",
"timeTook",
"=",
"popupMatches",
"(",
"seconds",
"-",
"timeTook",
",",
"exp... | Waits up to the provided wait time for an alert present on the page has content matching the
expected patten. This information will be logged and recorded, with a
screenshot for traceability and added debugging support.
@param expectedAlertPattern the expected text of the alert
@param seconds the number o... | [
"Waits",
"up",
"to",
"the",
"provided",
"wait",
"time",
"for",
"an",
"alert",
"present",
"on",
"the",
"page",
"has",
"content",
"matching",
"the",
"expected",
"patten",
".",
"This",
"information",
"will",
"be",
"logged",
"and",
"recorded",
"with",
"a",
"sc... | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/WaitFor.java#L510-L518 |
kite-sdk/kite | kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/SignalManager.java | SignalManager.signalReady | public void signalReady(Constraints viewConstraints) {
try {
rootFileSystem.mkdirs(signalDirectory);
} catch (IOException e) {
throw new DatasetIOException("Unable to create signal manager directory: "
+ signalDirectory, e);
}
String normalizedConstraints = getNormalizedConstr... | java | public void signalReady(Constraints viewConstraints) {
try {
rootFileSystem.mkdirs(signalDirectory);
} catch (IOException e) {
throw new DatasetIOException("Unable to create signal manager directory: "
+ signalDirectory, e);
}
String normalizedConstraints = getNormalizedConstr... | [
"public",
"void",
"signalReady",
"(",
"Constraints",
"viewConstraints",
")",
"{",
"try",
"{",
"rootFileSystem",
".",
"mkdirs",
"(",
"signalDirectory",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"DatasetIOException",
"(",
"\"Unab... | Create a signal for the specified constraints.
@param viewConstraints The constraints to create a signal for.
@throws DatasetException if the signal could not be created. | [
"Create",
"a",
"signal",
"for",
"the",
"specified",
"constraints",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/SignalManager.java#L66-L85 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getApps | public List<OneLoginApp> getApps(HashMap<String, String> queryParameters) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return getApps(queryParameters, this.maxResults);
} | java | public List<OneLoginApp> getApps(HashMap<String, String> queryParameters) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return getApps(queryParameters, this.maxResults);
} | [
"public",
"List",
"<",
"OneLoginApp",
">",
"getApps",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"queryParameters",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"return",
"getApps",
"(",
"queryParameter... | Gets a list of OneLoginApp resources.
@param queryParameters Query parameters of the Resource
Parameters to filter the result of the list
@return List of OneLoginApp
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are error... | [
"Gets",
"a",
"list",
"of",
"OneLoginApp",
"resources",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L1647-L1649 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/MbeanImplCodeGen.java | MbeanImplCodeGen.writeVars | private void writeVars(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/** JNDI name */\n");
writeWithIndent(out, indent,
"private static final String JNDI_NAME = \"java:/eis/" + def.getDefaultValue() + "\";\n\n");
writeWithIndent(out, indent,... | java | private void writeVars(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/** JNDI name */\n");
writeWithIndent(out, indent,
"private static final String JNDI_NAME = \"java:/eis/" + def.getDefaultValue() + "\";\n\n");
writeWithIndent(out, indent,... | [
"private",
"void",
"writeVars",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/** JNDI name */\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",... | Output class vars
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"class",
"vars"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/MbeanImplCodeGen.java#L124-L141 |
UrielCh/ovh-java-sdk | ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java | ApiOvhRouter.serviceName_privateLink_peerServiceName_PUT | public void serviceName_privateLink_peerServiceName_PUT(String serviceName, String peerServiceName, OvhPrivateLink body) throws IOException {
String qPath = "/router/{serviceName}/privateLink/{peerServiceName}";
StringBuilder sb = path(qPath, serviceName, peerServiceName);
exec(qPath, "PUT", sb.toString(), body);... | java | public void serviceName_privateLink_peerServiceName_PUT(String serviceName, String peerServiceName, OvhPrivateLink body) throws IOException {
String qPath = "/router/{serviceName}/privateLink/{peerServiceName}";
StringBuilder sb = path(qPath, serviceName, peerServiceName);
exec(qPath, "PUT", sb.toString(), body);... | [
"public",
"void",
"serviceName_privateLink_peerServiceName_PUT",
"(",
"String",
"serviceName",
",",
"String",
"peerServiceName",
",",
"OvhPrivateLink",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/router/{serviceName}/privateLink/{peerServiceName}\"",
... | Alter this object properties
REST: PUT /router/{serviceName}/privateLink/{peerServiceName}
@param body [required] New object properties
@param serviceName [required] The internal name of your Router offer
@param peerServiceName [required] Service name of the other side of this link | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java#L331-L335 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java | RecommendationsInner.resetAllFiltersForWebAppAsync | public Observable<Void> resetAllFiltersForWebAppAsync(String resourceGroupName, String siteName) {
return resetAllFiltersForWebAppWithServiceResponseAsync(resourceGroupName, siteName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response... | java | public Observable<Void> resetAllFiltersForWebAppAsync(String resourceGroupName, String siteName) {
return resetAllFiltersForWebAppWithServiceResponseAsync(resourceGroupName, siteName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response... | [
"public",
"Observable",
"<",
"Void",
">",
"resetAllFiltersForWebAppAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
")",
"{",
"return",
"resetAllFiltersForWebAppWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"siteName",
")",
".",
"map",
... | Reset all recommendation opt-out settings for an app.
Reset all recommendation opt-out settings for an app.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Name of the app.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link Se... | [
"Reset",
"all",
"recommendation",
"opt",
"-",
"out",
"settings",
"for",
"an",
"app",
".",
"Reset",
"all",
"recommendation",
"opt",
"-",
"out",
"settings",
"for",
"an",
"app",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java#L1146-L1153 |
mfornos/humanize | humanize-slim/src/main/java/humanize/Humanize.java | Humanize.paceFormat | public static String paceFormat(final Number value, final long interval)
{
ResourceBundle b = context.get().getBundle();
PaceParameters params = PaceParameters.begin(b.getString("pace.one"))
.none(b.getString("pace.none"))
.many(b.getString("pace.many"))
... | java | public static String paceFormat(final Number value, final long interval)
{
ResourceBundle b = context.get().getBundle();
PaceParameters params = PaceParameters.begin(b.getString("pace.one"))
.none(b.getString("pace.none"))
.many(b.getString("pace.many"))
... | [
"public",
"static",
"String",
"paceFormat",
"(",
"final",
"Number",
"value",
",",
"final",
"long",
"interval",
")",
"{",
"ResourceBundle",
"b",
"=",
"context",
".",
"get",
"(",
")",
".",
"getBundle",
"(",
")",
";",
"PaceParameters",
"params",
"=",
"PacePar... | Matches a pace (value and interval) with a logical time frame. Very
useful for slow paces. e.g. heartbeats, ingested calories, hyperglycemic
crises.
@param value
The number of occurrences within the specified interval
@param interval
The interval in milliseconds
@return an human readable textual representation of the ... | [
"Matches",
"a",
"pace",
"(",
"value",
"and",
"interval",
")",
"with",
"a",
"logical",
"time",
"frame",
".",
"Very",
"useful",
"for",
"slow",
"paces",
".",
"e",
".",
"g",
".",
"heartbeats",
"ingested",
"calories",
"hyperglycemic",
"crises",
"."
] | train | https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-slim/src/main/java/humanize/Humanize.java#L2071-L2081 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContentProperty.java | CmsXmlContentProperty.firstNotNull | private static <T> T firstNotNull(T o1, T o2) {
if (o1 != null) {
return o1;
}
return o2;
} | java | private static <T> T firstNotNull(T o1, T o2) {
if (o1 != null) {
return o1;
}
return o2;
} | [
"private",
"static",
"<",
"T",
">",
"T",
"firstNotNull",
"(",
"T",
"o1",
",",
"T",
"o2",
")",
"{",
"if",
"(",
"o1",
"!=",
"null",
")",
"{",
"return",
"o1",
";",
"}",
"return",
"o2",
";",
"}"
] | Gets the fist non-null value.<p>
@param o1 the first value
@param o2 the second value
@return the first non-null value | [
"Gets",
"the",
"fist",
"non",
"-",
"null",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContentProperty.java#L261-L267 |
Netflix/zuul | zuul-core/src/main/java/com/netflix/zuul/context/SessionContext.java | SessionContext.set | public void set(String key, Object value) {
if (value != null) put(key, value);
else remove(key);
} | java | public void set(String key, Object value) {
if (value != null) put(key, value);
else remove(key);
} | [
"public",
"void",
"set",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"put",
"(",
"key",
",",
"value",
")",
";",
"else",
"remove",
"(",
"key",
")",
";",
"}"
] | puts the key, value into the map. a null value will remove the key from the map
@param key
@param value | [
"puts",
"the",
"key",
"value",
"into",
"the",
"map",
".",
"a",
"null",
"value",
"will",
"remove",
"the",
"key",
"from",
"the",
"map"
] | train | https://github.com/Netflix/zuul/blob/01bc777cf05e3522d37c9ed902ae13eb38a19692/zuul-core/src/main/java/com/netflix/zuul/context/SessionContext.java#L138-L141 |
craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.doubleToBytes | static public int doubleToBytes(double s, byte[] buffer, int index) {
long bits = Double.doubleToRawLongBits(s);
int length = longToBytes(bits, buffer, index);
return length;
} | java | static public int doubleToBytes(double s, byte[] buffer, int index) {
long bits = Double.doubleToRawLongBits(s);
int length = longToBytes(bits, buffer, index);
return length;
} | [
"static",
"public",
"int",
"doubleToBytes",
"(",
"double",
"s",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"long",
"bits",
"=",
"Double",
".",
"doubleToRawLongBits",
"(",
"s",
")",
";",
"int",
"length",
"=",
"longToBytes",
"(",
"bi... | This function converts a double into its corresponding byte format and inserts
it into the specified buffer at the specified index.
@param s The double to be converted.
@param buffer The byte array.
@param index The index in the array to begin inserting bytes.
@return The number of bytes inserted. | [
"This",
"function",
"converts",
"a",
"double",
"into",
"its",
"corresponding",
"byte",
"format",
"and",
"inserts",
"it",
"into",
"the",
"specified",
"buffer",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L429-L433 |
adohe/etcd4j | src/main/java/com/xqbase/etcd4j/EtcdClient.java | EtcdClient.createDir | public void createDir(String key, int ttl, Boolean prevExist) throws EtcdClientException {
Preconditions.checkNotNull(key);
List<BasicNameValuePair> data = Lists.newArrayList();
data.add(new BasicNameValuePair("dir", String.valueOf(true)));
if (ttl > 0) {
data.add(new BasicN... | java | public void createDir(String key, int ttl, Boolean prevExist) throws EtcdClientException {
Preconditions.checkNotNull(key);
List<BasicNameValuePair> data = Lists.newArrayList();
data.add(new BasicNameValuePair("dir", String.valueOf(true)));
if (ttl > 0) {
data.add(new BasicN... | [
"public",
"void",
"createDir",
"(",
"String",
"key",
",",
"int",
"ttl",
",",
"Boolean",
"prevExist",
")",
"throws",
"EtcdClientException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"key",
")",
";",
"List",
"<",
"BasicNameValuePair",
">",
"data",
"=",
"... | Create directories with optional ttl and prevExist(update dir ttl)
@param key the key
@param ttl the ttl
@param prevExist exists before
@throws EtcdClientException | [
"Create",
"directories",
"with",
"optional",
"ttl",
"and",
"prevExist",
"(",
"update",
"dir",
"ttl",
")"
] | train | https://github.com/adohe/etcd4j/blob/8d30ae9aa5da32d8e78287d61e69861c63538629/src/main/java/com/xqbase/etcd4j/EtcdClient.java#L185-L198 |
lemire/JavaFastPFOR | src/main/java/me/lemire/integercompression/Util.java | Util.maxbits | public static int maxbits(int[] i, int pos, int length) {
int mask = 0;
for (int k = pos; k < pos + length; ++k)
mask |= i[k];
return bits(mask);
} | java | public static int maxbits(int[] i, int pos, int length) {
int mask = 0;
for (int k = pos; k < pos + length; ++k)
mask |= i[k];
return bits(mask);
} | [
"public",
"static",
"int",
"maxbits",
"(",
"int",
"[",
"]",
"i",
",",
"int",
"pos",
",",
"int",
"length",
")",
"{",
"int",
"mask",
"=",
"0",
";",
"for",
"(",
"int",
"k",
"=",
"pos",
";",
"k",
"<",
"pos",
"+",
"length",
";",
"++",
"k",
")",
... | Compute the maximum of the integer logarithms (ceil(log(x+1)) of a range
of value
@param i
source array
@param pos
starting position
@param length
number of integers to consider
@return integer logarithm | [
"Compute",
"the",
"maximum",
"of",
"the",
"integer",
"logarithms",
"(",
"ceil",
"(",
"log",
"(",
"x",
"+",
"1",
"))",
"of",
"a",
"range",
"of",
"value"
] | train | https://github.com/lemire/JavaFastPFOR/blob/ffeea61ab2fdb3854da7b0a557f8d22d674477f4/src/main/java/me/lemire/integercompression/Util.java#L36-L41 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-data/deeplearning4j-datavec-iterators/src/main/java/org/deeplearning4j/datasets/datavec/SequenceRecordReaderDataSetIterator.java | SequenceRecordReaderDataSetIterator.loadFromMetaData | public DataSet loadFromMetaData(List<RecordMetaData> list) throws IOException {
if (underlying == null) {
SequenceRecord r = recordReader.loadSequenceFromMetaData(list.get(0));
initializeUnderlying(r);
}
//Two cases: single vs. multiple reader...
List<RecordMetaD... | java | public DataSet loadFromMetaData(List<RecordMetaData> list) throws IOException {
if (underlying == null) {
SequenceRecord r = recordReader.loadSequenceFromMetaData(list.get(0));
initializeUnderlying(r);
}
//Two cases: single vs. multiple reader...
List<RecordMetaD... | [
"public",
"DataSet",
"loadFromMetaData",
"(",
"List",
"<",
"RecordMetaData",
">",
"list",
")",
"throws",
"IOException",
"{",
"if",
"(",
"underlying",
"==",
"null",
")",
"{",
"SequenceRecord",
"r",
"=",
"recordReader",
".",
"loadSequenceFromMetaData",
"(",
"list"... | Load a multiple sequence examples to a DataSet, using the provided RecordMetaData instances.
@param list List of RecordMetaData instances to load from. Should have been produced by the record reader provided
to the SequenceRecordReaderDataSetIterator constructor
@return DataSet with the specified examples
@throws IOEx... | [
"Load",
"a",
"multiple",
"sequence",
"examples",
"to",
"a",
"DataSet",
"using",
"the",
"provided",
"RecordMetaData",
"instances",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-data/deeplearning4j-datavec-iterators/src/main/java/org/deeplearning4j/datasets/datavec/SequenceRecordReaderDataSetIterator.java#L462-L485 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java | ST_OffSetCurve.computeOffsetCurve | public static Geometry computeOffsetCurve(Geometry geometry, double offset, BufferParameters bufferParameters) {
ArrayList<LineString> lineStrings = new ArrayList<LineString>();
for (int i = 0; i < geometry.getNumGeometries(); i++) {
Geometry subGeom = geometry.getGeometryN(i);
i... | java | public static Geometry computeOffsetCurve(Geometry geometry, double offset, BufferParameters bufferParameters) {
ArrayList<LineString> lineStrings = new ArrayList<LineString>();
for (int i = 0; i < geometry.getNumGeometries(); i++) {
Geometry subGeom = geometry.getGeometryN(i);
i... | [
"public",
"static",
"Geometry",
"computeOffsetCurve",
"(",
"Geometry",
"geometry",
",",
"double",
"offset",
",",
"BufferParameters",
"bufferParameters",
")",
"{",
"ArrayList",
"<",
"LineString",
">",
"lineStrings",
"=",
"new",
"ArrayList",
"<",
"LineString",
">",
... | Method to compute the offset line
@param geometry
@param offset
@param bufferParameters
@return | [
"Method",
"to",
"compute",
"the",
"offset",
"line"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java#L121-L139 |
belaban/JGroups | src/org/jgroups/util/MessageBatch.java | MessageBatch.replaceIf | public int replaceIf(Predicate<Message> filter, Message replacement, boolean match_all) {
if(filter == null)
return 0;
int matched=0;
for(int i=0; i < index; i++) {
if(filter.test(messages[i])) {
messages[i]=replacement;
matched++;
... | java | public int replaceIf(Predicate<Message> filter, Message replacement, boolean match_all) {
if(filter == null)
return 0;
int matched=0;
for(int i=0; i < index; i++) {
if(filter.test(messages[i])) {
messages[i]=replacement;
matched++;
... | [
"public",
"int",
"replaceIf",
"(",
"Predicate",
"<",
"Message",
">",
"filter",
",",
"Message",
"replacement",
",",
"boolean",
"match_all",
")",
"{",
"if",
"(",
"filter",
"==",
"null",
")",
"return",
"0",
";",
"int",
"matched",
"=",
"0",
";",
"for",
"("... | Replaces all messages that match a given filter with a replacement message
@param filter the filter. If null, no changes take place. Note that filter needs to be able to handle null msgs
@param replacement the replacement message. Can be null, which essentially removes all messages matching filter
@param match_all whet... | [
"Replaces",
"all",
"messages",
"that",
"match",
"a",
"given",
"filter",
"with",
"a",
"replacement",
"message"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/MessageBatch.java#L215-L228 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java | PnPInfinitesimalPlanePoseEstimation.process | public boolean process( List<AssociatedPair> points )
{
if( points.size() < estimateHomography.getMinimumPoints())
throw new IllegalArgumentException("At least "+estimateHomography.getMinimumPoints()+" must be provided");
// center location of points in model
zeroMeanWorldPoints(points);
// make sure there... | java | public boolean process( List<AssociatedPair> points )
{
if( points.size() < estimateHomography.getMinimumPoints())
throw new IllegalArgumentException("At least "+estimateHomography.getMinimumPoints()+" must be provided");
// center location of points in model
zeroMeanWorldPoints(points);
// make sure there... | [
"public",
"boolean",
"process",
"(",
"List",
"<",
"AssociatedPair",
">",
"points",
")",
"{",
"if",
"(",
"points",
".",
"size",
"(",
")",
"<",
"estimateHomography",
".",
"getMinimumPoints",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"At... | Estimates the transform from world coordinate system to camera given known points and observations.
For each observation p1=World 3D location. z=0 is implicit. p2=Observed location of points in image in
normalized image coordinates
@param points List of world coordinates in 2D (p1) and normalized image coordinates (p2... | [
"Estimates",
"the",
"transform",
"from",
"world",
"coordinate",
"system",
"to",
"camera",
"given",
"known",
"points",
"and",
"observations",
".",
"For",
"each",
"observation",
"p1",
"=",
"World",
"3D",
"location",
".",
"z",
"=",
"0",
"is",
"implicit",
".",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java#L115-L166 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/iqregister/AccountManager.java | AccountManager.createAccount | public void createAccount(Localpart username, String password, Map<String, String> attributes)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
if (!connection().isSecureConnection() && !allowSensitiveOperationOverInsecureConnection) {
... | java | public void createAccount(Localpart username, String password, Map<String, String> attributes)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
if (!connection().isSecureConnection() && !allowSensitiveOperationOverInsecureConnection) {
... | [
"public",
"void",
"createAccount",
"(",
"Localpart",
"username",
",",
"String",
"password",
",",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedE... | Creates a new account using the specified username, password and account attributes.
The attributes Map must contain only String name/value pairs and must also have values
for all required attributes.
@param username the username.
@param password the password.
@param attributes the account attributes.
@throws XMPPErro... | [
"Creates",
"a",
"new",
"account",
"using",
"the",
"specified",
"username",
"password",
"and",
"account",
"attributes",
".",
"The",
"attributes",
"Map",
"must",
"contain",
"only",
"String",
"name",
"/",
"value",
"pairs",
"and",
"must",
"also",
"have",
"values",... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/iqregister/AccountManager.java#L271-L289 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java | EnvironmentsInner.beginStartAsync | public Observable<Void> beginStartAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) {
return beginStartWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).map(new Func1<ServiceRe... | java | public Observable<Void> beginStartAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) {
return beginStartWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).map(new Func1<ServiceRe... | [
"public",
"Observable",
"<",
"Void",
">",
"beginStartAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"environmentSettingName",
",",
"String",
"environmentName",
")",
"{",
"return",
"beginStartWithSe... | Starts an environment by starting all resources inside the environment. This operation can take a while to complete.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param environmentSettingName The name of the environment ... | [
"Starts",
"an",
"environment",
"by",
"starting",
"all",
"resources",
"inside",
"the",
"environment",
".",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java#L1510-L1517 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyDecoder.java | KeyDecoder.decodeIntegerObjDesc | public static Integer decodeIntegerObjDesc(byte[] src, int srcOffset)
throws CorruptEncodingException
{
try {
int b = src[srcOffset];
if (b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW) {
return null;
}
return decodeIntDesc(src, srcO... | java | public static Integer decodeIntegerObjDesc(byte[] src, int srcOffset)
throws CorruptEncodingException
{
try {
int b = src[srcOffset];
if (b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW) {
return null;
}
return decodeIntDesc(src, srcO... | [
"public",
"static",
"Integer",
"decodeIntegerObjDesc",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"try",
"{",
"int",
"b",
"=",
"src",
"[",
"srcOffset",
"]",
";",
"if",
"(",
"b",
"==",
"NULL_BYTE_H... | Decodes a signed Integer object from exactly 1 or 5 bytes, as encoded
for descending order. If null is returned, then 1 byte was read.
@param src source of encoded bytes
@param srcOffset offset into source array
@return signed Integer object or null | [
"Decodes",
"a",
"signed",
"Integer",
"object",
"from",
"exactly",
"1",
"or",
"5",
"bytes",
"as",
"encoded",
"for",
"descending",
"order",
".",
"If",
"null",
"is",
"returned",
"then",
"1",
"byte",
"was",
"read",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyDecoder.java#L58-L70 |
alkacon/opencms-core | src/org/opencms/ade/contenteditor/CmsWidgetUtil.java | CmsWidgetUtil.collectWidgetInfo | public static WidgetInfo collectWidgetInfo(I_CmsXmlContentValue value) {
CmsXmlContentDefinition contentDef = value.getDocument().getContentDefinition();
String path = value.getPath();
return collectWidgetInfo(contentDef, path);
} | java | public static WidgetInfo collectWidgetInfo(I_CmsXmlContentValue value) {
CmsXmlContentDefinition contentDef = value.getDocument().getContentDefinition();
String path = value.getPath();
return collectWidgetInfo(contentDef, path);
} | [
"public",
"static",
"WidgetInfo",
"collectWidgetInfo",
"(",
"I_CmsXmlContentValue",
"value",
")",
"{",
"CmsXmlContentDefinition",
"contentDef",
"=",
"value",
".",
"getDocument",
"(",
")",
".",
"getContentDefinition",
"(",
")",
";",
"String",
"path",
"=",
"value",
... | Collects widget information for a given content value.<p>
@param value a content value
@return the widget information for the given value | [
"Collects",
"widget",
"information",
"for",
"a",
"given",
"content",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/contenteditor/CmsWidgetUtil.java#L214-L219 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/servlet/request/scoped/ScopedMessageHandler.java | ScopedMessageHandler.addGlobal | public void addGlobal(String messageKey, Object... args) {
assertObjectNotNull("messageKey", messageKey);
doAddMessages(prepareUserMessages(globalPropertyKey, messageKey, args));
} | java | public void addGlobal(String messageKey, Object... args) {
assertObjectNotNull("messageKey", messageKey);
doAddMessages(prepareUserMessages(globalPropertyKey, messageKey, args));
} | [
"public",
"void",
"addGlobal",
"(",
"String",
"messageKey",
",",
"Object",
"...",
"args",
")",
"{",
"assertObjectNotNull",
"(",
"\"messageKey\"",
",",
"messageKey",
")",
";",
"doAddMessages",
"(",
"prepareUserMessages",
"(",
"globalPropertyKey",
",",
"messageKey",
... | Add message as global user messages to rear of existing messages. <br>
This message will be deleted immediately after display if you use e.g. la:errors.
@param messageKey The message key to be added. (NotNull)
@param args The varying array of arguments for the message. (NullAllowed, EmptyAllowed) | [
"Add",
"message",
"as",
"global",
"user",
"messages",
"to",
"rear",
"of",
"existing",
"messages",
".",
"<br",
">",
"This",
"message",
"will",
"be",
"deleted",
"immediately",
"after",
"display",
"if",
"you",
"use",
"e",
".",
"g",
".",
"la",
":",
"errors",... | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/servlet/request/scoped/ScopedMessageHandler.java#L105-L108 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_cron_GET | public ArrayList<Long> serviceName_cron_GET(String serviceName, String command, String description, String email, OvhLanguageEnum language) throws IOException {
String qPath = "/hosting/web/{serviceName}/cron";
StringBuilder sb = path(qPath, serviceName);
query(sb, "command", command);
query(sb, "description", ... | java | public ArrayList<Long> serviceName_cron_GET(String serviceName, String command, String description, String email, OvhLanguageEnum language) throws IOException {
String qPath = "/hosting/web/{serviceName}/cron";
StringBuilder sb = path(qPath, serviceName);
query(sb, "command", command);
query(sb, "description", ... | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_cron_GET",
"(",
"String",
"serviceName",
",",
"String",
"command",
",",
"String",
"description",
",",
"String",
"email",
",",
"OvhLanguageEnum",
"language",
")",
"throws",
"IOException",
"{",
"String",
"qPath",... | Crons on your hosting
REST: GET /hosting/web/{serviceName}/cron
@param description [required] Filter the value of description property (like)
@param command [required] Filter the value of command property (like)
@param language [required] Filter the value of language property (=)
@param email [required] Filter the val... | [
"Crons",
"on",
"your",
"hosting"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L2125-L2134 |
chrisruffalo/ee-config | src/main/java/com/github/chrisruffalo/eeconfig/resources/BeanResolver.java | BeanResolver.resolveBeanWithDefaultClass | @SuppressWarnings("unchecked")
public <B, T extends B, D extends B> B resolveBeanWithDefaultClass(Class<T> typeToResolve, Class<D> defaultType) {
// if type to resolve is null, do nothing, not even the default
if(typeToResolve == null) {
return null;
}
// get candidate resolve types
Set<Bean<?>> candi... | java | @SuppressWarnings("unchecked")
public <B, T extends B, D extends B> B resolveBeanWithDefaultClass(Class<T> typeToResolve, Class<D> defaultType) {
// if type to resolve is null, do nothing, not even the default
if(typeToResolve == null) {
return null;
}
// get candidate resolve types
Set<Bean<?>> candi... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"B",
",",
"T",
"extends",
"B",
",",
"D",
"extends",
"B",
">",
"B",
"resolveBeanWithDefaultClass",
"(",
"Class",
"<",
"T",
">",
"typeToResolve",
",",
"Class",
"<",
"D",
">",
"defaultType",
... | Resolve managed bean for given type
@param typeToResolve
@param defaultType
@return | [
"Resolve",
"managed",
"bean",
"for",
"given",
"type"
] | train | https://github.com/chrisruffalo/ee-config/blob/6cdc59e2117e97c1997b79a19cbfaa284027e60c/src/main/java/com/github/chrisruffalo/eeconfig/resources/BeanResolver.java#L33-L63 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheSetUtil.java | CacheSetUtil.removes | public static Single<Long> removes(String key, Set members) {
return removes(CacheService.CACHE_CONFIG_BEAN, key, members);
} | java | public static Single<Long> removes(String key, Set members) {
return removes(CacheService.CACHE_CONFIG_BEAN, key, members);
} | [
"public",
"static",
"Single",
"<",
"Long",
">",
"removes",
"(",
"String",
"key",
",",
"Set",
"members",
")",
"{",
"return",
"removes",
"(",
"CacheService",
".",
"CACHE_CONFIG_BEAN",
",",
"key",
",",
"members",
")",
";",
"}"
] | remove the given elements from the cache set
@param key the key
@param members element to be removed
@return the removed elements count | [
"remove",
"the",
"given",
"elements",
"from",
"the",
"cache",
"set"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheSetUtil.java#L202-L204 |
biezhi/anima | src/main/java/io/github/biezhi/anima/Anima.java | Anima.deleteBatch | @SafeVarargs
public static <T extends Model, S extends Serializable> void deleteBatch(Class<T> model, S... ids) {
atomic(() -> Arrays.stream(ids)
.forEach(new AnimaQuery<>(model)::deleteById))
.catchException(e -> log.error("Batch save model error, message: {}", e));
} | java | @SafeVarargs
public static <T extends Model, S extends Serializable> void deleteBatch(Class<T> model, S... ids) {
atomic(() -> Arrays.stream(ids)
.forEach(new AnimaQuery<>(model)::deleteById))
.catchException(e -> log.error("Batch save model error, message: {}", e));
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
"extends",
"Model",
",",
"S",
"extends",
"Serializable",
">",
"void",
"deleteBatch",
"(",
"Class",
"<",
"T",
">",
"model",
",",
"S",
"...",
"ids",
")",
"{",
"atomic",
"(",
"(",
")",
"->",
"Arrays",
".... | Batch delete model
@param model model class type
@param ids mode primary id array
@param <T>
@param <S> | [
"Batch",
"delete",
"model"
] | train | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/io/github/biezhi/anima/Anima.java#L417-L422 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/SerOptional.java | SerOptional.extractValue | public static Object extractValue(MetaProperty<?> metaProp, Bean bean) {
Object value = metaProp.get(bean);
if (value != null) {
Object[] helpers = OPTIONALS.get(metaProp.propertyType());
if (helpers != null) {
try {
boolean present = (Boolean)... | java | public static Object extractValue(MetaProperty<?> metaProp, Bean bean) {
Object value = metaProp.get(bean);
if (value != null) {
Object[] helpers = OPTIONALS.get(metaProp.propertyType());
if (helpers != null) {
try {
boolean present = (Boolean)... | [
"public",
"static",
"Object",
"extractValue",
"(",
"MetaProperty",
"<",
"?",
">",
"metaProp",
",",
"Bean",
"bean",
")",
"{",
"Object",
"value",
"=",
"metaProp",
".",
"get",
"(",
"bean",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"Object",
... | Extracts the value of the property from a bean, unwrapping any optional.
@param metaProp the property to query, not null
@param bean the bean to query, not null
@return the value of the property, with any optional wrapper removed | [
"Extracts",
"the",
"value",
"of",
"the",
"property",
"from",
"a",
"bean",
"unwrapping",
"any",
"optional",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerOptional.java#L102-L120 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java | JDBC4CallableStatement.setTime | @Override
public void setTime(String parameterName, Time x) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | java | @Override
public void setTime(String parameterName, Time x) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"void",
"setTime",
"(",
"String",
"parameterName",
",",
"Time",
"x",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Sets the designated parameter to the given java.sql.Time value. | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"java",
".",
"sql",
".",
"Time",
"value",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java#L887-L892 |
h2oai/h2o-3 | h2o-mapreduce-generic/src/main/java/water/hadoop/H2OYarnDiagnostic.java | H2OYarnDiagnostic.diagnose | public static void diagnose(String applicationId, String queueName, int numNodes, int nodeMemoryMb, int numNodesStarted) throws Exception {
H2OYarnDiagnostic client = new H2OYarnDiagnostic();
client.applicationId = applicationId;
client.queueName = queueName;
client.numNodes = numNodes;
... | java | public static void diagnose(String applicationId, String queueName, int numNodes, int nodeMemoryMb, int numNodesStarted) throws Exception {
H2OYarnDiagnostic client = new H2OYarnDiagnostic();
client.applicationId = applicationId;
client.queueName = queueName;
client.numNodes = numNodes;
... | [
"public",
"static",
"void",
"diagnose",
"(",
"String",
"applicationId",
",",
"String",
"queueName",
",",
"int",
"numNodes",
",",
"int",
"nodeMemoryMb",
",",
"int",
"numNodesStarted",
")",
"throws",
"Exception",
"{",
"H2OYarnDiagnostic",
"client",
"=",
"new",
"H2... | The assumption is this method doesn't get called unless a problem occurred.
@param queueName YARN queue name
@param numNodes Requested number of worker containers (not including AM)
@param nodeMemoryMb Requested worker container size
@param numNodesStarted Number of containers that actually got started before giving u... | [
"The",
"assumption",
"is",
"this",
"method",
"doesn",
"t",
"get",
"called",
"unless",
"a",
"problem",
"occurred",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-mapreduce-generic/src/main/java/water/hadoop/H2OYarnDiagnostic.java#L54-L63 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java | LatLongUtils.longitudeDistance | public static double longitudeDistance(int meters, double latitude) {
return (meters * 360) / (2 * Math.PI * EQUATORIAL_RADIUS * Math.cos(Math.toRadians(latitude)));
} | java | public static double longitudeDistance(int meters, double latitude) {
return (meters * 360) / (2 * Math.PI * EQUATORIAL_RADIUS * Math.cos(Math.toRadians(latitude)));
} | [
"public",
"static",
"double",
"longitudeDistance",
"(",
"int",
"meters",
",",
"double",
"latitude",
")",
"{",
"return",
"(",
"meters",
"*",
"360",
")",
"/",
"(",
"2",
"*",
"Math",
".",
"PI",
"*",
"EQUATORIAL_RADIUS",
"*",
"Math",
".",
"cos",
"(",
"Math... | Calculates the amount of degrees of longitude for a given distance in meters.
@param meters distance in meters
@param latitude the latitude at which the calculation should be performed
@return longitude degrees | [
"Calculates",
"the",
"amount",
"of",
"degrees",
"of",
"longitude",
"for",
"a",
"given",
"distance",
"in",
"meters",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java#L211-L213 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/execution/scheduler/SourcePartitionedScheduler.java | SourcePartitionedScheduler.newSourcePartitionedSchedulerAsStageScheduler | public static StageScheduler newSourcePartitionedSchedulerAsStageScheduler(
SqlStageExecution stage,
PlanNodeId partitionedNode,
SplitSource splitSource,
SplitPlacementPolicy splitPlacementPolicy,
int splitBatchSize)
{
SourcePartitionedScheduler so... | java | public static StageScheduler newSourcePartitionedSchedulerAsStageScheduler(
SqlStageExecution stage,
PlanNodeId partitionedNode,
SplitSource splitSource,
SplitPlacementPolicy splitPlacementPolicy,
int splitBatchSize)
{
SourcePartitionedScheduler so... | [
"public",
"static",
"StageScheduler",
"newSourcePartitionedSchedulerAsStageScheduler",
"(",
"SqlStageExecution",
"stage",
",",
"PlanNodeId",
"partitionedNode",
",",
"SplitSource",
"splitSource",
",",
"SplitPlacementPolicy",
"splitPlacementPolicy",
",",
"int",
"splitBatchSize",
... | Obtains an instance of {@code SourcePartitionedScheduler} suitable for use as a
stage scheduler.
<p>
This returns an ungrouped {@code SourcePartitionedScheduler} that requires
minimal management from the caller, which is ideal for use as a stage scheduler. | [
"Obtains",
"an",
"instance",
"of",
"{"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/execution/scheduler/SourcePartitionedScheduler.java#L129-L154 |
DDTH/ddth-kafka | src/main/java/com/github/ddth/kafka/KafkaClient.java | KafkaClient.seekToEnd | public boolean seekToEnd(String consumerGroupId, String topic) {
KafkaMsgConsumer consumer = getKafkaConsumer(consumerGroupId, false);
return consumer.seekToEnd(topic);
} | java | public boolean seekToEnd(String consumerGroupId, String topic) {
KafkaMsgConsumer consumer = getKafkaConsumer(consumerGroupId, false);
return consumer.seekToEnd(topic);
} | [
"public",
"boolean",
"seekToEnd",
"(",
"String",
"consumerGroupId",
",",
"String",
"topic",
")",
"{",
"KafkaMsgConsumer",
"consumer",
"=",
"getKafkaConsumer",
"(",
"consumerGroupId",
",",
"false",
")",
";",
"return",
"consumer",
".",
"seekToEnd",
"(",
"topic",
"... | Seeks to the end of all assigned partitions of a topic.
@param consumerGroupId
@param topic
@return {@code true} if the consumer has subscribed to the specified
topic, {@code false} otherwise.
@since 1.2.0 | [
"Seeks",
"to",
"the",
"end",
"of",
"all",
"assigned",
"partitions",
"of",
"a",
"topic",
"."
] | train | https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/KafkaClient.java#L448-L451 |
lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java | RequestHeader.withPrincipal | public RequestHeader withPrincipal(Principal principal) {
return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, Optional.ofNullable(principal), headers, lowercaseHeaders);
} | java | public RequestHeader withPrincipal(Principal principal) {
return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, Optional.ofNullable(principal), headers, lowercaseHeaders);
} | [
"public",
"RequestHeader",
"withPrincipal",
"(",
"Principal",
"principal",
")",
"{",
"return",
"new",
"RequestHeader",
"(",
"method",
",",
"uri",
",",
"protocol",
",",
"acceptedResponseProtocols",
",",
"Optional",
".",
"ofNullable",
"(",
"principal",
")",
",",
"... | Return a copy of this request header with the principal set.
@param principal The principal to set.
@return A copy of this request header. | [
"Return",
"a",
"copy",
"of",
"this",
"request",
"header",
"with",
"the",
"principal",
"set",
"."
] | train | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/RequestHeader.java#L127-L129 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java | ItemizedOverlay.boundToHotspot | protected Drawable boundToHotspot(final Drawable marker, HotspotPlace hotspot) {
if (hotspot == null) {
hotspot = HotspotPlace.BOTTOM_CENTER;
}
final int markerWidth = marker.getIntrinsicWidth();
final int markerHeight = marker.getIntrinsicHeight();
final int offsetX;
final int offsetY;
switch(hotspot)... | java | protected Drawable boundToHotspot(final Drawable marker, HotspotPlace hotspot) {
if (hotspot == null) {
hotspot = HotspotPlace.BOTTOM_CENTER;
}
final int markerWidth = marker.getIntrinsicWidth();
final int markerHeight = marker.getIntrinsicHeight();
final int offsetX;
final int offsetY;
switch(hotspot)... | [
"protected",
"Drawable",
"boundToHotspot",
"(",
"final",
"Drawable",
"marker",
",",
"HotspotPlace",
"hotspot",
")",
"{",
"if",
"(",
"hotspot",
"==",
"null",
")",
"{",
"hotspot",
"=",
"HotspotPlace",
".",
"BOTTOM_CENTER",
";",
"}",
"final",
"int",
"markerWidth"... | Adjusts a drawable's bounds so that (0,0) is a pixel in the location described by the hotspot
parameter. Useful for "pin"-like graphics. For convenience, returns the same drawable that
was passed in.
@param marker
the drawable to adjust
@param hotspot
the hotspot for the drawable
@return the same drawable that was pas... | [
"Adjusts",
"a",
"drawable",
"s",
"bounds",
"so",
"that",
"(",
"0",
"0",
")",
"is",
"a",
"pixel",
"in",
"the",
"location",
"described",
"by",
"the",
"hotspot",
"parameter",
".",
"Useful",
"for",
"pin",
"-",
"like",
"graphics",
".",
"For",
"convenience",
... | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java#L346-L394 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.getAttributeColorWithDefault | @Pure
public static Integer getAttributeColorWithDefault(Node document, Integer defaultValue, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
return getAttributeColorWithDefault(document, true, defaultValue, path);
} | java | @Pure
public static Integer getAttributeColorWithDefault(Node document, Integer defaultValue, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
return getAttributeColorWithDefault(document, true, defaultValue, path);
} | [
"@",
"Pure",
"public",
"static",
"Integer",
"getAttributeColorWithDefault",
"(",
"Node",
"document",
",",
"Integer",
"defaultValue",
",",
"String",
"...",
"path",
")",
"{",
"assert",
"document",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
... | Replies the color 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.
Be careful about the fact that the names are case sensitives.
@param document is the XML document to explore.
@param path is the list of and ended by the attribut... | [
"Replies",
"the",
"color",
"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#L481-L485 |
VoltDB/voltdb | src/frontend/org/voltdb/expressions/ExpressionUtil.java | ExpressionUtil.getType | private static String getType(Database db, VoltXMLElement elm) {
final String type = elm.getStringAttribute("valuetype", "");
if (! type.isEmpty()) {
return type;
} else if (elm.name.equals("columnref")) {
final String tblName = elm.getStringAttribute("table", "");
... | java | private static String getType(Database db, VoltXMLElement elm) {
final String type = elm.getStringAttribute("valuetype", "");
if (! type.isEmpty()) {
return type;
} else if (elm.name.equals("columnref")) {
final String tblName = elm.getStringAttribute("table", "");
... | [
"private",
"static",
"String",
"getType",
"(",
"Database",
"db",
",",
"VoltXMLElement",
"elm",
")",
"{",
"final",
"String",
"type",
"=",
"elm",
".",
"getStringAttribute",
"(",
"\"valuetype\"",
",",
"\"\"",
")",
";",
"if",
"(",
"!",
"type",
".",
"isEmpty",
... | Get the underlying type of the VoltXMLElement node. Need reference to the catalog for PVE
@param db catalog
@param elm element under inspection
@return string representation of the element node | [
"Get",
"the",
"underlying",
"type",
"of",
"the",
"VoltXMLElement",
"node",
".",
"Need",
"reference",
"to",
"the",
"catalog",
"for",
"PVE"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ExpressionUtil.java#L120-L140 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/preview/ui/CmsImageAdvancedForm.java | CmsImageAdvancedForm.fillContent | public void fillContent(CmsImageInfoBean imageInfo, CmsJSONMap imageAttributes, boolean initialFill) {
for (Entry<Attribute, I_CmsFormWidget> entry : m_fields.entrySet()) {
String val = imageAttributes.getString(entry.getKey().name());
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(val)) ... | java | public void fillContent(CmsImageInfoBean imageInfo, CmsJSONMap imageAttributes, boolean initialFill) {
for (Entry<Attribute, I_CmsFormWidget> entry : m_fields.entrySet()) {
String val = imageAttributes.getString(entry.getKey().name());
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(val)) ... | [
"public",
"void",
"fillContent",
"(",
"CmsImageInfoBean",
"imageInfo",
",",
"CmsJSONMap",
"imageAttributes",
",",
"boolean",
"initialFill",
")",
"{",
"for",
"(",
"Entry",
"<",
"Attribute",
",",
"I_CmsFormWidget",
">",
"entry",
":",
"m_fields",
".",
"entrySet",
"... | Displays the provided image information.<p>
@param imageInfo the image information
@param imageAttributes the image attributes
@param initialFill flag to indicate that a new image has been selected | [
"Displays",
"the",
"provided",
"image",
"information",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/ui/CmsImageAdvancedForm.java#L192-L204 |
brettwooldridge/HikariCP | src/main/java/com/zaxxer/hikari/pool/PoolBase.java | PoolBase.setNetworkTimeout | private void setNetworkTimeout(final Connection connection, final long timeoutMs) throws SQLException
{
if (isNetworkTimeoutSupported == TRUE) {
connection.setNetworkTimeout(netTimeoutExecutor, (int) timeoutMs);
}
} | java | private void setNetworkTimeout(final Connection connection, final long timeoutMs) throws SQLException
{
if (isNetworkTimeoutSupported == TRUE) {
connection.setNetworkTimeout(netTimeoutExecutor, (int) timeoutMs);
}
} | [
"private",
"void",
"setNetworkTimeout",
"(",
"final",
"Connection",
"connection",
",",
"final",
"long",
"timeoutMs",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"isNetworkTimeoutSupported",
"==",
"TRUE",
")",
"{",
"connection",
".",
"setNetworkTimeout",
"(",
"n... | Set the network timeout, if <code>isUseNetworkTimeout</code> is <code>true</code> and the
driver supports it.
@param connection the connection to set the network timeout on
@param timeoutMs the number of milliseconds before timeout
@throws SQLException throw if the connection.setNetworkTimeout() call throws | [
"Set",
"the",
"network",
"timeout",
"if",
"<code",
">",
"isUseNetworkTimeout<",
"/",
"code",
">",
"is",
"<code",
">",
"true<",
"/",
"code",
">",
"and",
"the",
"driver",
"supports",
"it",
"."
] | train | https://github.com/brettwooldridge/HikariCP/blob/c509ec1a3f1e19769ee69323972f339cf098ff4b/src/main/java/com/zaxxer/hikari/pool/PoolBase.java#L549-L554 |
mapbox/mapbox-navigation-android | libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/instruction/ExitSignCreator.java | ExitSignCreator.postProcess | @Override
void postProcess(TextView textView, List<BannerComponentNode> bannerComponentNodes) {
if (exitNumber != null) {
LayoutInflater inflater = (LayoutInflater) textView.getContext().getSystemService(Context
.LAYOUT_INFLATER_SERVICE);
ViewGroup root = (ViewGroup) textView.getParent();
... | java | @Override
void postProcess(TextView textView, List<BannerComponentNode> bannerComponentNodes) {
if (exitNumber != null) {
LayoutInflater inflater = (LayoutInflater) textView.getContext().getSystemService(Context
.LAYOUT_INFLATER_SERVICE);
ViewGroup root = (ViewGroup) textView.getParent();
... | [
"@",
"Override",
"void",
"postProcess",
"(",
"TextView",
"textView",
",",
"List",
"<",
"BannerComponentNode",
">",
"bannerComponentNodes",
")",
"{",
"if",
"(",
"exitNumber",
"!=",
"null",
")",
"{",
"LayoutInflater",
"inflater",
"=",
"(",
"LayoutInflater",
")",
... | One coordinator should override this method, and this should be the coordinator which populates
the textView with text.
@param textView to populate
@param bannerComponentNodes containing instructions | [
"One",
"coordinator",
"should",
"override",
"this",
"method",
"and",
"this",
"should",
"be",
"the",
"coordinator",
"which",
"populates",
"the",
"textView",
"with",
"text",
"."
] | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/instruction/ExitSignCreator.java#L48-L69 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.