repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/ReservoirItemsUnion.java | ReservoirItemsUnion.update | public void update(final Memory mem, final ArrayOfItemsSerDe<T> serDe) {
"""
Union the given Memory image of the sketch.
<p>This method can be repeatedly called. If the given sketch is null it is interpreted as an
empty sketch.</p>
@param mem Memory image of sketch to be merged
@param serDe An instance of ... | java | public void update(final Memory mem, final ArrayOfItemsSerDe<T> serDe) {
if (mem == null) {
return;
}
ReservoirItemsSketch<T> ris = ReservoirItemsSketch.heapify(mem, serDe);
ris = (ris.getK() <= maxK_ ? ris : ris.downsampledCopy(maxK_));
if (gadget_ == null) {
createNewGadget(ris, true... | [
"public",
"void",
"update",
"(",
"final",
"Memory",
"mem",
",",
"final",
"ArrayOfItemsSerDe",
"<",
"T",
">",
"serDe",
")",
"{",
"if",
"(",
"mem",
"==",
"null",
")",
"{",
"return",
";",
"}",
"ReservoirItemsSketch",
"<",
"T",
">",
"ris",
"=",
"ReservoirI... | Union the given Memory image of the sketch.
<p>This method can be repeatedly called. If the given sketch is null it is interpreted as an
empty sketch.</p>
@param mem Memory image of sketch to be merged
@param serDe An instance of ArrayOfItemsSerDe | [
"Union",
"the",
"given",
"Memory",
"image",
"of",
"the",
"sketch",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/ReservoirItemsUnion.java#L160-L173 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/ocsp/OCSPVerifier.java | OCSPVerifier.generateOCSPRequest | public static OCSPReq generateOCSPRequest(X509Certificate issuerCert, BigInteger serialNumber)
throws CertificateVerificationException {
"""
This method generates an OCSP Request to be sent to an OCSP authority access endpoint.
@param issuerCert the Issuer's certificate of the peer certificate we a... | java | public static OCSPReq generateOCSPRequest(X509Certificate issuerCert, BigInteger serialNumber)
throws CertificateVerificationException {
//Programatically adding Bouncy Castle as the security provider. So no need to manually set. Once the programme
// is over security provider will also... | [
"public",
"static",
"OCSPReq",
"generateOCSPRequest",
"(",
"X509Certificate",
"issuerCert",
",",
"BigInteger",
"serialNumber",
")",
"throws",
"CertificateVerificationException",
"{",
"//Programatically adding Bouncy Castle as the security provider. So no need to manually set. Once the pr... | This method generates an OCSP Request to be sent to an OCSP authority access endpoint.
@param issuerCert the Issuer's certificate of the peer certificate we are interested in.
@param serialNumber of the peer certificate.
@return generated OCSP request.
@throws CertificateVerificationException if any error occurs while... | [
"This",
"method",
"generates",
"an",
"OCSP",
"Request",
"to",
"be",
"sent",
"to",
"an",
"OCSP",
"authority",
"access",
"endpoint",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/ocsp/OCSPVerifier.java#L199-L235 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATAsynchConsumer.java | CATAsynchConsumer.sendMessage | private boolean sendMessage(SIBusMessage sibMessage, boolean lastMsg, Integer priority)
throws MessageEncodeFailedException,
IncorrectMessageTypeException,
MessageCopyFailedException,
UnsupportedEncodingException {
"""
Method to perfor... | java | private boolean sendMessage(SIBusMessage sibMessage, boolean lastMsg, Integer priority)
throws MessageEncodeFailedException,
IncorrectMessageTypeException,
MessageCopyFailedException,
UnsupportedEncodingException {
if (TraceComponen... | [
"private",
"boolean",
"sendMessage",
"(",
"SIBusMessage",
"sibMessage",
",",
"boolean",
"lastMsg",
",",
"Integer",
"priority",
")",
"throws",
"MessageEncodeFailedException",
",",
"IncorrectMessageTypeException",
",",
"MessageCopyFailedException",
",",
"UnsupportedEncodingExce... | Method to perform a single send of a message to the client.
@param sibMessage The message to send.
@param lastMsg true if this is the last message in the batch.
@param priority The priority to sent the message
@return Returns false if a communications error prevented the message
from being sent.
@throws MessageEncod... | [
"Method",
"to",
"perform",
"a",
"single",
"send",
"of",
"a",
"message",
"to",
"the",
"client",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATAsynchConsumer.java#L689-L712 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/PriorityBlockingQueue.java | PriorityBlockingQueue.siftUpComparable | private static <T> void siftUpComparable(int k, T x, Object[] array) {
"""
Inserts item x at position k, maintaining heap invariant by
promoting x up the tree until it is greater than or equal to
its parent, or is the root.
To simplify and speed up coercions and comparisons. the
Comparable and Comparator ver... | java | private static <T> void siftUpComparable(int k, T x, Object[] array) {
Comparable<? super T> key = (Comparable<? super T>) x;
while (k > 0) {
int parent = (k - 1) >>> 1;
Object e = array[parent];
if (key.compareTo((T) e) >= 0)
break;
array[... | [
"private",
"static",
"<",
"T",
">",
"void",
"siftUpComparable",
"(",
"int",
"k",
",",
"T",
"x",
",",
"Object",
"[",
"]",
"array",
")",
"{",
"Comparable",
"<",
"?",
"super",
"T",
">",
"key",
"=",
"(",
"Comparable",
"<",
"?",
"super",
"T",
">",
")"... | Inserts item x at position k, maintaining heap invariant by
promoting x up the tree until it is greater than or equal to
its parent, or is the root.
To simplify and speed up coercions and comparisons. the
Comparable and Comparator versions are separated into different
methods that are otherwise identical. (Similarly f... | [
"Inserts",
"item",
"x",
"at",
"position",
"k",
"maintaining",
"heap",
"invariant",
"by",
"promoting",
"x",
"up",
"the",
"tree",
"until",
"it",
"is",
"greater",
"than",
"or",
"equal",
"to",
"its",
"parent",
"or",
"is",
"the",
"root",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/PriorityBlockingQueue.java#L355-L366 |
lessthanoptimal/ddogleg | src/org/ddogleg/nn/alg/VpTree.java | VpTree.listSwap | private <E> void listSwap(E[] list, int a, int b) {
"""
Swaps two items in the given list.
@param list list to swap the items in
@param a index of the first item
@param b index of the second item
@param <E> list type
"""
final E tmp = list[a];
list[a] = list[b];
list[b] = tmp;
} | java | private <E> void listSwap(E[] list, int a, int b) {
final E tmp = list[a];
list[a] = list[b];
list[b] = tmp;
} | [
"private",
"<",
"E",
">",
"void",
"listSwap",
"(",
"E",
"[",
"]",
"list",
",",
"int",
"a",
",",
"int",
"b",
")",
"{",
"final",
"E",
"tmp",
"=",
"list",
"[",
"a",
"]",
";",
"list",
"[",
"a",
"]",
"=",
"list",
"[",
"b",
"]",
";",
"list",
"[... | Swaps two items in the given list.
@param list list to swap the items in
@param a index of the first item
@param b index of the second item
@param <E> list type | [
"Swaps",
"two",
"items",
"in",
"the",
"given",
"list",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/nn/alg/VpTree.java#L173-L177 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java | ScriptRequestState.getString | public static String getString(String aKey, Object[] args) {
"""
Returns the string specified by aKey from the errors.properties bundle.
@param aKey The key for the message pattern in the bundle.
@param args The args to use in the message format.
"""
assert (aKey != null);
String pattern = g... | java | public static String getString(String aKey, Object[] args)
{
assert (aKey != null);
String pattern = getBundle().getString(aKey);
if (args == null)
return pattern;
MessageFormat format = new MessageFormat(pattern);
return format.format(args).toString();
} | [
"public",
"static",
"String",
"getString",
"(",
"String",
"aKey",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"assert",
"(",
"aKey",
"!=",
"null",
")",
";",
"String",
"pattern",
"=",
"getBundle",
"(",
")",
".",
"getString",
"(",
"aKey",
")",
";",
"if"... | Returns the string specified by aKey from the errors.properties bundle.
@param aKey The key for the message pattern in the bundle.
@param args The args to use in the message format. | [
"Returns",
"the",
"string",
"specified",
"by",
"aKey",
"from",
"the",
"errors",
".",
"properties",
"bundle",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java#L83-L93 |
apache/flink | flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/util/InterpreterUtils.java | InterpreterUtils.initAndExecPythonScript | public static void initAndExecPythonScript(PythonEnvironmentFactory factory, java.nio.file.Path scriptDirectory, String scriptName, String[] args) {
"""
Initializes the Jython interpreter and executes a python script.
@param factory environment factory
@param scriptDirectory the directory containing all requir... | java | public static void initAndExecPythonScript(PythonEnvironmentFactory factory, java.nio.file.Path scriptDirectory, String scriptName, String[] args) {
String[] fullArgs = new String[args.length + 1];
fullArgs[0] = scriptDirectory.resolve(scriptName).toString();
System.arraycopy(args, 0, fullArgs, 1, args.length);
... | [
"public",
"static",
"void",
"initAndExecPythonScript",
"(",
"PythonEnvironmentFactory",
"factory",
",",
"java",
".",
"nio",
".",
"file",
".",
"Path",
"scriptDirectory",
",",
"String",
"scriptName",
",",
"String",
"[",
"]",
"args",
")",
"{",
"String",
"[",
"]",... | Initializes the Jython interpreter and executes a python script.
@param factory environment factory
@param scriptDirectory the directory containing all required user python scripts
@param scriptName the name of the main python script
@param args Command line arguments that will be delivered to the executed python scri... | [
"Initializes",
"the",
"Jython",
"interpreter",
"and",
"executes",
"a",
"python",
"script",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/util/InterpreterUtils.java#L105-L114 |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/common/lib/utils/Media.java | Media.saveMediaDataToFile | public static void saveMediaDataToFile(byte[] mediaData, File file)
throws FileNotFoundException, IOException {
"""
Saves media data downloaded from an API in {@code byte[]} format into a
file on the file system.
@param mediaData the media data {@code byte[]} to store on the file system
@param file the ... | java | public static void saveMediaDataToFile(byte[] mediaData, File file)
throws FileNotFoundException, IOException {
writeBytesToStream(mediaData, new FileOutputStream(file));
} | [
"public",
"static",
"void",
"saveMediaDataToFile",
"(",
"byte",
"[",
"]",
"mediaData",
",",
"File",
"file",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"writeBytesToStream",
"(",
"mediaData",
",",
"new",
"FileOutputStream",
"(",
"file",
")",
... | Saves media data downloaded from an API in {@code byte[]} format into a
file on the file system.
@param mediaData the media data {@code byte[]} to store on the file system
@param file the file on the file system to save the media data into
@throws FileNotFoundException if the file exists but is a directory, does
not e... | [
"Saves",
"media",
"data",
"downloaded",
"from",
"an",
"API",
"in",
"{",
"@code",
"byte",
"[]",
"}",
"format",
"into",
"a",
"file",
"on",
"the",
"file",
"system",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/utils/Media.java#L129-L132 |
probedock/probedock-java | src/main/java/io/probedock/client/core/filters/FilterUtils.java | FilterUtils.isRunnable | private static boolean isRunnable(FilterTargetData targetData, List<FilterDefinition> filters) {
"""
Define if a test is runnable based on the object that represents the test meta data
@param targetData The meta data
@param filters The filters
@return True if the test can be run
"""
if (filters ==... | java | private static boolean isRunnable(FilterTargetData targetData, List<FilterDefinition> filters) {
if (filters == null || filters.isEmpty()) {
return true;
}
for (FilterDefinition filterDefinition : filters) {
String type = filterDefinition.getType();
String te... | [
"private",
"static",
"boolean",
"isRunnable",
"(",
"FilterTargetData",
"targetData",
",",
"List",
"<",
"FilterDefinition",
">",
"filters",
")",
"{",
"if",
"(",
"filters",
"==",
"null",
"||",
"filters",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"true",
... | Define if a test is runnable based on the object that represents the test meta data
@param targetData The meta data
@param filters The filters
@return True if the test can be run | [
"Define",
"if",
"a",
"test",
"is",
"runnable",
"based",
"on",
"the",
"object",
"that",
"represents",
"the",
"test",
"meta",
"data"
] | train | https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/core/filters/FilterUtils.java#L82-L109 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptTask.java | AptTask.setProcessorOptions | public void setProcessorOptions(String processorOptions) {
"""
The srcExtensions attribute can be set to a comma-separated list of processor options
(of the form <i>option</i> or <i>option</i><code>=</code><i>value</i>) to be passed to
APT.
"""
StringTokenizer tok = new StringTokenizer(processorOptions, ",... | java | public void setProcessorOptions(String processorOptions)
{
StringTokenizer tok = new StringTokenizer(processorOptions, ",");
while (tok.hasMoreTokens())
_processorOptions.add(tok.nextToken());
} | [
"public",
"void",
"setProcessorOptions",
"(",
"String",
"processorOptions",
")",
"{",
"StringTokenizer",
"tok",
"=",
"new",
"StringTokenizer",
"(",
"processorOptions",
",",
"\",\"",
")",
";",
"while",
"(",
"tok",
".",
"hasMoreTokens",
"(",
")",
")",
"_processorO... | The srcExtensions attribute can be set to a comma-separated list of processor options
(of the form <i>option</i> or <i>option</i><code>=</code><i>value</i>) to be passed to
APT. | [
"The",
"srcExtensions",
"attribute",
"can",
"be",
"set",
"to",
"a",
"comma",
"-",
"separated",
"list",
"of",
"processor",
"options",
"(",
"of",
"the",
"form",
"<i",
">",
"option<",
"/",
"i",
">",
"or",
"<i",
">",
"option<",
"/",
"i",
">",
"<code",
">... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptTask.java#L69-L74 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java | TempByteHolder.writeToTempFile | private void writeToTempFile(int at_offset, byte[] data, int offset, int len) throws IOException {
"""
Write chunk of data at specified offset in temp file.
Marks data as big.
Updates high water mark on tempfile content.
"""
if (_tempfile == null) {
createTempFile();
_file_pos... | java | private void writeToTempFile(int at_offset, byte[] data, int offset, int len) throws IOException {
if (_tempfile == null) {
createTempFile();
_file_pos = -1;
}
_file_mode = true;
if (at_offset != _file_pos) {
_tempfile.seek((long)at_offset);
}
... | [
"private",
"void",
"writeToTempFile",
"(",
"int",
"at_offset",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_tempfile",
"==",
"null",
")",
"{",
"createTempFile",
"(",
")",
";",
"... | Write chunk of data at specified offset in temp file.
Marks data as big.
Updates high water mark on tempfile content. | [
"Write",
"chunk",
"of",
"data",
"at",
"specified",
"offset",
"in",
"temp",
"file",
".",
"Marks",
"data",
"as",
"big",
".",
"Updates",
"high",
"water",
"mark",
"on",
"tempfile",
"content",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java#L335-L347 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/cdn/CdnClient.java | CdnClient.setHttpsConfig | public void setHttpsConfig(String domain, HttpsConfig https) {
"""
Set HTTPS with certain configuration.
@param domain Name of the domain.
@param https The configuration of HTTPS.
"""
SetHttpsConfigRequest request = new SetHttpsConfigRequest()
.withDomain(domain)
.wi... | java | public void setHttpsConfig(String domain, HttpsConfig https) {
SetHttpsConfigRequest request = new SetHttpsConfigRequest()
.withDomain(domain)
.withHttps(https);
setHttpsConfig(request);
} | [
"public",
"void",
"setHttpsConfig",
"(",
"String",
"domain",
",",
"HttpsConfig",
"https",
")",
"{",
"SetHttpsConfigRequest",
"request",
"=",
"new",
"SetHttpsConfigRequest",
"(",
")",
".",
"withDomain",
"(",
"domain",
")",
".",
"withHttps",
"(",
"https",
")",
"... | Set HTTPS with certain configuration.
@param domain Name of the domain.
@param https The configuration of HTTPS. | [
"Set",
"HTTPS",
"with",
"certain",
"configuration",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/cdn/CdnClient.java#L453-L458 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.primitiveArrayGet | protected static Object primitiveArrayGet(Object self, int idx) {
"""
Implements the getAt(int) method for primitive type arrays.
@param self an array object
@param idx the index of interest
@return the returned value from the array
@since 1.5.0
"""
return Array.get(self, normaliseIndex(idx, Arr... | java | protected static Object primitiveArrayGet(Object self, int idx) {
return Array.get(self, normaliseIndex(idx, Array.getLength(self)));
} | [
"protected",
"static",
"Object",
"primitiveArrayGet",
"(",
"Object",
"self",
",",
"int",
"idx",
")",
"{",
"return",
"Array",
".",
"get",
"(",
"self",
",",
"normaliseIndex",
"(",
"idx",
",",
"Array",
".",
"getLength",
"(",
"self",
")",
")",
")",
";",
"}... | Implements the getAt(int) method for primitive type arrays.
@param self an array object
@param idx the index of interest
@return the returned value from the array
@since 1.5.0 | [
"Implements",
"the",
"getAt",
"(",
"int",
")",
"method",
"for",
"primitive",
"type",
"arrays",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L14544-L14546 |
wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/domain/controller/plan/ServerTaskExecutor.java | ServerTaskExecutor.executeTask | public int executeTask(final TransactionalProtocolClient.TransactionalOperationListener<ServerOperation> listener, final ServerUpdateTask task) {
"""
Execute a server task.
@param listener the transactional server listener
@param task the server task
@return time to wait in ms for a response from the server, ... | java | public int executeTask(final TransactionalProtocolClient.TransactionalOperationListener<ServerOperation> listener, final ServerUpdateTask task) {
try {
return execute(listener, task.getServerIdentity(), task.getOperation());
} catch (OperationFailedException e) {
// Handle failur... | [
"public",
"int",
"executeTask",
"(",
"final",
"TransactionalProtocolClient",
".",
"TransactionalOperationListener",
"<",
"ServerOperation",
">",
"listener",
",",
"final",
"ServerUpdateTask",
"task",
")",
"{",
"try",
"{",
"return",
"execute",
"(",
"listener",
",",
"t... | Execute a server task.
@param listener the transactional server listener
@param task the server task
@return time to wait in ms for a response from the server, or {@code -1} if the task execution failed locally | [
"Execute",
"a",
"server",
"task",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/domain/controller/plan/ServerTaskExecutor.java#L81-L94 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/config/ConfigValueHelper.java | ConfigValueHelper.checkNormalWithCommaColon | protected static void checkNormalWithCommaColon(String configKey, String configValue)
throws SofaRpcRuntimeException {
"""
检查字符串是否是正常值(含冒号),不是则抛出异常
@param configKey 配置项
@param configValue 配置值
@throws SofaRpcRuntimeException 非法异常
"""
checkPattern(configKey, configValue, NORMAL_COMMA_COLON... | java | protected static void checkNormalWithCommaColon(String configKey, String configValue)
throws SofaRpcRuntimeException {
checkPattern(configKey, configValue, NORMAL_COMMA_COLON, "only allow a-zA-Z0-9 '-' '_' '.' ':' ','");
} | [
"protected",
"static",
"void",
"checkNormalWithCommaColon",
"(",
"String",
"configKey",
",",
"String",
"configValue",
")",
"throws",
"SofaRpcRuntimeException",
"{",
"checkPattern",
"(",
"configKey",
",",
"configValue",
",",
"NORMAL_COMMA_COLON",
",",
"\"only allow a-zA-Z0... | 检查字符串是否是正常值(含冒号),不是则抛出异常
@param configKey 配置项
@param configValue 配置值
@throws SofaRpcRuntimeException 非法异常 | [
"检查字符串是否是正常值(含冒号),不是则抛出异常"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/config/ConfigValueHelper.java#L130-L133 |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/filter/AbstractSecretColumnSqlFilter.java | AbstractSecretColumnSqlFilter.createDecryptor | private Function<Object, String> createDecryptor() throws GeneralSecurityException {
"""
{@link SecretResultSet} が復号に使用するラムダを構築する。
@return 暗号を受け取り平文を返すラムダ
@throws GeneralSecurityException サブクラスでの拡張に備えて javax.crypto パッケージ配下の例外の親クラス
"""
Cipher cipher = Cipher.getInstance(transformationType);
if (useIV) {... | java | private Function<Object, String> createDecryptor() throws GeneralSecurityException {
Cipher cipher = Cipher.getInstance(transformationType);
if (useIV) {
cipher.init(Cipher.DECRYPT_MODE, secretKey,
encryptCipher.getParameters().getParameterSpec(IvParameterSpec.class));
} else {
cipher.init(Cipher.DECRY... | [
"private",
"Function",
"<",
"Object",
",",
"String",
">",
"createDecryptor",
"(",
")",
"throws",
"GeneralSecurityException",
"{",
"Cipher",
"cipher",
"=",
"Cipher",
".",
"getInstance",
"(",
"transformationType",
")",
";",
"if",
"(",
"useIV",
")",
"{",
"cipher"... | {@link SecretResultSet} が復号に使用するラムダを構築する。
@return 暗号を受け取り平文を返すラムダ
@throws GeneralSecurityException サブクラスでの拡張に備えて javax.crypto パッケージ配下の例外の親クラス | [
"{",
"@link",
"SecretResultSet",
"}",
"が復号に使用するラムダを構築する。"
] | train | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/filter/AbstractSecretColumnSqlFilter.java#L251-L278 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/filter/CompareFileFilter.java | CompareFileFilter.init | public void init(Record record, String fieldNameToCheck, String strToCompare, String strSeekSign, Converter pconvFlag, boolean bDontFilterIfNullCompare, BaseField fldToCheck, BaseField fldToCompare) {
"""
Constructor.
@param fsToCheck The field sequence in this record to compare (see m_fldToCheck).
@param fldToC... | java | public void init(Record record, String fieldNameToCheck, String strToCompare, String strSeekSign, Converter pconvFlag, boolean bDontFilterIfNullCompare, BaseField fldToCheck, BaseField fldToCompare)
{
super.init(record);
this.setMasterSlaveFlag(FileListener.RUN_IN_SLAVE); // This runs on the slave... | [
"public",
"void",
"init",
"(",
"Record",
"record",
",",
"String",
"fieldNameToCheck",
",",
"String",
"strToCompare",
",",
"String",
"strSeekSign",
",",
"Converter",
"pconvFlag",
",",
"boolean",
"bDontFilterIfNullCompare",
",",
"BaseField",
"fldToCheck",
",",
"BaseFi... | Constructor.
@param fsToCheck The field sequence in this record to compare (see m_fldToCheck).
@param fldToCheck The field in this record to compare.
@param szstrSeekSign The comparison sign.
@param pconvFlag If this field is non-null and the state is false, don't do this comparison.
@param pfldToCompare The field to c... | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/filter/CompareFileFilter.java#L144-L159 |
jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/util/WordReplacer.java | WordReplacer.replaceWords | public static String replaceWords(String input, String[] words, String[] replaces) {
"""
Replace all words in the input by the replaces. The replacements happens only if the texts to replace are not
part of a greater word, that is, if the text is a whole word, separated by non {@link Character#isLetterOrDigit(cha... | java | public static String replaceWords(String input, String[] words, String[] replaces) {
StringBuilder sb = new StringBuilder(input);
replaceWords(sb, words, replaces);
return sb.toString();
} | [
"public",
"static",
"String",
"replaceWords",
"(",
"String",
"input",
",",
"String",
"[",
"]",
"words",
",",
"String",
"[",
"]",
"replaces",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"input",
")",
";",
"replaceWords",
"(",
"sb",
... | Replace all words in the input by the replaces. The replacements happens only if the texts to replace are not
part of a greater word, that is, if the text is a whole word, separated by non {@link Character#isLetterOrDigit(char)}
characters.
@param input the text where the replacements take place
@param words the words ... | [
"Replace",
"all",
"words",
"in",
"the",
"input",
"by",
"the",
"replaces",
".",
"The",
"replacements",
"happens",
"only",
"if",
"the",
"texts",
"to",
"replace",
"are",
"not",
"part",
"of",
"a",
"greater",
"word",
"that",
"is",
"if",
"the",
"text",
"is",
... | train | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/util/WordReplacer.java#L14-L18 |
mailin-api/sendinblue-java-mvn | src/main/java/com/sendinblue/Sendinblue.java | Sendinblue.delete_campaign | public String delete_campaign(Map<String, Object> data) {
"""
/*
Delete your campaigns.
@param {Object} data contains json objects as a key value pair from HashMap.
@options data {Integer} id: Id of campaign to be deleted [Mandatory]
"""
String id = data.get("id").toString();
return delete("... | java | public String delete_campaign(Map<String, Object> data) {
String id = data.get("id").toString();
return delete("campaign/" + id, EMPTY_STRING);
} | [
"public",
"String",
"delete_campaign",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
")",
"{",
"String",
"id",
"=",
"data",
".",
"get",
"(",
"\"id\"",
")",
".",
"toString",
"(",
")",
";",
"return",
"delete",
"(",
"\"campaign/\"",
"+",
"id",
... | /*
Delete your campaigns.
@param {Object} data contains json objects as a key value pair from HashMap.
@options data {Integer} id: Id of campaign to be deleted [Mandatory] | [
"/",
"*",
"Delete",
"your",
"campaigns",
"."
] | train | https://github.com/mailin-api/sendinblue-java-mvn/blob/3a186b004003450f18d619aa084adc8d75086183/src/main/java/com/sendinblue/Sendinblue.java#L419-L422 |
wcm-io/wcm-io-sling | commons/src/main/java/io/wcm/sling/commons/request/RequestPath.java | RequestPath.hasAnySelector | @SuppressWarnings("null")
public static boolean hasAnySelector(@NotNull SlingHttpServletRequest request, @NotNull String @NotNull... expectedSelectors) {
"""
Checks if one of the given selectors is present in the current URL request (at any position).
@param request Sling request
@param expectedSelectors Selec... | java | @SuppressWarnings("null")
public static boolean hasAnySelector(@NotNull SlingHttpServletRequest request, @NotNull String @NotNull... expectedSelectors) {
String[] selectors = request.getRequestPathInfo().getSelectors();
if (selectors != null && expectedSelectors != null) {
for (String expectedSelector :... | [
"@",
"SuppressWarnings",
"(",
"\"null\"",
")",
"public",
"static",
"boolean",
"hasAnySelector",
"(",
"@",
"NotNull",
"SlingHttpServletRequest",
"request",
",",
"@",
"NotNull",
"String",
"@",
"NotNull",
".",
".",
".",
"expectedSelectors",
")",
"{",
"String",
"[",... | Checks if one of the given selectors is present in the current URL request (at any position).
@param request Sling request
@param expectedSelectors Selectors string to check for.
@return true if the selector was found | [
"Checks",
"if",
"one",
"of",
"the",
"given",
"selectors",
"is",
"present",
"in",
"the",
"current",
"URL",
"request",
"(",
"at",
"any",
"position",
")",
"."
] | train | https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/request/RequestPath.java#L54-L65 |
znerd/xmlenc | src/main/java/org/znerd/xmlenc/XMLChecker.java | XMLChecker.checkS | public static final void checkS(char[] ch, int start, int length) throws NullPointerException, IndexOutOfBoundsException, InvalidXMLException {
"""
Checks if the specified part of a character array matches the <em>S</em> (white space)
production. See: <a href="http://www.w3.org/TR/REC-xml#NT-S">Definition of S</a... | java | public static final void checkS(char[] ch, int start, int length) throws NullPointerException, IndexOutOfBoundsException, InvalidXMLException {
// Loop through the array and check each character
for (int i = start; i < length; i++) {
int c = ch[i];
if (c != 0x20 && c != 0x9 && ... | [
"public",
"static",
"final",
"void",
"checkS",
"(",
"char",
"[",
"]",
"ch",
",",
"int",
"start",
",",
"int",
"length",
")",
"throws",
"NullPointerException",
",",
"IndexOutOfBoundsException",
",",
"InvalidXMLException",
"{",
"// Loop through the array and check each c... | Checks if the specified part of a character array matches the <em>S</em> (white space)
production. See: <a href="http://www.w3.org/TR/REC-xml#NT-S">Definition of S</a>.
@param ch the character array that contains the characters to be checked, cannot be
<code>null</code>.
@param start the start index into <code>ch... | [
"Checks",
"if",
"the",
"specified",
"part",
"of",
"a",
"character",
"array",
"matches",
"the",
"<em",
">",
"S<",
"/",
"em",
">",
"(",
"white",
"space",
")",
"production",
".",
"See",
":",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"w3",
".",... | train | https://github.com/znerd/xmlenc/blob/6ff483777d9467db9990b7c7ae0158f21a243c31/src/main/java/org/znerd/xmlenc/XMLChecker.java#L39-L49 |
zxing/zxing | javase/src/main/java/com/google/zxing/client/j2se/MatrixToImageWriter.java | MatrixToImageWriter.toBufferedImage | public static BufferedImage toBufferedImage(BitMatrix matrix, MatrixToImageConfig config) {
"""
As {@link #toBufferedImage(BitMatrix)}, but allows customization of the output.
@param matrix {@link BitMatrix} to write
@param config output configuration
@return {@link BufferedImage} representation of the input
... | java | public static BufferedImage toBufferedImage(BitMatrix matrix, MatrixToImageConfig config) {
int width = matrix.getWidth();
int height = matrix.getHeight();
BufferedImage image = new BufferedImage(width, height, config.getBufferedImageColorModel());
int onColor = config.getPixelOnColor();
int offColo... | [
"public",
"static",
"BufferedImage",
"toBufferedImage",
"(",
"BitMatrix",
"matrix",
",",
"MatrixToImageConfig",
"config",
")",
"{",
"int",
"width",
"=",
"matrix",
".",
"getWidth",
"(",
")",
";",
"int",
"height",
"=",
"matrix",
".",
"getHeight",
"(",
")",
";"... | As {@link #toBufferedImage(BitMatrix)}, but allows customization of the output.
@param matrix {@link BitMatrix} to write
@param config output configuration
@return {@link BufferedImage} representation of the input | [
"As",
"{",
"@link",
"#toBufferedImage",
"(",
"BitMatrix",
")",
"}",
"but",
"allows",
"customization",
"of",
"the",
"output",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/javase/src/main/java/com/google/zxing/client/j2se/MatrixToImageWriter.java#L60-L76 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/ALasDataManager.java | ALasDataManager.getDataManager | public static ALasDataManager getDataManager( File dataFile, GridCoverage2D inDem, double elevThreshold,
CoordinateReferenceSystem inCrs ) {
"""
Factory method to create {@link ALasDataManager}.
@param lasFile the las file or las folder index file.
@param inDem a dem to normalize the elevation. If ... | java | public static ALasDataManager getDataManager( File dataFile, GridCoverage2D inDem, double elevThreshold,
CoordinateReferenceSystem inCrs ) {
String lcName = dataFile.getName().toLowerCase();
if (lcName.endsWith(".las")) {
return new LasFileDataManager(dataFile, inDem, elevThresho... | [
"public",
"static",
"ALasDataManager",
"getDataManager",
"(",
"File",
"dataFile",
",",
"GridCoverage2D",
"inDem",
",",
"double",
"elevThreshold",
",",
"CoordinateReferenceSystem",
"inCrs",
")",
"{",
"String",
"lcName",
"=",
"dataFile",
".",
"getName",
"(",
")",
".... | Factory method to create {@link ALasDataManager}.
@param lasFile the las file or las folder index file.
@param inDem a dem to normalize the elevation. If <code>!null</code>, the height over the dtm is added as {@link LasRecord#groundElevation}.
@param elevThreshold a threshold to use for the elevation normalization.
@... | [
"Factory",
"method",
"to",
"create",
"{",
"@link",
"ALasDataManager",
"}",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/ALasDataManager.java#L73-L92 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java | ISPNCacheFactory.createCache | public Cache<K, V> createCache(final String regionId, MappedParametrizedObjectEntry parameterEntry)
throws RepositoryConfigurationException {
"""
Factory that creates and starts pre-configured instances of Infinispan.
Path to Infinispan configuration or template should be provided as
"infinispan-configurat... | java | public Cache<K, V> createCache(final String regionId, MappedParametrizedObjectEntry parameterEntry)
throws RepositoryConfigurationException
{
// get Infinispan configuration file path
final String configurationPath = parameterEntry.getParameterValue(INFINISPAN_CONFIG);
final String jndiUrl = ... | [
"public",
"Cache",
"<",
"K",
",",
"V",
">",
"createCache",
"(",
"final",
"String",
"regionId",
",",
"MappedParametrizedObjectEntry",
"parameterEntry",
")",
"throws",
"RepositoryConfigurationException",
"{",
"// get Infinispan configuration file path",
"final",
"String",
"... | Factory that creates and starts pre-configured instances of Infinispan.
Path to Infinispan configuration or template should be provided as
"infinispan-configuration" property in parameterEntry instance.
<br>
@param regionId the unique id of the cache region to create
@param parameterEntry
@return
@throws RepositoryCon... | [
"Factory",
"that",
"creates",
"and",
"starts",
"pre",
"-",
"configured",
"instances",
"of",
"Infinispan",
".",
"Path",
"to",
"Infinispan",
"configuration",
"or",
"template",
"should",
"be",
"provided",
"as",
"infinispan",
"-",
"configuration",
"property",
"in",
... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java#L139-L203 |
graknlabs/grakn | server/src/graql/gremlin/sets/EquivalentFragmentSets.java | EquivalentFragmentSets.relates | public static EquivalentFragmentSet relates(VarProperty varProperty, Variable relationType, Variable role) {
"""
An {@link EquivalentFragmentSet} that indicates a variable is a relation type which involves a role.
"""
return new AutoValue_RelatesFragmentSet(varProperty, relationType, role);
} | java | public static EquivalentFragmentSet relates(VarProperty varProperty, Variable relationType, Variable role) {
return new AutoValue_RelatesFragmentSet(varProperty, relationType, role);
} | [
"public",
"static",
"EquivalentFragmentSet",
"relates",
"(",
"VarProperty",
"varProperty",
",",
"Variable",
"relationType",
",",
"Variable",
"role",
")",
"{",
"return",
"new",
"AutoValue_RelatesFragmentSet",
"(",
"varProperty",
",",
"relationType",
",",
"role",
")",
... | An {@link EquivalentFragmentSet} that indicates a variable is a relation type which involves a role. | [
"An",
"{"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/graql/gremlin/sets/EquivalentFragmentSets.java#L99-L101 |
alkacon/opencms-core | src/org/opencms/site/CmsSiteManagerImpl.java | CmsSiteManagerImpl.addSite | public void addSite(CmsObject cms, CmsSite site) throws CmsException {
"""
Adds a site.<p>
@param cms the CMS object
@param site the site to add
@throws CmsException if something goes wrong
"""
// check permissions
if (OpenCms.getRunLevel() > OpenCms.RUNLEVEL_1_CORE_OBJECT) {
... | java | public void addSite(CmsObject cms, CmsSite site) throws CmsException {
// check permissions
if (OpenCms.getRunLevel() > OpenCms.RUNLEVEL_1_CORE_OBJECT) {
// simple unit tests will have runlevel 1 and no CmsObject
OpenCms.getRoleManager().checkRole(cms, CmsRole.DATABASE_MANAGER);... | [
"public",
"void",
"addSite",
"(",
"CmsObject",
"cms",
",",
"CmsSite",
"site",
")",
"throws",
"CmsException",
"{",
"// check permissions",
"if",
"(",
"OpenCms",
".",
"getRunLevel",
"(",
")",
">",
"OpenCms",
".",
"RUNLEVEL_1_CORE_OBJECT",
")",
"{",
"// simple unit... | Adds a site.<p>
@param cms the CMS object
@param site the site to add
@throws CmsException if something goes wrong | [
"Adds",
"a",
"site",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/CmsSiteManagerImpl.java#L240-L278 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/httpsessions/HttpSessionsSite.java | HttpSessionsSite.renameHttpSession | public boolean renameHttpSession(String oldName, String newName) {
"""
Renames a http session, making sure the new name is unique for the site.
@param oldName the old name
@param newName the new name
@return true, if successful
"""
// Check new name validity
if (newName == null || newName.isEmpty()) {... | java | public boolean renameHttpSession(String oldName, String newName) {
// Check new name validity
if (newName == null || newName.isEmpty()) {
log.warn("Trying to rename session from " + oldName + " illegal name: " + newName);
return false;
}
// Check existing old name
HttpSession session = getHttpSession(o... | [
"public",
"boolean",
"renameHttpSession",
"(",
"String",
"oldName",
",",
"String",
"newName",
")",
"{",
"// Check new name validity",
"if",
"(",
"newName",
"==",
"null",
"||",
"newName",
".",
"isEmpty",
"(",
")",
")",
"{",
"log",
".",
"warn",
"(",
"\"Trying ... | Renames a http session, making sure the new name is unique for the site.
@param oldName the old name
@param newName the new name
@return true, if successful | [
"Renames",
"a",
"http",
"session",
"making",
"sure",
"the",
"new",
"name",
"is",
"unique",
"for",
"the",
"site",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/httpsessions/HttpSessionsSite.java#L615-L639 |
apache/flink | flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/datastream/PythonDataStream.java | PythonDataStream.write_as_text | @PublicEvolving
public void write_as_text(String path, WriteMode mode) {
"""
A thin wrapper layer over {@link DataStream#writeAsText(java.lang.String, WriteMode)}.
@param path The path pointing to the location the text file is written to
@param mode Controls the behavior for existing files. Options are
NO_OV... | java | @PublicEvolving
public void write_as_text(String path, WriteMode mode) {
stream.writeAsText(path, mode);
} | [
"@",
"PublicEvolving",
"public",
"void",
"write_as_text",
"(",
"String",
"path",
",",
"WriteMode",
"mode",
")",
"{",
"stream",
".",
"writeAsText",
"(",
"path",
",",
"mode",
")",
";",
"}"
] | A thin wrapper layer over {@link DataStream#writeAsText(java.lang.String, WriteMode)}.
@param path The path pointing to the location the text file is written to
@param mode Controls the behavior for existing files. Options are
NO_OVERWRITE and OVERWRITE. | [
"A",
"thin",
"wrapper",
"layer",
"over",
"{",
"@link",
"DataStream#writeAsText",
"(",
"java",
".",
"lang",
".",
"String",
"WriteMode",
")",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/datastream/PythonDataStream.java#L164-L167 |
Red5/red5-io | src/main/java/org/red5/io/object/Serializer.java | Serializer.writeXMLType | protected static boolean writeXMLType(Output out, Object xml) {
"""
Writes an xml type out to the output
@param out
Output writer
@param xml
XML
@return boolean <tt>true</tt> if object was successfully written, <tt>false</tt> otherwise
"""
log.trace("writeXMLType");
// If it's a Document... | java | protected static boolean writeXMLType(Output out, Object xml) {
log.trace("writeXMLType");
// If it's a Document write it as Document
if (xml instanceof Document) {
writeDocument(out, (Document) xml);
} else {
return false;
}
return true;
} | [
"protected",
"static",
"boolean",
"writeXMLType",
"(",
"Output",
"out",
",",
"Object",
"xml",
")",
"{",
"log",
".",
"trace",
"(",
"\"writeXMLType\"",
")",
";",
"// If it's a Document write it as Document",
"if",
"(",
"xml",
"instanceof",
"Document",
")",
"{",
"w... | Writes an xml type out to the output
@param out
Output writer
@param xml
XML
@return boolean <tt>true</tt> if object was successfully written, <tt>false</tt> otherwise | [
"Writes",
"an",
"xml",
"type",
"out",
"to",
"the",
"output"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/object/Serializer.java#L298-L307 |
simlife/simlife | simlife-framework/src/main/java/io/github/simlife/service/QueryService.java | QueryService.buildReferringEntitySpecification | protected <OTHER, X> Specification<ENTITY> buildReferringEntitySpecification(Filter<X> filter,
SetAttribute<ENTITY, OTHER> reference,
SingularAttribute<OTHER, X> valueField) {
"""
Helper function to return a specification for filtering on one-to-many or many-to-many reference. Usage:
<pre>
Specif... | java | protected <OTHER, X> Specification<ENTITY> buildReferringEntitySpecification(Filter<X> filter,
SetAttribute<ENTITY, OTHER> reference,
SingularAttribute<OTHER, X> valueField) {
if (filter.getEquals() != null) {
return equalsSetSpecification(reference, valueField, filter.getEquals());
... | [
"protected",
"<",
"OTHER",
",",
"X",
">",
"Specification",
"<",
"ENTITY",
">",
"buildReferringEntitySpecification",
"(",
"Filter",
"<",
"X",
">",
"filter",
",",
"SetAttribute",
"<",
"ENTITY",
",",
"OTHER",
">",
"reference",
",",
"SingularAttribute",
"<",
"OTHE... | Helper function to return a specification for filtering on one-to-many or many-to-many reference. Usage:
<pre>
Specification<Employee> specByEmployeeId = buildReferringEntitySpecification(criteria.getEmployeId(),
Project_.employees, Employee_.id);
Specification<Employee> specByEmployeeName = buildReferringE... | [
"Helper",
"function",
"to",
"return",
"a",
"specification",
"for",
"filtering",
"on",
"one",
"-",
"to",
"-",
"many",
"or",
"many",
"-",
"to",
"-",
"many",
"reference",
".",
"Usage",
":",
"<pre",
">",
"Specification<",
";",
"Employee>",
";",
"specByEmpl... | train | https://github.com/simlife/simlife/blob/357bb8f3fb39e085239b89bc7f9a19248ff3d0bb/simlife-framework/src/main/java/io/github/simlife/service/QueryService.java#L218-L227 |
deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/AndroidNativeImageLoader.java | AndroidNativeImageLoader.asBitmap | public Bitmap asBitmap(INDArray array, int dataType) {
"""
Converts an INDArray to a Bitmap. Only intended for images with rank 3.
@param array to convert
@param dataType from JavaCV (DEPTH_FLOAT, DEPTH_UBYTE, etc), or -1 to use same type as the INDArray
@return data copied to a Frame
"""
return c... | java | public Bitmap asBitmap(INDArray array, int dataType) {
return converter2.convert(asFrame(array, dataType));
} | [
"public",
"Bitmap",
"asBitmap",
"(",
"INDArray",
"array",
",",
"int",
"dataType",
")",
"{",
"return",
"converter2",
".",
"convert",
"(",
"asFrame",
"(",
"array",
",",
"dataType",
")",
")",
";",
"}"
] | Converts an INDArray to a Bitmap. Only intended for images with rank 3.
@param array to convert
@param dataType from JavaCV (DEPTH_FLOAT, DEPTH_UBYTE, etc), or -1 to use same type as the INDArray
@return data copied to a Frame | [
"Converts",
"an",
"INDArray",
"to",
"a",
"Bitmap",
".",
"Only",
"intended",
"for",
"images",
"with",
"rank",
"3",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/AndroidNativeImageLoader.java#L92-L94 |
eserating/siren4j | src/main/java/com/google/code/siren4j/component/builder/BaseBuilder.java | BaseBuilder.addStep | protected void addStep(String methodName, Object[] args) {
"""
Adds a builder step for this builder, upon build these steps will be called in the same order they came in on.
@param methodName cannot be <code>null</code> or empty.
@param args may be <code>null</code> or empty.
"""
if(StringUtils.isBla... | java | protected void addStep(String methodName, Object[] args) {
if(StringUtils.isBlank(methodName)) {
throw new IllegalArgumentException("methodName cannot be null or empty.");
}
addStep(methodName, args, false);
} | [
"protected",
"void",
"addStep",
"(",
"String",
"methodName",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"methodName",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"methodName cannot be null or e... | Adds a builder step for this builder, upon build these steps will be called in the same order they came in on.
@param methodName cannot be <code>null</code> or empty.
@param args may be <code>null</code> or empty. | [
"Adds",
"a",
"builder",
"step",
"for",
"this",
"builder",
"upon",
"build",
"these",
"steps",
"will",
"be",
"called",
"in",
"the",
"same",
"order",
"they",
"came",
"in",
"on",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/component/builder/BaseBuilder.java#L139-L144 |
buschmais/jqa-java-plugin | src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/AbstractAnnotationVisitor.java | AbstractAnnotationVisitor.addValue | private void addValue(String name, ValueDescriptor<?> value) {
"""
Add the descriptor as value to the current annotation or array value.
@param name
The name.
@param value
The value.
"""
if (arrayValueDescriptor != null && name == null) {
getArrayValue().add(value);
} else {
... | java | private void addValue(String name, ValueDescriptor<?> value) {
if (arrayValueDescriptor != null && name == null) {
getArrayValue().add(value);
} else {
setValue(descriptor, value);
}
} | [
"private",
"void",
"addValue",
"(",
"String",
"name",
",",
"ValueDescriptor",
"<",
"?",
">",
"value",
")",
"{",
"if",
"(",
"arrayValueDescriptor",
"!=",
"null",
"&&",
"name",
"==",
"null",
")",
"{",
"getArrayValue",
"(",
")",
".",
"add",
"(",
"value",
... | Add the descriptor as value to the current annotation or array value.
@param name
The name.
@param value
The value. | [
"Add",
"the",
"descriptor",
"as",
"value",
"to",
"the",
"current",
"annotation",
"or",
"array",
"value",
"."
] | train | https://github.com/buschmais/jqa-java-plugin/blob/4c050943e9c28cf1c4a08aa962d5b5bf03c4fe54/src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/AbstractAnnotationVisitor.java#L121-L127 |
foundation-runtime/service-directory | 1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lookup/LookupManagerImpl.java | LookupManagerImpl.addInstanceChangeListener | @Override
public void addInstanceChangeListener(String serviceName, ServiceInstanceChangeListener listener) throws ServiceException {
"""
Add a ServiceInstanceChangeListener to the Service.
This method will check the duplicated listener for the serviceName, if the listener
already exists for the serviceNam... | java | @Override
public void addInstanceChangeListener(String serviceName, ServiceInstanceChangeListener listener) throws ServiceException {
ServiceInstanceUtils.validateManagerIsStarted(isStarted.get());
ServiceInstanceUtils.validateServiceName(serviceName);
if (listener == null) {
thr... | [
"@",
"Override",
"public",
"void",
"addInstanceChangeListener",
"(",
"String",
"serviceName",
",",
"ServiceInstanceChangeListener",
"listener",
")",
"throws",
"ServiceException",
"{",
"ServiceInstanceUtils",
".",
"validateManagerIsStarted",
"(",
"isStarted",
".",
"get",
"... | Add a ServiceInstanceChangeListener to the Service.
This method will check the duplicated listener for the serviceName, if the listener
already exists for the serviceName, do nothing.
Throws IllegalArgumentException if serviceName or listener is null.
@param serviceName
the service name
@param listener
the ServiceIn... | [
"Add",
"a",
"ServiceInstanceChangeListener",
"to",
"the",
"Service",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lookup/LookupManagerImpl.java#L413-L427 |
igniterealtime/REST-API-Client | src/main/java/org/igniterealtime/restclient/RestApiClient.java | RestApiClient.deleteOutcastGroup | public Response deleteOutcastGroup(String roomName, String groupName) {
"""
Delete outcast group from chatroom.
@param roomName
the room name
@param groupName
the groupName
@return the response
"""
return restClient.delete("chatrooms/" + roomName + "/outcasts/group/" + groupName,
... | java | public Response deleteOutcastGroup(String roomName, String groupName) {
return restClient.delete("chatrooms/" + roomName + "/outcasts/group/" + groupName,
new HashMap<String, String>());
} | [
"public",
"Response",
"deleteOutcastGroup",
"(",
"String",
"roomName",
",",
"String",
"groupName",
")",
"{",
"return",
"restClient",
".",
"delete",
"(",
"\"chatrooms/\"",
"+",
"roomName",
"+",
"\"/outcasts/group/\"",
"+",
"groupName",
",",
"new",
"HashMap",
"<",
... | Delete outcast group from chatroom.
@param roomName
the room name
@param groupName
the groupName
@return the response | [
"Delete",
"outcast",
"group",
"from",
"chatroom",
"."
] | train | https://github.com/igniterealtime/REST-API-Client/blob/fd544dd770ec2ababa47fef51579522ddce09f05/src/main/java/org/igniterealtime/restclient/RestApiClient.java#L450-L453 |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonObjectDeserializer.java | JsonObjectDeserializer.getRequiredNode | protected final JsonNode getRequiredNode(JsonNode tree, String fieldName) {
"""
Helper method to return a {@link JsonNode} from the tree.
@param tree the source tree
@param fieldName the field name to extract
@return the {@link JsonNode}
"""
Assert.notNull(tree, "Tree must not be null");
JsonNode node =... | java | protected final JsonNode getRequiredNode(JsonNode tree, String fieldName) {
Assert.notNull(tree, "Tree must not be null");
JsonNode node = tree.get(fieldName);
Assert.state(node != null && !(node instanceof NullNode),
() -> "Missing JSON field '" + fieldName + "'");
return node;
} | [
"protected",
"final",
"JsonNode",
"getRequiredNode",
"(",
"JsonNode",
"tree",
",",
"String",
"fieldName",
")",
"{",
"Assert",
".",
"notNull",
"(",
"tree",
",",
"\"Tree must not be null\"",
")",
";",
"JsonNode",
"node",
"=",
"tree",
".",
"get",
"(",
"fieldName"... | Helper method to return a {@link JsonNode} from the tree.
@param tree the source tree
@param fieldName the field name to extract
@return the {@link JsonNode} | [
"Helper",
"method",
"to",
"return",
"a",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonObjectDeserializer.java#L130-L136 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/view/HeaderAndFooterGridView.java | HeaderAndFooterGridView.getNumColumnsCompatible | protected final int getNumColumnsCompatible() {
"""
Returns the number of the grid view's columns by either using the
<code>getNumColumns</code>-method on devices with API level 11 or greater, or via reflection
on older devices.
@return The number of the grid view's columns as an {@link Integer} value or {@li... | java | protected final int getNumColumnsCompatible() {
try {
Field numColumns = GridView.class.getDeclaredField("mNumColumns");
numColumns.setAccessible(true);
return numColumns.getInt(this);
} catch (Exception e) {
throw new RuntimeException("Unable to retrieve ... | [
"protected",
"final",
"int",
"getNumColumnsCompatible",
"(",
")",
"{",
"try",
"{",
"Field",
"numColumns",
"=",
"GridView",
".",
"class",
".",
"getDeclaredField",
"(",
"\"mNumColumns\"",
")",
";",
"numColumns",
".",
"setAccessible",
"(",
"true",
")",
";",
"retu... | Returns the number of the grid view's columns by either using the
<code>getNumColumns</code>-method on devices with API level 11 or greater, or via reflection
on older devices.
@return The number of the grid view's columns as an {@link Integer} value or {@link
#AUTO_FIT}, if the layout is pending | [
"Returns",
"the",
"number",
"of",
"the",
"grid",
"view",
"s",
"columns",
"by",
"either",
"using",
"the",
"<code",
">",
"getNumColumns<",
"/",
"code",
">",
"-",
"method",
"on",
"devices",
"with",
"API",
"level",
"11",
"or",
"greater",
"or",
"via",
"reflec... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/HeaderAndFooterGridView.java#L436-L444 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.context/src/com/ibm/ws/security/context/internal/SecurityContextImpl.java | SecurityContextImpl.recreateFullSubjects | protected void recreateFullSubjects(SecurityService securityService, AtomicServiceReference<UnauthenticatedSubjectService> unauthenticatedSubjectServiceRef) {
"""
After deserializing the security context, re-inflate the subjects (need to add the missing credentials, since these don't get serialized)
@param secu... | java | protected void recreateFullSubjects(SecurityService securityService, AtomicServiceReference<UnauthenticatedSubjectService> unauthenticatedSubjectServiceRef) {
callerSubject = recreateFullSubject(callerPrincipal, securityService, unauthenticatedSubjectServiceRef, callerSubjectCacheKey);
if (!subjectsAreE... | [
"protected",
"void",
"recreateFullSubjects",
"(",
"SecurityService",
"securityService",
",",
"AtomicServiceReference",
"<",
"UnauthenticatedSubjectService",
">",
"unauthenticatedSubjectServiceRef",
")",
"{",
"callerSubject",
"=",
"recreateFullSubject",
"(",
"callerPrincipal",
"... | After deserializing the security context, re-inflate the subjects (need to add the missing credentials, since these don't get serialized)
@param securityService the security service to use for authenticating the user
@param unauthenticatedSubjectServiceRef reference to the unauthenticated subject service for creating ... | [
"After",
"deserializing",
"the",
"security",
"context",
"re",
"-",
"inflate",
"the",
"subjects",
"(",
"need",
"to",
"add",
"the",
"missing",
"credentials",
"since",
"these",
"don",
"t",
"get",
"serialized",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.context/src/com/ibm/ws/security/context/internal/SecurityContextImpl.java#L418-L425 |
fedups/com.obdobion.algebrain | src/main/java/com/obdobion/algebrain/Equ.java | Equ.registerFunction | public void registerFunction(final String name, final Class<?> functionSubclass) throws Exception {
"""
<p>
registerFunction.
</p>
@param name a {@link java.lang.String} object.
@param functionSubclass a {@link java.lang.Class} object.
@throws java.lang.Exception if any.
"""
final String token =... | java | public void registerFunction(final String name, final Class<?> functionSubclass) throws Exception
{
final String token = name.toLowerCase();
if (functionMap.containsKey(name))
throw new Exception("duplicate function: " + token);
try
{
functionMap.put(token, fu... | [
"public",
"void",
"registerFunction",
"(",
"final",
"String",
"name",
",",
"final",
"Class",
"<",
"?",
">",
"functionSubclass",
")",
"throws",
"Exception",
"{",
"final",
"String",
"token",
"=",
"name",
".",
"toLowerCase",
"(",
")",
";",
"if",
"(",
"functio... | <p>
registerFunction.
</p>
@param name a {@link java.lang.String} object.
@param functionSubclass a {@link java.lang.Class} object.
@throws java.lang.Exception if any. | [
"<p",
">",
"registerFunction",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/fedups/com.obdobion.algebrain/blob/d0adaa9fbbba907bdcf820961e9058b0d2b15a8a/src/main/java/com/obdobion/algebrain/Equ.java#L564-L578 |
rythmengine/rythmengine | src/main/java/org/rythmengine/RythmEngine.java | RythmEngine.renderString | @SuppressWarnings("unchecked")
public String renderString(String key, String template, Object... args) {
"""
Render result from a direct template content. The template key
has been provided as well
<p>See {@link #getTemplate(java.io.File, Object...)} for note on
render args</p>
@param key the template ... | java | @SuppressWarnings("unchecked")
public String renderString(String key, String template, Object... args) {
boolean typeInferenceEnabled = conf().typeInferenceEnabled();
if (typeInferenceEnabled) {
ParamTypeInferencer.registerParams(this, args);
}
if (typeInferenceEnabled) ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"String",
"renderString",
"(",
"String",
"key",
",",
"String",
"template",
",",
"Object",
"...",
"args",
")",
"{",
"boolean",
"typeInferenceEnabled",
"=",
"conf",
"(",
")",
".",
"typeInferenceEnabled"... | Render result from a direct template content. The template key
has been provided as well
<p>See {@link #getTemplate(java.io.File, Object...)} for note on
render args</p>
@param key the template key which will be used to generate
@param template the inline template content
@param args the render args array
@return... | [
"Render",
"result",
"from",
"a",
"direct",
"template",
"content",
".",
"The",
"template",
"key",
"has",
"been",
"provided",
"as",
"well"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/RythmEngine.java#L1173-L1195 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java | ComponentTag.setAttribute | protected void setAttribute(String key, Object value, int scope) {
"""
each attribute set by a tag should use this method for attribute declaration;
an existing value with the same key is registered and restored if the tag rendering ends
"""
Map<String, Object> replacedInScope = getReplacedAttributes... | java | protected void setAttribute(String key, Object value, int scope) {
Map<String, Object> replacedInScope = getReplacedAttributes(scope);
if (!replacedInScope.containsKey(key)) {
Object current = pageContext.getAttribute(key, scope);
replacedInScope.put(key, current);
}... | [
"protected",
"void",
"setAttribute",
"(",
"String",
"key",
",",
"Object",
"value",
",",
"int",
"scope",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"replacedInScope",
"=",
"getReplacedAttributes",
"(",
"scope",
")",
";",
"if",
"(",
"!",
"replacedIn... | each attribute set by a tag should use this method for attribute declaration;
an existing value with the same key is registered and restored if the tag rendering ends | [
"each",
"attribute",
"set",
"by",
"a",
"tag",
"should",
"use",
"this",
"method",
"for",
"attribute",
"declaration",
";",
"an",
"existing",
"value",
"with",
"the",
"same",
"key",
"is",
"registered",
"and",
"restored",
"if",
"the",
"tag",
"rendering",
"ends"
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java#L282-L289 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/Validate.java | Validate.validIndex | public static <T extends CharSequence> T validIndex(final T chars, final int index, final String message, final Object... values) {
"""
<p>Validates that the index is within the bounds of the argument
character sequence; otherwise throwing an exception with the
specified message.</p>
<pre>Validate.validIndex(... | java | public static <T extends CharSequence> T validIndex(final T chars, final int index, final String message, final Object... values) {
Validate.notNull(chars);
if (index < 0 || index >= chars.length()) {
throw new IndexOutOfBoundsException(StringUtils.simpleFormat(message, values));
}
... | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validIndex",
"(",
"final",
"T",
"chars",
",",
"final",
"int",
"index",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"Validate",
".",
"notNull",
"... | <p>Validates that the index is within the bounds of the argument
character sequence; otherwise throwing an exception with the
specified message.</p>
<pre>Validate.validIndex(myStr, 2, "The string index is invalid: ");</pre>
<p>If the character sequence is {@code null}, then the message
of the exception is "The v... | [
"<p",
">",
"Validates",
"that",
"the",
"index",
"is",
"within",
"the",
"bounds",
"of",
"the",
"argument",
"character",
"sequence",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/Validate.java#L753-L759 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_orderableHostProfiles_GET | public ArrayList<net.minidev.ovh.api.dedicatedcloud.host.OvhProfile> serviceName_datacenter_datacenterId_orderableHostProfiles_GET(String serviceName, Long datacenterId) throws IOException {
"""
List available hosts in a given Private Cloud Datacenter
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacent... | java | public ArrayList<net.minidev.ovh.api.dedicatedcloud.host.OvhProfile> serviceName_datacenter_datacenterId_orderableHostProfiles_GET(String serviceName, Long datacenterId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/orderableHostProfiles";
StringBuilder sb = path(qPath... | [
"public",
"ArrayList",
"<",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"dedicatedcloud",
".",
"host",
".",
"OvhProfile",
">",
"serviceName_datacenter_datacenterId_orderableHostProfiles_GET",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
")",
"t... | List available hosts in a given Private Cloud Datacenter
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/orderableHostProfiles
@param serviceName [required] Domain of the service
@param datacenterId [required] | [
"List",
"available",
"hosts",
"in",
"a",
"given",
"Private",
"Cloud",
"Datacenter"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L2355-L2360 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagImage.java | CmsJspTagImage.getScaler | public static CmsImageScaler getScaler(CmsImageScaler scaler, CmsImageScaler original, String scaleParam) {
"""
Creates the images scaler used by this image tag.<p>
@param scaler the scaler created from this tags parameters
@param original a scaler that contains the original image dimensions
@param scaleParam... | java | public static CmsImageScaler getScaler(CmsImageScaler scaler, CmsImageScaler original, String scaleParam) {
if (scaleParam != null) {
CmsImageScaler cropScaler = null;
// use cropped image as a base for scaling
cropScaler = new CmsImageScaler(scaleParam);
if (sca... | [
"public",
"static",
"CmsImageScaler",
"getScaler",
"(",
"CmsImageScaler",
"scaler",
",",
"CmsImageScaler",
"original",
",",
"String",
"scaleParam",
")",
"{",
"if",
"(",
"scaleParam",
"!=",
"null",
")",
"{",
"CmsImageScaler",
"cropScaler",
"=",
"null",
";",
"// u... | Creates the images scaler used by this image tag.<p>
@param scaler the scaler created from this tags parameters
@param original a scaler that contains the original image dimensions
@param scaleParam optional scaler parameters for cropping
@return the images scaler used by this image tag | [
"Creates",
"the",
"images",
"scaler",
"used",
"by",
"this",
"image",
"tag",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagImage.java#L161-L183 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.xor | public static Boolean xor(Boolean left, Boolean right) {
"""
Exclusive disjunction of two boolean operators
@param left left operator
@param right right operator
@return result of exclusive disjunction
@since 1.0
"""
return left ^ Boolean.TRUE.equals(right);
} | java | public static Boolean xor(Boolean left, Boolean right) {
return left ^ Boolean.TRUE.equals(right);
} | [
"public",
"static",
"Boolean",
"xor",
"(",
"Boolean",
"left",
",",
"Boolean",
"right",
")",
"{",
"return",
"left",
"^",
"Boolean",
".",
"TRUE",
".",
"equals",
"(",
"right",
")",
";",
"}"
] | Exclusive disjunction of two boolean operators
@param left left operator
@param right right operator
@return result of exclusive disjunction
@since 1.0 | [
"Exclusive",
"disjunction",
"of",
"two",
"boolean",
"operators"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L16633-L16635 |
betfair/cougar | cougar-framework/jms-transport/src/main/java/com/betfair/cougar/transport/jms/JmsEventTransportImpl.java | JmsEventTransportImpl.initThreadPool | public void initThreadPool() {
"""
Initialise the thread pool to have the requested number of threads available, life span of threads (set to 0) not used as threads will never be eligible to die as coreSize = maxSize
"""
CustomizableThreadFactory ctf = new CustomizableThreadFactory();
ctf.setDa... | java | public void initThreadPool() {
CustomizableThreadFactory ctf = new CustomizableThreadFactory();
ctf.setDaemon(true);
ctf.setThreadNamePrefix(getTransportName()+"-Publisher-");
threadPool = new JMXReportingThreadPoolExecutor(threadPoolSize, threadPoolSize, 0, TimeUnit.SECONDS, new LinkedB... | [
"public",
"void",
"initThreadPool",
"(",
")",
"{",
"CustomizableThreadFactory",
"ctf",
"=",
"new",
"CustomizableThreadFactory",
"(",
")",
";",
"ctf",
".",
"setDaemon",
"(",
"true",
")",
";",
"ctf",
".",
"setThreadNamePrefix",
"(",
"getTransportName",
"(",
")",
... | Initialise the thread pool to have the requested number of threads available, life span of threads (set to 0) not used as threads will never be eligible to die as coreSize = maxSize | [
"Initialise",
"the",
"thread",
"pool",
"to",
"have",
"the",
"requested",
"number",
"of",
"threads",
"available",
"life",
"span",
"of",
"threads",
"(",
"set",
"to",
"0",
")",
"not",
"used",
"as",
"threads",
"will",
"never",
"be",
"eligible",
"to",
"die",
... | train | https://github.com/betfair/cougar/blob/08d1fe338fbd0e8572a9c2305bb5796402d5b1f5/cougar-framework/jms-transport/src/main/java/com/betfair/cougar/transport/jms/JmsEventTransportImpl.java#L177-L182 |
intellimate/Izou | src/main/java/org/intellimate/izou/events/EventDistributor.java | EventDistributor.unregisterEventListener | @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
public void unregisterEventListener(EventModel<EventModel> event, EventListenerModel eventListener) throws IllegalArgumentException {
"""
unregister an EventListener
It will unregister for all Descriptors individually!
It will also ignore... | java | @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
public void unregisterEventListener(EventModel<EventModel> event, EventListenerModel eventListener) throws IllegalArgumentException {
for (String id : event.getAllInformations()) {
ArrayList<EventListenerModel> listenersList = ... | [
"@",
"SuppressWarnings",
"(",
"\"SynchronizationOnLocalVariableOrMethodParameter\"",
")",
"public",
"void",
"unregisterEventListener",
"(",
"EventModel",
"<",
"EventModel",
">",
"event",
",",
"EventListenerModel",
"eventListener",
")",
"throws",
"IllegalArgumentException",
"{... | unregister an EventListener
It will unregister for all Descriptors individually!
It will also ignore if this listener is not listening to an Event.
Method is thread-safe.
@param event the Event to stop listen to
@param eventListener the ActivatorEventListener used to listen for events
@throws IllegalArgumentException... | [
"unregister",
"an",
"EventListener"
] | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/events/EventDistributor.java#L158-L169 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.setLookAlong | public Matrix4x3f setLookAlong(Vector3fc dir, Vector3fc up) {
"""
Set this matrix to a rotation transformation to make <code>-z</code>
point along <code>dir</code>.
<p>
This is equivalent to calling
{@link #setLookAt(Vector3fc, Vector3fc, Vector3fc) setLookAt()}
with <code>eye = (0, 0, 0)</code> and <code>cen... | java | public Matrix4x3f setLookAlong(Vector3fc dir, Vector3fc up) {
return setLookAlong(dir.x(), dir.y(), dir.z(), up.x(), up.y(), up.z());
} | [
"public",
"Matrix4x3f",
"setLookAlong",
"(",
"Vector3fc",
"dir",
",",
"Vector3fc",
"up",
")",
"{",
"return",
"setLookAlong",
"(",
"dir",
".",
"x",
"(",
")",
",",
"dir",
".",
"y",
"(",
")",
",",
"dir",
".",
"z",
"(",
")",
",",
"up",
".",
"x",
"(",... | Set this matrix to a rotation transformation to make <code>-z</code>
point along <code>dir</code>.
<p>
This is equivalent to calling
{@link #setLookAt(Vector3fc, Vector3fc, Vector3fc) setLookAt()}
with <code>eye = (0, 0, 0)</code> and <code>center = dir</code>.
<p>
In order to apply the lookalong transformation to any ... | [
"Set",
"this",
"matrix",
"to",
"a",
"rotation",
"transformation",
"to",
"make",
"<code",
">",
"-",
"z<",
"/",
"code",
">",
"point",
"along",
"<code",
">",
"dir<",
"/",
"code",
">",
".",
"<p",
">",
"This",
"is",
"equivalent",
"to",
"calling",
"{",
"@l... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L6116-L6118 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/dbserver/ConnectionManager.java | ConnectionManager.allocateClient | private synchronized Client allocateClient(int targetPlayer, String description) throws IOException {
"""
Finds or opens a client to talk to the dbserver on the specified player, incrementing its use count.
@param targetPlayer the player number whose database needs to be interacted with
@param description a sh... | java | private synchronized Client allocateClient(int targetPlayer, String description) throws IOException {
Client result = openClients.get(targetPlayer);
if (result == null) {
// We need to open a new connection.
final DeviceAnnouncement deviceAnnouncement = DeviceFinder.getInstance()... | [
"private",
"synchronized",
"Client",
"allocateClient",
"(",
"int",
"targetPlayer",
",",
"String",
"description",
")",
"throws",
"IOException",
"{",
"Client",
"result",
"=",
"openClients",
".",
"get",
"(",
"targetPlayer",
")",
";",
"if",
"(",
"result",
"==",
"n... | Finds or opens a client to talk to the dbserver on the specified player, incrementing its use count.
@param targetPlayer the player number whose database needs to be interacted with
@param description a short description of the task being performed for error reporting if it fails,
should be a verb phrase like "request... | [
"Finds",
"or",
"opens",
"a",
"client",
"to",
"talk",
"to",
"the",
"dbserver",
"on",
"the",
"specified",
"player",
"incrementing",
"its",
"use",
"count",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/ConnectionManager.java#L103-L138 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/DiscussionResourcesImpl.java | DiscussionResourcesImpl.addDiscussionComment | public Comment addDiscussionComment(long id, Comment comment) throws SmartsheetException {
"""
Add a comment to a discussion.
It mirrors to the following Smartsheet REST API method: POST /discussion/{discussionId}/comments
Exceptions:
IllegalArgumentException : if any argument is null
InvalidRequestExcepti... | java | public Comment addDiscussionComment(long id, Comment comment) throws SmartsheetException {
return this.createResource("discussion/" + id + "/comments", Comment.class, comment);
} | [
"public",
"Comment",
"addDiscussionComment",
"(",
"long",
"id",
",",
"Comment",
"comment",
")",
"throws",
"SmartsheetException",
"{",
"return",
"this",
".",
"createResource",
"(",
"\"discussion/\"",
"+",
"id",
"+",
"\"/comments\"",
",",
"Comment",
".",
"class",
... | Add a comment to a discussion.
It mirrors to the following Smartsheet REST API method: POST /discussion/{discussionId}/comments
Exceptions:
IllegalArgumentException : if any argument is null
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem wi... | [
"Add",
"a",
"comment",
"to",
"a",
"discussion",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/DiscussionResourcesImpl.java#L79-L81 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/SchedulesInner.java | SchedulesInner.createOrUpdate | public ScheduleInner createOrUpdate(String resourceGroupName, String automationAccountName, String scheduleName, ScheduleCreateOrUpdateParameters parameters) {
"""
Create a schedule.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@par... | java | public ScheduleInner createOrUpdate(String resourceGroupName, String automationAccountName, String scheduleName, ScheduleCreateOrUpdateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, scheduleName, parameters).toBlocking().single().body();
} | [
"public",
"ScheduleInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"scheduleName",
",",
"ScheduleCreateOrUpdateParameters",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"r... | Create a schedule.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param scheduleName The schedule name.
@param parameters The parameters supplied to the create or update schedule operation.
@throws IllegalArgumentException thrown if parameter... | [
"Create",
"a",
"schedule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/SchedulesInner.java#L105-L107 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/transport/remote/jgroups/JGroupsTransport.java | JGroupsTransport.join | public void join(org.ironjacamar.core.spi.workmanager.Address logicalAddress, org.jgroups.Address address) {
"""
Delegator
@param logicalAddress The logical address
@param address The address
"""
super.join(logicalAddress, address);
} | java | public void join(org.ironjacamar.core.spi.workmanager.Address logicalAddress, org.jgroups.Address address)
{
super.join(logicalAddress, address);
} | [
"public",
"void",
"join",
"(",
"org",
".",
"ironjacamar",
".",
"core",
".",
"spi",
".",
"workmanager",
".",
"Address",
"logicalAddress",
",",
"org",
".",
"jgroups",
".",
"Address",
"address",
")",
"{",
"super",
".",
"join",
"(",
"logicalAddress",
",",
"a... | Delegator
@param logicalAddress The logical address
@param address The address | [
"Delegator"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/transport/remote/jgroups/JGroupsTransport.java#L270-L273 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java | ExtensionsInner.getAsync | public Observable<ExtensionInner> getAsync(String resourceGroupName, String clusterName, String extensionName) {
"""
Gets the extension properties for the specified HDInsight cluster extension.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param extensio... | java | public Observable<ExtensionInner> getAsync(String resourceGroupName, String clusterName, String extensionName) {
return getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1<ServiceResponse<ExtensionInner>, ExtensionInner>() {
@Override
public Extension... | [
"public",
"Observable",
"<",
"ExtensionInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"extensionName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
",",
"ext... | Gets the extension properties for the specified HDInsight cluster extension.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param extensionName The name of the cluster extension.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the... | [
"Gets",
"the",
"extension",
"properties",
"for",
"the",
"specified",
"HDInsight",
"cluster",
"extension",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java#L733-L740 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/RunUnderUOWCallback.java | RunUnderUOWCallback.contextChange | public void contextChange(int typeOfChange, UOWCoordinator UOW)
throws IllegalStateException {
"""
This method will be called for POST_BEGIN and POST_END for all
UOWs started with com.ibm.wsspi.uow.UOWManager.runUnderUOW(). <p>
When called, an indication will be stored in the current EJB me... | java | public void contextChange(int typeOfChange, UOWCoordinator UOW)
throws IllegalStateException
{
EJSDeployedSupport s = EJSContainer.getMethodContext();
// Note: runUnderUOW() may be called outside the scope of an EJB
// method ( i.e. no method context ), in which ca... | [
"public",
"void",
"contextChange",
"(",
"int",
"typeOfChange",
",",
"UOWCoordinator",
"UOW",
")",
"throws",
"IllegalStateException",
"{",
"EJSDeployedSupport",
"s",
"=",
"EJSContainer",
".",
"getMethodContext",
"(",
")",
";",
"// Note: runUnderUOW() may be called outside ... | This method will be called for POST_BEGIN and POST_END for all
UOWs started with com.ibm.wsspi.uow.UOWManager.runUnderUOW(). <p>
When called, an indication will be stored in the current EJB method
context, recording the fact that a user initiated transaction has
been started. This indication will be reset when the use... | [
"This",
"method",
"will",
"be",
"called",
"for",
"POST_BEGIN",
"and",
"POST_END",
"for",
"all",
"UOWs",
"started",
"with",
"com",
".",
"ibm",
".",
"wsspi",
".",
"uow",
".",
"UOWManager",
".",
"runUnderUOW",
"()",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/RunUnderUOWCallback.java#L79-L109 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/util/graph/ValueGraphElements.java | ValueGraphElements.getElement | public ValueGraphElement getElement(int i) {
"""
return the i'th ValueGraphElement
@param i the index of the element to return
@return the ValueGraphElement at index i
"""
if((i < 0) || (i >= values.length)) {
throw new NoSuchElementException();
}
int minHeight = config.valueMinHeight;
// norma... | java | public ValueGraphElement getElement(int i) {
if((i < 0) || (i >= values.length)) {
throw new NoSuchElementException();
}
int minHeight = config.valueMinHeight;
// normalize height to value between 0 and 1:
float value = ((float) values[i]) / ((float) maxValue);
float usableHeight = height - minHeight;... | [
"public",
"ValueGraphElement",
"getElement",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"(",
"i",
"<",
"0",
")",
"||",
"(",
"i",
">=",
"values",
".",
"length",
")",
")",
"{",
"throw",
"new",
"NoSuchElementException",
"(",
")",
";",
"}",
"int",
"minHeight"... | return the i'th ValueGraphElement
@param i the index of the element to return
@return the ValueGraphElement at index i | [
"return",
"the",
"i",
"th",
"ValueGraphElement"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/util/graph/ValueGraphElements.java#L63-L79 |
alexcojocaru/elasticsearch-maven-plugin | src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/client/Monitor.java | Monitor.isProcessRunning | public static boolean isProcessRunning(String baseDir) {
"""
Check whether the PID file created by the ES process exists or not.
@param baseDir the ES base directory
@return true if the process is running, false otherwise
"""
File pidFile = new File(baseDir, "pid");
boolean exists = pidFile.i... | java | public static boolean isProcessRunning(String baseDir)
{
File pidFile = new File(baseDir, "pid");
boolean exists = pidFile.isFile();
return exists;
} | [
"public",
"static",
"boolean",
"isProcessRunning",
"(",
"String",
"baseDir",
")",
"{",
"File",
"pidFile",
"=",
"new",
"File",
"(",
"baseDir",
",",
"\"pid\"",
")",
";",
"boolean",
"exists",
"=",
"pidFile",
".",
"isFile",
"(",
")",
";",
"return",
"exists",
... | Check whether the PID file created by the ES process exists or not.
@param baseDir the ES base directory
@return true if the process is running, false otherwise | [
"Check",
"whether",
"the",
"PID",
"file",
"created",
"by",
"the",
"ES",
"process",
"exists",
"or",
"not",
"."
] | train | https://github.com/alexcojocaru/elasticsearch-maven-plugin/blob/c283053cf99dc6b6d411b58629364b6aae62b7f8/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/client/Monitor.java#L56-L61 |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/util/IndentedPrintStream.java | IndentedPrintStream.printAlignedBlock | private void printAlignedBlock(String separator, String terminator) {
"""
Prints the alignedblock, with all strings aligned in columns dependent on the order in which they were declared in Align
@param separator text added to the end of each line except the last line
@param terminator text added to the end of th... | java | private void printAlignedBlock(String separator, String terminator) {
if (alignedBlock != null) {
alignedBlock.print(separator, terminator);
alignedBlock = null;
}
} | [
"private",
"void",
"printAlignedBlock",
"(",
"String",
"separator",
",",
"String",
"terminator",
")",
"{",
"if",
"(",
"alignedBlock",
"!=",
"null",
")",
"{",
"alignedBlock",
".",
"print",
"(",
"separator",
",",
"terminator",
")",
";",
"alignedBlock",
"=",
"n... | Prints the alignedblock, with all strings aligned in columns dependent on the order in which they were declared in Align
@param separator text added to the end of each line except the last line
@param terminator text added to the end of the last line of the block | [
"Prints",
"the",
"alignedblock",
"with",
"all",
"strings",
"aligned",
"in",
"columns",
"dependent",
"on",
"the",
"order",
"in",
"which",
"they",
"were",
"declared",
"in",
"Align"
] | train | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/util/IndentedPrintStream.java#L76-L81 |
JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/IntEvaluator.java | IntEvaluator.evaluate | public Integer evaluate(float fraction, Integer startValue, Integer endValue) {
"""
This function returns the result of linearly interpolating the start and end values, with
<code>fraction</code> representing the proportion between the start and end values. The
calculation is a simple parametric calculation: <co... | java | public Integer evaluate(float fraction, Integer startValue, Integer endValue) {
int startInt = startValue;
return (int)(startInt + fraction * (endValue - startInt));
} | [
"public",
"Integer",
"evaluate",
"(",
"float",
"fraction",
",",
"Integer",
"startValue",
",",
"Integer",
"endValue",
")",
"{",
"int",
"startInt",
"=",
"startValue",
";",
"return",
"(",
"int",
")",
"(",
"startInt",
"+",
"fraction",
"*",
"(",
"endValue",
"-"... | This function returns the result of linearly interpolating the start and end values, with
<code>fraction</code> representing the proportion between the start and end values. The
calculation is a simple parametric calculation: <code>result = x0 + t * (v1 - v0)</code>,
where <code>x0</code> is <code>startValue</code>, <c... | [
"This",
"function",
"returns",
"the",
"result",
"of",
"linearly",
"interpolating",
"the",
"start",
"and",
"end",
"values",
"with",
"<code",
">",
"fraction<",
"/",
"code",
">",
"representing",
"the",
"proportion",
"between",
"the",
"start",
"and",
"end",
"value... | train | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/IntEvaluator.java#L38-L41 |
facebookarchive/hadoop-20 | src/contrib/benchmark/src/java/org/apache/hadoop/hdfs/StructureGenerator.java | StructureGenerator.run | public int run(String[] args) throws Exception {
"""
The main function first parses the command line arguments,
then generates in-memory directory structure and outputs to a file,
last generates in-memory files and outputs them to a file.
"""
int exitCode = 0;
exitCode = init(args);
if (exitCode ... | java | public int run(String[] args) throws Exception {
int exitCode = 0;
exitCode = init(args);
if (exitCode != 0) {
return exitCode;
}
genDirStructure();
output(new File(outDir, DIR_STRUCTURE_FILE_NAME));
genFileStructure();
outputFiles(new File(outDir, FILE_STRUCTURE_FILE_NAME));
r... | [
"public",
"int",
"run",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"int",
"exitCode",
"=",
"0",
";",
"exitCode",
"=",
"init",
"(",
"args",
")",
";",
"if",
"(",
"exitCode",
"!=",
"0",
")",
"{",
"return",
"exitCode",
";",
"}",
... | The main function first parses the command line arguments,
then generates in-memory directory structure and outputs to a file,
last generates in-memory files and outputs them to a file. | [
"The",
"main",
"function",
"first",
"parses",
"the",
"command",
"line",
"arguments",
"then",
"generates",
"in",
"-",
"memory",
"directory",
"structure",
"and",
"outputs",
"to",
"a",
"file",
"last",
"generates",
"in",
"-",
"memory",
"files",
"and",
"outputs",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/benchmark/src/java/org/apache/hadoop/hdfs/StructureGenerator.java#L86-L97 |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java | AdminResource.getVersion | @GET
@Path("version")
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response getVersion() {
"""
Fetches the version for this application.
@return json representing the version.
"""
if (LOG.isDebugEnabled()) {
LOG.debug("==> AdminResource.getVersion()");
}
if (ve... | java | @GET
@Path("version")
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response getVersion() {
if (LOG.isDebugEnabled()) {
LOG.debug("==> AdminResource.getVersion()");
}
if (version == null) {
try {
PropertiesConfiguration configProperties = new Pro... | [
"@",
"GET",
"@",
"Path",
"(",
"\"version\"",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"public",
"Response",
"getVersion",
"(",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
... | Fetches the version for this application.
@return json representing the version. | [
"Fetches",
"the",
"version",
"for",
"this",
"application",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java#L177-L208 |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/event/annotation/SubscribeBeanPostProcessor.java | SubscribeBeanPostProcessor.postProcessBeforeDestruction | @Override
public void postProcessBeforeDestruction(final Object bean, final String beanName) throws BeansException {
"""
Unsubscribes the subscriber bean from the corresponding {@link EventBus}.
"""
if (subscribers.containsKey(beanName)) {
Subscribe annotation = getAnnotation(bean.getClass(), beanName... | java | @Override
public void postProcessBeforeDestruction(final Object bean, final String beanName) throws BeansException {
if (subscribers.containsKey(beanName)) {
Subscribe annotation = getAnnotation(bean.getClass(), beanName);
LOG.debug("Unsubscribing the event listener '{}' from event bus '{}' with topic '{}"... | [
"@",
"Override",
"public",
"void",
"postProcessBeforeDestruction",
"(",
"final",
"Object",
"bean",
",",
"final",
"String",
"beanName",
")",
"throws",
"BeansException",
"{",
"if",
"(",
"subscribers",
".",
"containsKey",
"(",
"beanName",
")",
")",
"{",
"Subscribe"... | Unsubscribes the subscriber bean from the corresponding {@link EventBus}. | [
"Unsubscribes",
"the",
"subscriber",
"bean",
"from",
"the",
"corresponding",
"{"
] | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/event/annotation/SubscribeBeanPostProcessor.java#L85-L100 |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.readFloat | public static Float readFloat(String value, Float defaultValue) {
"""
Read float.
@param value the value
@param defaultValue the default value
@return the float
"""
if (!StringUtils.hasText(value)) return defaultValue;
return Float.valueOf(value);
} | java | public static Float readFloat(String value, Float defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Float.valueOf(value);
} | [
"public",
"static",
"Float",
"readFloat",
"(",
"String",
"value",
",",
"Float",
"defaultValue",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"value",
")",
")",
"return",
"defaultValue",
";",
"return",
"Float",
".",
"valueOf",
"(",
"value",... | Read float.
@param value the value
@param defaultValue the default value
@return the float | [
"Read",
"float",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L176-L180 |
aws/aws-sdk-java | aws-java-sdk-cloudsearch/src/main/java/com/amazonaws/services/cloudsearchdomain/model/Hit.java | Hit.withHighlights | public Hit withHighlights(java.util.Map<String, String> highlights) {
"""
<p>
The highlights returned from a document that matches the search request.
</p>
@param highlights
The highlights returned from a document that matches the search request.
@return Returns a reference to this object so that method cal... | java | public Hit withHighlights(java.util.Map<String, String> highlights) {
setHighlights(highlights);
return this;
} | [
"public",
"Hit",
"withHighlights",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"highlights",
")",
"{",
"setHighlights",
"(",
"highlights",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The highlights returned from a document that matches the search request.
</p>
@param highlights
The highlights returned from a document that matches the search request.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"highlights",
"returned",
"from",
"a",
"document",
"that",
"matches",
"the",
"search",
"request",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudsearch/src/main/java/com/amazonaws/services/cloudsearchdomain/model/Hit.java#L259-L262 |
javagl/CommonUI | src/main/java/de/javagl/common/ui/table/renderer/SortOrderTableHeaderCellRenderer.java | SortOrderTableHeaderCellRenderer.createArrowShape | private static Shape createArrowShape(int w, int y0, int y1) {
"""
Creates a triangle shape with the given coordinates
@param w The width
@param y0 The first y-coordinate
@param y1 The second y-coordinate
@return The shape
"""
Path2D path = new Path2D.Double();
path.moveTo(0, y0);
... | java | private static Shape createArrowShape(int w, int y0, int y1)
{
Path2D path = new Path2D.Double();
path.moveTo(0, y0);
if ((w & 1) == 0)
{
path.lineTo(w>>1, y1);
}
else
{
int c = w>>1;
path.lineTo(c, y1);
... | [
"private",
"static",
"Shape",
"createArrowShape",
"(",
"int",
"w",
",",
"int",
"y0",
",",
"int",
"y1",
")",
"{",
"Path2D",
"path",
"=",
"new",
"Path2D",
".",
"Double",
"(",
")",
";",
"path",
".",
"moveTo",
"(",
"0",
",",
"y0",
")",
";",
"if",
"("... | Creates a triangle shape with the given coordinates
@param w The width
@param y0 The first y-coordinate
@param y1 The second y-coordinate
@return The shape | [
"Creates",
"a",
"triangle",
"shape",
"with",
"the",
"given",
"coordinates"
] | train | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/table/renderer/SortOrderTableHeaderCellRenderer.java#L150-L167 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.booleanSupplier | public static BooleanSupplier booleanSupplier(CheckedBooleanSupplier supplier, Consumer<Throwable> handler) {
"""
Wrap a {@link CheckedBooleanSupplier} in a {@link BooleanSupplier} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
ResultSet rs = statement.executeQuery();
Stream.generate... | java | public static BooleanSupplier booleanSupplier(CheckedBooleanSupplier supplier, Consumer<Throwable> handler) {
return () -> {
try {
return supplier.getAsBoolean();
}
catch (Throwable e) {
handler.accept(e);
throw new IllegalStat... | [
"public",
"static",
"BooleanSupplier",
"booleanSupplier",
"(",
"CheckedBooleanSupplier",
"supplier",
",",
"Consumer",
"<",
"Throwable",
">",
"handler",
")",
"{",
"return",
"(",
")",
"->",
"{",
"try",
"{",
"return",
"supplier",
".",
"getAsBoolean",
"(",
")",
";... | Wrap a {@link CheckedBooleanSupplier} in a {@link BooleanSupplier} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
ResultSet rs = statement.executeQuery();
Stream.generate(Unchecked.booleanSupplier(
() -> rs.getBoolean(1),
e -> {
throw new IllegalStateException(e);
}
));
</pre></code> | [
"Wrap",
"a",
"{",
"@link",
"CheckedBooleanSupplier",
"}",
"in",
"a",
"{",
"@link",
"BooleanSupplier",
"}",
"with",
"a",
"custom",
"handler",
"for",
"checked",
"exceptions",
".",
"<p",
">",
"Example",
":",
"<code",
">",
"<pre",
">",
"ResultSet",
"rs",
"=",
... | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L1856-L1867 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.injectBean | @Internal
@SuppressWarnings( {
"""
The default implementation which provides no injection. To be overridden by compile time tooling.
@param resolutionContext The resolution context
@param context The bean context
@param bean The bean
@return The injected bean
""""WeakerAccess",... | java | @Internal
@SuppressWarnings({"WeakerAccess", "unused"})
@UsedByGeneratedCode
protected Object injectBean(BeanResolutionContext resolutionContext, BeanContext context, Object bean) {
return bean;
} | [
"@",
"Internal",
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"@",
"UsedByGeneratedCode",
"protected",
"Object",
"injectBean",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"BeanContext",
"context",
",",
"Object",
"bean... | The default implementation which provides no injection. To be overridden by compile time tooling.
@param resolutionContext The resolution context
@param context The bean context
@param bean The bean
@return The injected bean | [
"The",
"default",
"implementation",
"which",
"provides",
"no",
"injection",
".",
"To",
"be",
"overridden",
"by",
"compile",
"time",
"tooling",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L582-L587 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.findXField | public static @CheckForNull XField findXField(FieldInstruction fins, @Nonnull ConstantPoolGen cpg) {
"""
Look up the field referenced by given FieldInstruction, returning it as
an {@link XField XField} object.
@param fins
the FieldInstruction
@param cpg
the ConstantPoolGen used by the class containing the
... | java | public static @CheckForNull XField findXField(FieldInstruction fins, @Nonnull ConstantPoolGen cpg) {
String className = fins.getClassName(cpg);
String fieldName = fins.getFieldName(cpg);
String fieldSig = fins.getSignature(cpg);
boolean isStatic = (fins.getOpcode() == Const.GETSTATIC |... | [
"public",
"static",
"@",
"CheckForNull",
"XField",
"findXField",
"(",
"FieldInstruction",
"fins",
",",
"@",
"Nonnull",
"ConstantPoolGen",
"cpg",
")",
"{",
"String",
"className",
"=",
"fins",
".",
"getClassName",
"(",
"cpg",
")",
";",
"String",
"fieldName",
"="... | Look up the field referenced by given FieldInstruction, returning it as
an {@link XField XField} object.
@param fins
the FieldInstruction
@param cpg
the ConstantPoolGen used by the class containing the
instruction
@return an XField object representing the field, or null if no such field
could be found | [
"Look",
"up",
"the",
"field",
"referenced",
"by",
"given",
"FieldInstruction",
"returning",
"it",
"as",
"an",
"{",
"@link",
"XField",
"XField",
"}",
"object",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L941-L957 |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.initMultipartUpload | private String initMultipartUpload(String bucketName, String objectName, Map<String, String> headerMap)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException,
... | java | private String initMultipartUpload(String bucketName, String objectName, Map<String, String> headerMap)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException,
... | [
"private",
"String",
"initMultipartUpload",
"(",
"String",
"bucketName",
",",
"String",
"objectName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headerMap",
")",
"throws",
"InvalidBucketNameException",
",",
"NoSuchAlgorithmException",
",",
"InsufficientDataExceptio... | Initializes new multipart upload for given bucket name, object name and content type. | [
"Initializes",
"new",
"multipart",
"upload",
"for",
"given",
"bucket",
"name",
"object",
"name",
"and",
"content",
"type",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L4722-L4740 |
zxing/zxing | core/src/main/java/com/google/zxing/qrcode/decoder/Decoder.java | Decoder.correctErrors | private void correctErrors(byte[] codewordBytes, int numDataCodewords) throws ChecksumException {
"""
<p>Given data and error-correction codewords received, possibly corrupted by errors, attempts to
correct the errors in-place using Reed-Solomon error correction.</p>
@param codewordBytes data and error correct... | java | private void correctErrors(byte[] codewordBytes, int numDataCodewords) throws ChecksumException {
int numCodewords = codewordBytes.length;
// First read into an array of ints
int[] codewordsInts = new int[numCodewords];
for (int i = 0; i < numCodewords; i++) {
codewordsInts[i] = codewordBytes[i] &... | [
"private",
"void",
"correctErrors",
"(",
"byte",
"[",
"]",
"codewordBytes",
",",
"int",
"numDataCodewords",
")",
"throws",
"ChecksumException",
"{",
"int",
"numCodewords",
"=",
"codewordBytes",
".",
"length",
";",
"// First read into an array of ints",
"int",
"[",
"... | <p>Given data and error-correction codewords received, possibly corrupted by errors, attempts to
correct the errors in-place using Reed-Solomon error correction.</p>
@param codewordBytes data and error correction codewords
@param numDataCodewords number of codewords that are data bytes
@throws ChecksumException if err... | [
"<p",
">",
"Given",
"data",
"and",
"error",
"-",
"correction",
"codewords",
"received",
"possibly",
"corrupted",
"by",
"errors",
"attempts",
"to",
"correct",
"the",
"errors",
"in",
"-",
"place",
"using",
"Reed",
"-",
"Solomon",
"error",
"correction",
".",
"<... | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/qrcode/decoder/Decoder.java#L170-L187 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.get | public static FileSystem get(URI uri, Configuration conf) throws IOException {
"""
Returns the FileSystem for this URI's scheme and authority. The scheme
of the URI determines a configuration property name,
<tt>fs.<i>scheme</i>.class</tt> whose value names the FileSystem class.
The entire URI is passed to the ... | java | public static FileSystem get(URI uri, Configuration conf) throws IOException {
String scheme = uri.getScheme();
String authority = uri.getAuthority();
if (scheme == null) { // no scheme: use default FS
return get(conf);
}
if (authority == null) { /... | [
"public",
"static",
"FileSystem",
"get",
"(",
"URI",
"uri",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"String",
"scheme",
"=",
"uri",
".",
"getScheme",
"(",
")",
";",
"String",
"authority",
"=",
"uri",
".",
"getAuthority",
"(",
")",
... | Returns the FileSystem for this URI's scheme and authority. The scheme
of the URI determines a configuration property name,
<tt>fs.<i>scheme</i>.class</tt> whose value names the FileSystem class.
The entire URI is passed to the FileSystem instance's initialize method. | [
"Returns",
"the",
"FileSystem",
"for",
"this",
"URI",
"s",
"scheme",
"and",
"authority",
".",
"The",
"scheme",
"of",
"the",
"URI",
"determines",
"a",
"configuration",
"property",
"name",
"<tt",
">",
"fs",
".",
"<i",
">",
"scheme<",
"/",
"i",
">",
".",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L189-L211 |
Azure/azure-sdk-for-java | iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java | AppsInner.getByResourceGroupAsync | public Observable<AppInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) {
"""
Get the metadata of an IoT Central application.
@param resourceGroupName The name of the resource group that contains the IoT Central application.
@param resourceName The ARM resource name of the IoT Centra... | java | public Observable<AppInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<AppInner>, AppInner>() {
@Override
public AppInner call(ServiceResponse<Ap... | [
"public",
"Observable",
"<",
"AppInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",
"map",
... | Get the metadata of an IoT Central application.
@param resourceGroupName The name of the resource group that contains the IoT Central application.
@param resourceName The ARM resource name of the IoT Central application.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable t... | [
"Get",
"the",
"metadata",
"of",
"an",
"IoT",
"Central",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java#L156-L163 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TabbedPaneTabCloseButtonPainter.java | TabbedPaneTabCloseButtonPainter.drawEnabledGraphic | private void drawEnabledGraphic(Graphics2D g, int width, int height) {
"""
Draw the "close" graphic for the simple enabled state.
@param g the Graphic context.
@param width the width of the graphic.
@param height the height of the graphic.
"""
Shape s = shapeGenerator.createTabCloseIcon(2, 2... | java | private void drawEnabledGraphic(Graphics2D g, int width, int height) {
Shape s = shapeGenerator.createTabCloseIcon(2, 2, width - 4, height - 4);
g.setPaint(createGraphicInnerShadowGradient(s));
g.fill(s);
} | [
"private",
"void",
"drawEnabledGraphic",
"(",
"Graphics2D",
"g",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Shape",
"s",
"=",
"shapeGenerator",
".",
"createTabCloseIcon",
"(",
"2",
",",
"2",
",",
"width",
"-",
"4",
",",
"height",
"-",
"4",
"... | Draw the "close" graphic for the simple enabled state.
@param g the Graphic context.
@param width the width of the graphic.
@param height the height of the graphic. | [
"Draw",
"the",
"close",
"graphic",
"for",
"the",
"simple",
"enabled",
"state",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TabbedPaneTabCloseButtonPainter.java#L140-L145 |
google/closure-templates | java/src/com/google/template/soy/parsepasses/contextautoesc/SoyAutoescapeException.java | SoyAutoescapeException.createCausedWithNode | static SoyAutoescapeException createCausedWithNode(
String message, Throwable cause, SoyNode node) {
"""
Creates a SoyAutoescapeException, with meta info filled in based on the given Soy node.
@param message The error message.
@param cause The cause of this exception.
@param node The node from which to ... | java | static SoyAutoescapeException createCausedWithNode(
String message, Throwable cause, SoyNode node) {
return new SoyAutoescapeException(message, cause, node);
} | [
"static",
"SoyAutoescapeException",
"createCausedWithNode",
"(",
"String",
"message",
",",
"Throwable",
"cause",
",",
"SoyNode",
"node",
")",
"{",
"return",
"new",
"SoyAutoescapeException",
"(",
"message",
",",
"cause",
",",
"node",
")",
";",
"}"
] | Creates a SoyAutoescapeException, with meta info filled in based on the given Soy node.
@param message The error message.
@param cause The cause of this exception.
@param node The node from which to derive the exception meta info.
@return The new SoyAutoescapeException object. | [
"Creates",
"a",
"SoyAutoescapeException",
"with",
"meta",
"info",
"filled",
"in",
"based",
"on",
"the",
"given",
"Soy",
"node",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/parsepasses/contextautoesc/SoyAutoescapeException.java#L48-L51 |
XDean/Java-EX | src/main/java/xdean/jex/util/task/TaskUtil.java | TaskUtil.firstSuccess | @SafeVarargs
public static <T> T firstSuccess(FuncE0<T, ?>... tasks) throws IllegalStateException {
"""
Return the first result of these tasks<br>
IGNORE EXCEPTIONS.
@param tasks
@return can be null
@throws IllegalStateException If all tasks failed.
"""
for (FuncE0<T, ?> task : tasks) {
Ei... | java | @SafeVarargs
public static <T> T firstSuccess(FuncE0<T, ?>... tasks) throws IllegalStateException {
for (FuncE0<T, ?> task : tasks) {
Either<T, ?> res = throwToReturn(task);
if (res.isLeft()) {
return res.getLeft();
}
}
throw new IllegalStateException("All tasks failed");... | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"T",
"firstSuccess",
"(",
"FuncE0",
"<",
"T",
",",
"?",
">",
"...",
"tasks",
")",
"throws",
"IllegalStateException",
"{",
"for",
"(",
"FuncE0",
"<",
"T",
",",
"?",
">",
"task",
":",
"tasks",
")",... | Return the first result of these tasks<br>
IGNORE EXCEPTIONS.
@param tasks
@return can be null
@throws IllegalStateException If all tasks failed. | [
"Return",
"the",
"first",
"result",
"of",
"these",
"tasks<br",
">",
"IGNORE",
"EXCEPTIONS",
"."
] | train | https://github.com/XDean/Java-EX/blob/9208ba71c5b2af9f9bd979d01fab2ff5e433b3e7/src/main/java/xdean/jex/util/task/TaskUtil.java#L42-L51 |
beeinstant-dev/beeinstant-java-sdk | src/main/java/com/beeinstant/metrics/MetricsLogger.java | MetricsLogger.extendMultipleDimensionsIncludeRoot | public Metrics extendMultipleDimensionsIncludeRoot(final String... dimensionsGroup) {
"""
Extend the root dimensions with a group of new dimensions, but also include the root dimensions into the group.
For example:
The root dimensions is "service=AwesomeService".
extendMultipleDimensionsIncludeRoot("api=Upload"... | java | public Metrics extendMultipleDimensionsIncludeRoot(final String... dimensionsGroup) {
final String[] dimensionsGroupWithRoot = Arrays.copyOf(dimensionsGroup, dimensionsGroup.length + 1);
// root dimensions is equivalent to extend root dimensions with no new dimension
dimensionsGroupWithRoot[dime... | [
"public",
"Metrics",
"extendMultipleDimensionsIncludeRoot",
"(",
"final",
"String",
"...",
"dimensionsGroup",
")",
"{",
"final",
"String",
"[",
"]",
"dimensionsGroupWithRoot",
"=",
"Arrays",
".",
"copyOf",
"(",
"dimensionsGroup",
",",
"dimensionsGroup",
".",
"length",... | Extend the root dimensions with a group of new dimensions, but also include the root dimensions into the group.
For example:
The root dimensions is "service=AwesomeService".
extendMultipleDimensionsIncludeRoot("api=Upload") will create a metrics object which contains
the root dimensions "service=AwesomeService" and the... | [
"Extend",
"the",
"root",
"dimensions",
"with",
"a",
"group",
"of",
"new",
"dimensions",
"but",
"also",
"include",
"the",
"root",
"dimensions",
"into",
"the",
"group",
".",
"For",
"example",
":",
"The",
"root",
"dimensions",
"is",
"service",
"=",
"AwesomeServ... | train | https://github.com/beeinstant-dev/beeinstant-java-sdk/blob/c51d7e931bd5f057f77406d393760cf42caf0599/src/main/java/com/beeinstant/metrics/MetricsLogger.java#L91-L96 |
xwiki/xwiki-rendering | xwiki-rendering-transformations/xwiki-rendering-transformation-icon/src/main/java/org/xwiki/rendering/internal/transformation/icon/IconTransformation.java | IconTransformation.blockEquals | private boolean blockEquals(Block target, Block source) {
"""
Compares two nodes in a shallow manner (children data are not compared).
@param target the target node to compare
@param source the source node to compare
@return true if the two blocks are equals in a shallow manner (children data are not compared... | java | private boolean blockEquals(Block target, Block source)
{
boolean found = false;
if (source instanceof SpecialSymbolBlock && target instanceof SpecialSymbolBlock) {
if (((SpecialSymbolBlock) target).getSymbol() == ((SpecialSymbolBlock) source).getSymbol()) {
found = true;... | [
"private",
"boolean",
"blockEquals",
"(",
"Block",
"target",
",",
"Block",
"source",
")",
"{",
"boolean",
"found",
"=",
"false",
";",
"if",
"(",
"source",
"instanceof",
"SpecialSymbolBlock",
"&&",
"target",
"instanceof",
"SpecialSymbolBlock",
")",
"{",
"if",
"... | Compares two nodes in a shallow manner (children data are not compared).
@param target the target node to compare
@param source the source node to compare
@return true if the two blocks are equals in a shallow manner (children data are not compared) | [
"Compares",
"two",
"nodes",
"in",
"a",
"shallow",
"manner",
"(",
"children",
"data",
"are",
"not",
"compared",
")",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-transformations/xwiki-rendering-transformation-icon/src/main/java/org/xwiki/rendering/internal/transformation/icon/IconTransformation.java#L196-L211 |
google/j2objc | jre_emul/android/frameworks/base/core/java/android/util/Log.java | Log.isLoggable | public static boolean isLoggable(String tag, int level) {
"""
Checks to see whether or not a log for the specified tag is loggable at the specified level.
The default level of any tag is set to INFO. This means that any level above and including
INFO will be logged. Before you make any calls to a logging metho... | java | public static boolean isLoggable(String tag, int level) {
Integer minimumLevel = tagLevels.get(tag);
if (minimumLevel != null) {
return level > minimumLevel.intValue();
}
return true; // Let java.util.logging filter it.
} | [
"public",
"static",
"boolean",
"isLoggable",
"(",
"String",
"tag",
",",
"int",
"level",
")",
"{",
"Integer",
"minimumLevel",
"=",
"tagLevels",
".",
"get",
"(",
"tag",
")",
";",
"if",
"(",
"minimumLevel",
"!=",
"null",
")",
"{",
"return",
"level",
">",
... | Checks to see whether or not a log for the specified tag is loggable at the specified level.
The default level of any tag is set to INFO. This means that any level above and including
INFO will be logged. Before you make any calls to a logging method you should check to see
if your tag should be logged. You can change... | [
"Checks",
"to",
"see",
"whether",
"or",
"not",
"a",
"log",
"for",
"the",
"specified",
"tag",
"is",
"loggable",
"at",
"the",
"specified",
"level",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/util/Log.java#L258-L264 |
wildfly/wildfly-core | deployment-repository/src/main/java/org/jboss/as/repository/PathUtil.java | PathUtil.copyRecursively | public static void copyRecursively(final Path source, final Path target, boolean overwrite) throws IOException {
"""
Copy a path recursively.
@param source a Path pointing to a file or a directory that must exist
@param target a Path pointing to a directory where the contents will be copied.
@param overwrite ov... | java | public static void copyRecursively(final Path source, final Path target, boolean overwrite) throws IOException {
final CopyOption[] options;
if (overwrite) {
options = new CopyOption[]{StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING};
} else {
opti... | [
"public",
"static",
"void",
"copyRecursively",
"(",
"final",
"Path",
"source",
",",
"final",
"Path",
"target",
",",
"boolean",
"overwrite",
")",
"throws",
"IOException",
"{",
"final",
"CopyOption",
"[",
"]",
"options",
";",
"if",
"(",
"overwrite",
")",
"{",
... | Copy a path recursively.
@param source a Path pointing to a file or a directory that must exist
@param target a Path pointing to a directory where the contents will be copied.
@param overwrite overwrite existing files - if set to false fails if the target file already exists.
@throws IOException | [
"Copy",
"a",
"path",
"recursively",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/deployment-repository/src/main/java/org/jboss/as/repository/PathUtil.java#L53-L84 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.groups_get | public T groups_get(Integer userId, Collection<Long> groupIds)
throws FacebookException, IOException {
"""
Retrieves the groups associated with a user
@param userId Optional: User associated with groups.
A null parameter will default to the session user.
@param groupIds Optional: group ids to query.
A null... | java | public T groups_get(Integer userId, Collection<Long> groupIds)
throws FacebookException, IOException {
boolean hasGroups = (null != groupIds && !groupIds.isEmpty());
if (null != userId)
return hasGroups ?
this.callMethod(FacebookMethod.GROUPS_GET, new Pair<String, CharSequence>("uid", use... | [
"public",
"T",
"groups_get",
"(",
"Integer",
"userId",
",",
"Collection",
"<",
"Long",
">",
"groupIds",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"boolean",
"hasGroups",
"=",
"(",
"null",
"!=",
"groupIds",
"&&",
"!",
"groupIds",
".",
"isEm... | Retrieves the groups associated with a user
@param userId Optional: User associated with groups.
A null parameter will default to the session user.
@param groupIds Optional: group ids to query.
A null parameter will get all groups for the user.
@return array of groups | [
"Retrieves",
"the",
"groups",
"associated",
"with",
"a",
"user"
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L823-L835 |
SG-O/miIO | src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java | Vacuum.addTimer | public boolean addTimer(VacuumTimer timer) throws CommandExecutionException {
"""
Add a new scheduled cleanup.
@param timer The new timer to set.
@return True if the command was received successfully.
@throws CommandExecutionException When there has been a error during the communication or the response was inva... | java | public boolean addTimer(VacuumTimer timer) throws CommandExecutionException {
if (timer == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS);
JSONArray tm = timer.construct();
if (tm == null) return false;
JSONArray payload = new JSONArray();
... | [
"public",
"boolean",
"addTimer",
"(",
"VacuumTimer",
"timer",
")",
"throws",
"CommandExecutionException",
"{",
"if",
"(",
"timer",
"==",
"null",
")",
"throw",
"new",
"CommandExecutionException",
"(",
"CommandExecutionException",
".",
"Error",
".",
"INVALID_PARAMETERS"... | Add a new scheduled cleanup.
@param timer The new timer to set.
@return True if the command was received successfully.
@throws CommandExecutionException When there has been a error during the communication or the response was invalid. | [
"Add",
"a",
"new",
"scheduled",
"cleanup",
"."
] | train | https://github.com/SG-O/miIO/blob/f352dbd2a699d2cdb1b412ca5e6cbb0c38ca779b/src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java#L206-L213 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getImagePerformancesWithServiceResponseAsync | public Observable<ServiceResponse<List<ImagePerformance>>> getImagePerformancesWithServiceResponseAsync(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter) {
"""
Get image with its prediction for a given project iteration.
This API supports batching and r... | java | public Observable<ServiceResponse<List<ImagePerformance>>> getImagePerformancesWithServiceResponseAsync(UUID projectId, UUID iterationId, GetImagePerformancesOptionalParameter getImagePerformancesOptionalParameter) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"ImagePerformance",
">",
">",
">",
"getImagePerformancesWithServiceResponseAsync",
"(",
"UUID",
"projectId",
",",
"UUID",
"iterationId",
",",
"GetImagePerformancesOptionalParameter",
"getImagePerformancesOption... | Get image with its prediction for a given project iteration.
This API supports batching and range selection. By default it will only return first 50 images matching images.
Use the {take} and {skip} parameters to control how many images to return in a given batch.
The filtering is on an and/or relationship. For example... | [
"Get",
"image",
"with",
"its",
"prediction",
"for",
"a",
"given",
"project",
"iteration",
".",
"This",
"API",
"supports",
"batching",
"and",
"range",
"selection",
".",
"By",
"default",
"it",
"will",
"only",
"return",
"first",
"50",
"images",
"matching",
"ima... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L1460-L1476 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/IntStream.java | IntStream.mapToDouble | @NotNull
public DoubleStream mapToDouble(@NotNull final IntToDoubleFunction mapper) {
"""
Returns a {@code DoubleStream} consisting of the results of applying the given
function to the elements of this stream.
<p> This is an intermediate operation.
@param mapper the mapper function used to apply to eac... | java | @NotNull
public DoubleStream mapToDouble(@NotNull final IntToDoubleFunction mapper) {
return new DoubleStream(params, new IntMapToDouble(iterator, mapper));
} | [
"@",
"NotNull",
"public",
"DoubleStream",
"mapToDouble",
"(",
"@",
"NotNull",
"final",
"IntToDoubleFunction",
"mapper",
")",
"{",
"return",
"new",
"DoubleStream",
"(",
"params",
",",
"new",
"IntMapToDouble",
"(",
"iterator",
",",
"mapper",
")",
")",
";",
"}"
] | Returns a {@code DoubleStream} consisting of the results of applying the given
function to the elements of this stream.
<p> This is an intermediate operation.
@param mapper the mapper function used to apply to each element
@return the new {@code DoubleStream}
@since 1.1.4
@see #flatMap(com.annimon.stream.function.In... | [
"Returns",
"a",
"{",
"@code",
"DoubleStream",
"}",
"consisting",
"of",
"the",
"results",
"of",
"applying",
"the",
"given",
"function",
"to",
"the",
"elements",
"of",
"this",
"stream",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L558-L561 |
Azure/azure-sdk-for-java | dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/RecordSetsInner.java | RecordSetsInner.listByTypeAsync | public Observable<Page<RecordSetInner>> listByTypeAsync(final String resourceGroupName, final String zoneName, final RecordType recordType, final Integer top, final String recordsetnamesuffix) {
"""
Lists the record sets of a specified type in a DNS zone.
@param resourceGroupName The name of the resource group.... | java | public Observable<Page<RecordSetInner>> listByTypeAsync(final String resourceGroupName, final String zoneName, final RecordType recordType, final Integer top, final String recordsetnamesuffix) {
return listByTypeWithServiceResponseAsync(resourceGroupName, zoneName, recordType, top, recordsetnamesuffix)
... | [
"public",
"Observable",
"<",
"Page",
"<",
"RecordSetInner",
">",
">",
"listByTypeAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"zoneName",
",",
"final",
"RecordType",
"recordType",
",",
"final",
"Integer",
"top",
",",
"final",
"Str... | Lists the record sets of a specified type in a DNS zone.
@param resourceGroupName The name of the resource group.
@param zoneName The name of the DNS zone (without a terminating dot).
@param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV',... | [
"Lists",
"the",
"record",
"sets",
"of",
"a",
"specified",
"type",
"in",
"a",
"DNS",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/RecordSetsInner.java#L1015-L1023 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystems.java | JimfsFileSystems.createDefaultView | private static FileSystemView createDefaultView(
Configuration config, JimfsFileStore fileStore, PathService pathService) throws IOException {
"""
Creates the default view of the file system using the given working directory.
"""
JimfsPath workingDirPath = pathService.parsePath(config.workingDirector... | java | private static FileSystemView createDefaultView(
Configuration config, JimfsFileStore fileStore, PathService pathService) throws IOException {
JimfsPath workingDirPath = pathService.parsePath(config.workingDirectory);
Directory dir = fileStore.getRoot(workingDirPath.root());
if (dir == null) {
... | [
"private",
"static",
"FileSystemView",
"createDefaultView",
"(",
"Configuration",
"config",
",",
"JimfsFileStore",
"fileStore",
",",
"PathService",
"pathService",
")",
"throws",
"IOException",
"{",
"JimfsPath",
"workingDirPath",
"=",
"pathService",
".",
"parsePath",
"("... | Creates the default view of the file system using the given working directory. | [
"Creates",
"the",
"default",
"view",
"of",
"the",
"file",
"system",
"using",
"the",
"given",
"working",
"directory",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystems.java#L114-L132 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/tasks/AbstractInvokable.java | AbstractInvokable.triggerCheckpoint | public boolean triggerCheckpoint(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, boolean advanceToEndOfEventTime) throws Exception {
"""
This method is called to trigger a checkpoint, asynchronously by the checkpoint
coordinator.
<p>This method is called for tasks that start the che... | java | public boolean triggerCheckpoint(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, boolean advanceToEndOfEventTime) throws Exception {
throw new UnsupportedOperationException(String.format("triggerCheckpoint not supported by %s", this.getClass().getName()));
} | [
"public",
"boolean",
"triggerCheckpoint",
"(",
"CheckpointMetaData",
"checkpointMetaData",
",",
"CheckpointOptions",
"checkpointOptions",
",",
"boolean",
"advanceToEndOfEventTime",
")",
"throws",
"Exception",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"String"... | This method is called to trigger a checkpoint, asynchronously by the checkpoint
coordinator.
<p>This method is called for tasks that start the checkpoints by injecting the initial barriers,
i.e., the source tasks. In contrast, checkpoints on downstream operators, which are the result of
receiving checkpoint barriers, ... | [
"This",
"method",
"is",
"called",
"to",
"trigger",
"a",
"checkpoint",
"asynchronously",
"by",
"the",
"checkpoint",
"coordinator",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/tasks/AbstractInvokable.java#L211-L213 |
seam/faces | impl/src/main/java/org/jboss/seam/faces/security/SecurityPhaseListener.java | SecurityPhaseListener.isAnnotationApplicableToPhase | public boolean isAnnotationApplicableToPhase(Annotation annotation, PhaseIdType currentPhase, PhaseIdType[] defaultPhases) {
"""
Inspect an annotation to see if it specifies a view in which it should be. Fall back on default view otherwise.
@param annotation
@param currentPhase
@param defaultPhases
@return ... | java | public boolean isAnnotationApplicableToPhase(Annotation annotation, PhaseIdType currentPhase, PhaseIdType[] defaultPhases) {
Method restrictAtViewMethod = getRestrictAtViewMethod(annotation);
PhaseIdType[] phasedIds = null;
if (restrictAtViewMethod != null) {
log.warnf("Annotation %s... | [
"public",
"boolean",
"isAnnotationApplicableToPhase",
"(",
"Annotation",
"annotation",
",",
"PhaseIdType",
"currentPhase",
",",
"PhaseIdType",
"[",
"]",
"defaultPhases",
")",
"{",
"Method",
"restrictAtViewMethod",
"=",
"getRestrictAtViewMethod",
"(",
"annotation",
")",
... | Inspect an annotation to see if it specifies a view in which it should be. Fall back on default view otherwise.
@param annotation
@param currentPhase
@param defaultPhases
@return true if the annotation is applicable to this view and phase, false otherwise | [
"Inspect",
"an",
"annotation",
"to",
"see",
"if",
"it",
"specifies",
"a",
"view",
"in",
"which",
"it",
"should",
"be",
".",
"Fall",
"back",
"on",
"default",
"view",
"otherwise",
"."
] | train | https://github.com/seam/faces/blob/2fdedbc7070318c2c58bfffb8a26f1ea1d0ee1e3/impl/src/main/java/org/jboss/seam/faces/security/SecurityPhaseListener.java#L190-L210 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/SimpleRandomSampling.java | SimpleRandomSampling.randomSampling | public static FlatDataCollection randomSampling(FlatDataList idList, int n, boolean withReplacement) {
"""
Samples n ids by using SimpleRandomSampling (Simple Random Sampling).
@param idList
@param n
@param withReplacement
@return
"""
FlatDataList sampledIds = new FlatDataList();
... | java | public static FlatDataCollection randomSampling(FlatDataList idList, int n, boolean withReplacement) {
FlatDataList sampledIds = new FlatDataList();
int populationN = idList.size();
for(int i=0;i<n;) {
if(withReplacement==false && populationN<=n) {
/... | [
"public",
"static",
"FlatDataCollection",
"randomSampling",
"(",
"FlatDataList",
"idList",
",",
"int",
"n",
",",
"boolean",
"withReplacement",
")",
"{",
"FlatDataList",
"sampledIds",
"=",
"new",
"FlatDataList",
"(",
")",
";",
"int",
"populationN",
"=",
"idList",
... | Samples n ids by using SimpleRandomSampling (Simple Random Sampling).
@param idList
@param n
@param withReplacement
@return | [
"Samples",
"n",
"ids",
"by",
"using",
"SimpleRandomSampling",
"(",
"Simple",
"Random",
"Sampling",
")",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/SimpleRandomSampling.java#L84-L110 |
dadoonet/fscrawler | elasticsearch-client/elasticsearch-client-v5/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/v5/ElasticsearchClientV5.java | ElasticsearchClientV5.createIndex | public void createIndex(String index, boolean ignoreErrors, String indexSettings) throws IOException {
"""
Create an index
@param index index name
@param ignoreErrors don't fail if the index already exists
@param indexSettings index settings if any
@throws IOException In case of error
"""
logger.de... | java | public void createIndex(String index, boolean ignoreErrors, String indexSettings) throws IOException {
logger.debug("create index [{}]", index);
logger.trace("index settings: [{}]", indexSettings);
try {
Response response = lowLevelClient.performRequest("PUT", "/" + index,
... | [
"public",
"void",
"createIndex",
"(",
"String",
"index",
",",
"boolean",
"ignoreErrors",
",",
"String",
"indexSettings",
")",
"throws",
"IOException",
"{",
"logger",
".",
"debug",
"(",
"\"create index [{}]\"",
",",
"index",
")",
";",
"logger",
".",
"trace",
"(... | Create an index
@param index index name
@param ignoreErrors don't fail if the index already exists
@param indexSettings index settings if any
@throws IOException In case of error | [
"Create",
"an",
"index"
] | train | https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/elasticsearch-client/elasticsearch-client-v5/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/v5/ElasticsearchClientV5.java#L213-L233 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java | FaceletCompositionContextImpl.markComponentForDeletion | private void markComponentForDeletion(String id , UIComponent component) {
"""
Mark a component to be deleted from the tree. The component to be deleted is addded on the
current level. This is done from ComponentSupport.markForDeletion
@param id
@param component the component marked for deletion.
"""
... | java | private void markComponentForDeletion(String id , UIComponent component)
{
_componentsMarkedForDeletion.get(_deletionLevel).put(id, component);
} | [
"private",
"void",
"markComponentForDeletion",
"(",
"String",
"id",
",",
"UIComponent",
"component",
")",
"{",
"_componentsMarkedForDeletion",
".",
"get",
"(",
"_deletionLevel",
")",
".",
"put",
"(",
"id",
",",
"component",
")",
";",
"}"
] | Mark a component to be deleted from the tree. The component to be deleted is addded on the
current level. This is done from ComponentSupport.markForDeletion
@param id
@param component the component marked for deletion. | [
"Mark",
"a",
"component",
"to",
"be",
"deleted",
"from",
"the",
"tree",
".",
"The",
"component",
"to",
"be",
"deleted",
"is",
"addded",
"on",
"the",
"current",
"level",
".",
"This",
"is",
"done",
"from",
"ComponentSupport",
".",
"markForDeletion"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java#L800-L803 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/CommandUtil.java | CommandUtil.associateCommand | public static void associateCommand(String commandName, BaseUIComponent component, IAction action) {
"""
Associates a UI component with a command and action.
@param commandName Name of the command.
@param component Component to be associated.
@param action Action to be executed when the command is invoked.
... | java | public static void associateCommand(String commandName, BaseUIComponent component, IAction action) {
getCommand(commandName, true).bind(component, action);
} | [
"public",
"static",
"void",
"associateCommand",
"(",
"String",
"commandName",
",",
"BaseUIComponent",
"component",
",",
"IAction",
"action",
")",
"{",
"getCommand",
"(",
"commandName",
",",
"true",
")",
".",
"bind",
"(",
"component",
",",
"action",
")",
";",
... | Associates a UI component with a command and action.
@param commandName Name of the command.
@param component Component to be associated.
@param action Action to be executed when the command is invoked. | [
"Associates",
"a",
"UI",
"component",
"with",
"a",
"command",
"and",
"action",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/CommandUtil.java#L199-L201 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/PackedSpriteSheet.java | PackedSpriteSheet.getSpriteSheet | public SpriteSheet getSpriteSheet(String name) {
"""
Get a sprite sheet that has been packed into the greater image
@param name The name of the sprite sheet to retrieve
@return The sprite sheet from the packed sheet
"""
Image image = getSprite(name);
Section section = (Section) sections.get(name);
... | java | public SpriteSheet getSpriteSheet(String name) {
Image image = getSprite(name);
Section section = (Section) sections.get(name);
return new SpriteSheet(image, section.width / section.tilesx, section.height / section.tilesy);
} | [
"public",
"SpriteSheet",
"getSpriteSheet",
"(",
"String",
"name",
")",
"{",
"Image",
"image",
"=",
"getSprite",
"(",
"name",
")",
";",
"Section",
"section",
"=",
"(",
"Section",
")",
"sections",
".",
"get",
"(",
"name",
")",
";",
"return",
"new",
"Sprite... | Get a sprite sheet that has been packed into the greater image
@param name The name of the sprite sheet to retrieve
@return The sprite sheet from the packed sheet | [
"Get",
"a",
"sprite",
"sheet",
"that",
"has",
"been",
"packed",
"into",
"the",
"greater",
"image"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/PackedSpriteSheet.java#L112-L117 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/resource/ClassPathResource.java | ClassPathResource.getReaderNoCache | @Nullable
public Reader getReaderNoCache (@Nonnull final ClassLoader aClassLoader, @Nonnull final Charset aCharset) {
"""
Create a {@link Reader} of this resource, using the specified class loader
only.
@param aClassLoader
The class loader to be used. May not be <code>null</code>.
@param aCharset
The char... | java | @Nullable
public Reader getReaderNoCache (@Nonnull final ClassLoader aClassLoader, @Nonnull final Charset aCharset)
{
return StreamHelper.createReader (getInputStreamNoCache (aClassLoader), aCharset);
} | [
"@",
"Nullable",
"public",
"Reader",
"getReaderNoCache",
"(",
"@",
"Nonnull",
"final",
"ClassLoader",
"aClassLoader",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"return",
"StreamHelper",
".",
"createReader",
"(",
"getInputStreamNoCache",
"(",
"... | Create a {@link Reader} of this resource, using the specified class loader
only.
@param aClassLoader
The class loader to be used. May not be <code>null</code>.
@param aCharset
The charset to be used for the {@link Reader}. May not be
<code>null</code>.
@return <code>null</code> if the path could not be resolved. | [
"Create",
"a",
"{",
"@link",
"Reader",
"}",
"of",
"this",
"resource",
"using",
"the",
"specified",
"class",
"loader",
"only",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/resource/ClassPathResource.java#L308-L312 |
scaleset/scaleset-geo | src/main/java/com/scaleset/geo/math/GoogleMapsTileMath.java | GoogleMapsTileMath.lngLatToMeters | public Coordinate lngLatToMeters(Coordinate coord) {
"""
Converts given coordinate in WGS84 Datum to XY in Spherical Mercator
EPSG:3857
@param coord The coordinate to convert
@return The coordinate transformed to EPSG:3857
"""
double mx = coord.x * originShift / 180.0;
double my = Math.log... | java | public Coordinate lngLatToMeters(Coordinate coord) {
double mx = coord.x * originShift / 180.0;
double my = Math.log(Math.tan((90 + coord.y) * Math.PI / 360.0)) / (Math.PI / 180.0);
my *= originShift / 180.0;
return new Coordinate(mx, my);
} | [
"public",
"Coordinate",
"lngLatToMeters",
"(",
"Coordinate",
"coord",
")",
"{",
"double",
"mx",
"=",
"coord",
".",
"x",
"*",
"originShift",
"/",
"180.0",
";",
"double",
"my",
"=",
"Math",
".",
"log",
"(",
"Math",
".",
"tan",
"(",
"(",
"90",
"+",
"coo... | Converts given coordinate in WGS84 Datum to XY in Spherical Mercator
EPSG:3857
@param coord The coordinate to convert
@return The coordinate transformed to EPSG:3857 | [
"Converts",
"given",
"coordinate",
"in",
"WGS84",
"Datum",
"to",
"XY",
"in",
"Spherical",
"Mercator",
"EPSG",
":",
"3857"
] | train | https://github.com/scaleset/scaleset-geo/blob/5cff2349668037dc287928a6c1a1f67c76d96b02/src/main/java/com/scaleset/geo/math/GoogleMapsTileMath.java#L64-L69 |
thinkaurelius/titan | titan-cassandra/src/main/java/com/thinkaurelius/titan/diskstorage/cassandra/thrift/CassandraThriftKeyColumnValueStore.java | CassandraThriftKeyColumnValueStore.getSlice | @Override
public EntryList getSlice(KeySliceQuery query, StoreTransaction txh) throws BackendException {
"""
Call Cassandra's Thrift get_slice() method.
<p/>
When columnEnd equals columnStart and either startInclusive
or endInclusive is false (or both are false), then this
method returns an empty list with... | java | @Override
public EntryList getSlice(KeySliceQuery query, StoreTransaction txh) throws BackendException {
Map<StaticBuffer, EntryList> result = getNamesSlice(query.getKey(), query, txh);
return Iterables.getOnlyElement(result.values(), EntryList.EMPTY_LIST);
} | [
"@",
"Override",
"public",
"EntryList",
"getSlice",
"(",
"KeySliceQuery",
"query",
",",
"StoreTransaction",
"txh",
")",
"throws",
"BackendException",
"{",
"Map",
"<",
"StaticBuffer",
",",
"EntryList",
">",
"result",
"=",
"getNamesSlice",
"(",
"query",
".",
"getK... | Call Cassandra's Thrift get_slice() method.
<p/>
When columnEnd equals columnStart and either startInclusive
or endInclusive is false (or both are false), then this
method returns an empty list without making any Thrift calls.
<p/>
If columnEnd = columnStart + 1, and both startInclusive and
startExclusive are false, th... | [
"Call",
"Cassandra",
"s",
"Thrift",
"get_slice",
"()",
"method",
".",
"<p",
"/",
">",
"When",
"columnEnd",
"equals",
"columnStart",
"and",
"either",
"startInclusive",
"or",
"endInclusive",
"is",
"false",
"(",
"or",
"both",
"are",
"false",
")",
"then",
"this"... | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-cassandra/src/main/java/com/thinkaurelius/titan/diskstorage/cassandra/thrift/CassandraThriftKeyColumnValueStore.java#L78-L82 |
m-m-m/util | cli/src/main/java/net/sf/mmm/util/cli/base/CliState.java | CliState.findPropertyAnnotations | protected boolean findPropertyAnnotations(PojoDescriptorBuilder descriptorBuilder) {
"""
This method finds the properties annotated with {@link CliOption} or {@link CliArgument}.
@param descriptorBuilder is the {@link PojoDescriptorBuilder} to use (determines if fields or setters are used).
@return {@code true... | java | protected boolean findPropertyAnnotations(PojoDescriptorBuilder descriptorBuilder) {
boolean annotationFound = false;
PojoDescriptor<?> descriptor = descriptorBuilder.getDescriptor(getStateClass());
for (PojoPropertyDescriptor propertyDescriptor : descriptor.getPropertyDescriptors()) {
PojoPropertyAc... | [
"protected",
"boolean",
"findPropertyAnnotations",
"(",
"PojoDescriptorBuilder",
"descriptorBuilder",
")",
"{",
"boolean",
"annotationFound",
"=",
"false",
";",
"PojoDescriptor",
"<",
"?",
">",
"descriptor",
"=",
"descriptorBuilder",
".",
"getDescriptor",
"(",
"getState... | This method finds the properties annotated with {@link CliOption} or {@link CliArgument}.
@param descriptorBuilder is the {@link PojoDescriptorBuilder} to use (determines if fields or setters are used).
@return {@code true} if at least one annotated property has been found, {@code false} otherwise. | [
"This",
"method",
"finds",
"the",
"properties",
"annotated",
"with",
"{",
"@link",
"CliOption",
"}",
"or",
"{",
"@link",
"CliArgument",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/cli/src/main/java/net/sf/mmm/util/cli/base/CliState.java#L267-L296 |
windup/windup | config/api/src/main/java/org/jboss/windup/config/Variables.java | Variables.setSingletonVariable | public void setSingletonVariable(String name, WindupVertexFrame frame) {
"""
Type-safe wrapper around setVariable which sets only one framed vertex.
"""
setVariable(name, Collections.singletonList(frame));
} | java | public void setSingletonVariable(String name, WindupVertexFrame frame)
{
setVariable(name, Collections.singletonList(frame));
} | [
"public",
"void",
"setSingletonVariable",
"(",
"String",
"name",
",",
"WindupVertexFrame",
"frame",
")",
"{",
"setVariable",
"(",
"name",
",",
"Collections",
".",
"singletonList",
"(",
"frame",
")",
")",
";",
"}"
] | Type-safe wrapper around setVariable which sets only one framed vertex. | [
"Type",
"-",
"safe",
"wrapper",
"around",
"setVariable",
"which",
"sets",
"only",
"one",
"framed",
"vertex",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/Variables.java#L90-L93 |
janus-project/guava.janusproject.io | guava/src/com/google/common/base/Objects.java | Objects.firstNonNull | @Deprecated
public static <T> T firstNonNull(@Nullable T first, @Nullable T second) {
"""
Returns the first of two given parameters that is not {@code null}, if
either is, or otherwise throws a {@link NullPointerException}.
<p><b>Note:</b> if {@code first} is represented as an {@link Optional},
this can be ... | java | @Deprecated
public static <T> T firstNonNull(@Nullable T first, @Nullable T second) {
return MoreObjects.firstNonNull(first, second);
} | [
"@",
"Deprecated",
"public",
"static",
"<",
"T",
">",
"T",
"firstNonNull",
"(",
"@",
"Nullable",
"T",
"first",
",",
"@",
"Nullable",
"T",
"second",
")",
"{",
"return",
"MoreObjects",
".",
"firstNonNull",
"(",
"first",
",",
"second",
")",
";",
"}"
] | Returns the first of two given parameters that is not {@code null}, if
either is, or otherwise throws a {@link NullPointerException}.
<p><b>Note:</b> if {@code first} is represented as an {@link Optional},
this can be accomplished with
{@linkplain Optional#or(Object) first.or(second)}.
That approach also allows for la... | [
"Returns",
"the",
"first",
"of",
"two",
"given",
"parameters",
"that",
"is",
"not",
"{",
"@code",
"null",
"}",
"if",
"either",
"is",
"or",
"otherwise",
"throws",
"a",
"{",
"@link",
"NullPointerException",
"}",
"."
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/base/Objects.java#L184-L187 |
glyptodon/guacamole-client | guacamole/src/main/java/org/apache/guacamole/extension/Extension.java | Extension.getClassPathResources | private Map<String, Resource> getClassPathResources(Map<String, String> resourceTypes) {
"""
Returns a new map of all resources corresponding to the map of resource
paths provided. Each resource will be associated with the mimetype
stored in the given map using its path as the key.
@param resourceTypes
A map... | java | private Map<String, Resource> getClassPathResources(Map<String, String> resourceTypes) {
// If no paths are provided, just return an empty map
if (resourceTypes == null)
return Collections.<String, Resource>emptyMap();
// Add classpath resource for each path/mimetype pair provided... | [
"private",
"Map",
"<",
"String",
",",
"Resource",
">",
"getClassPathResources",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"resourceTypes",
")",
"{",
"// If no paths are provided, just return an empty map ",
"if",
"(",
"resourceTypes",
"==",
"null",
")",
"return... | Returns a new map of all resources corresponding to the map of resource
paths provided. Each resource will be associated with the mimetype
stored in the given map using its path as the key.
@param resourceTypes
A map of all paths to their corresponding mimetypes.
@return
A new, unmodifiable map of resources correspon... | [
"Returns",
"a",
"new",
"map",
"of",
"all",
"resources",
"corresponding",
"to",
"the",
"map",
"of",
"resource",
"paths",
"provided",
".",
"Each",
"resource",
"will",
"be",
"associated",
"with",
"the",
"mimetype",
"stored",
"in",
"the",
"given",
"map",
"using"... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/extension/Extension.java#L169-L191 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.getProjectJob | public GitlabJob getProjectJob(Integer projectId, Integer jobId) throws IOException {
"""
Gets a build for a project
@param projectId the project id
@param jobId the build id
@return A list of project jobs
@throws IOException on gitlab api call error
"""
String tailUrl = GitlabProject.URL + "... | java | public GitlabJob getProjectJob(Integer projectId, Integer jobId) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabJob.URL + "/" + jobId;
return retrieve().to(tailUrl, GitlabJob.class);
} | [
"public",
"GitlabJob",
"getProjectJob",
"(",
"Integer",
"projectId",
",",
"Integer",
"jobId",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"GitlabProject",
".",
"URL",
"+",
"\"/\"",
"+",
"sanitizeProjectId",
"(",
"projectId",
")",
"+",
"GitlabJob... | Gets a build for a project
@param projectId the project id
@param jobId the build id
@return A list of project jobs
@throws IOException on gitlab api call error | [
"Gets",
"a",
"build",
"for",
"a",
"project"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L1087-L1090 |
Azure/azure-sdk-for-java | mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java | SpatialAnchorsAccountsInner.getKeysAsync | public Observable<SpatialAnchorsAccountKeysInner> getKeysAsync(String resourceGroupName, String spatialAnchorsAccountName) {
"""
Get Both of the 2 Keys of a Spatial Anchors Account.
@param resourceGroupName Name of an Azure resource group.
@param spatialAnchorsAccountName Name of an Mixed Reality Spatial Ancho... | java | public Observable<SpatialAnchorsAccountKeysInner> getKeysAsync(String resourceGroupName, String spatialAnchorsAccountName) {
return getKeysWithServiceResponseAsync(resourceGroupName, spatialAnchorsAccountName).map(new Func1<ServiceResponse<SpatialAnchorsAccountKeysInner>, SpatialAnchorsAccountKeysInner>() {
... | [
"public",
"Observable",
"<",
"SpatialAnchorsAccountKeysInner",
">",
"getKeysAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"spatialAnchorsAccountName",
")",
"{",
"return",
"getKeysWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"spatialAnchorsAccountName",... | Get Both of the 2 Keys of a Spatial Anchors Account.
@param resourceGroupName Name of an Azure resource group.
@param spatialAnchorsAccountName Name of an Mixed Reality Spatial Anchors Account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the SpatialAnchorsAccount... | [
"Get",
"Both",
"of",
"the",
"2",
"Keys",
"of",
"a",
"Spatial",
"Anchors",
"Account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java#L730-L737 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.