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 |
|---|---|---|---|---|---|---|---|---|---|---|
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/commands/CommandInvoker.java | CommandInvoker.invoke | public ReturnValue invoke(final String commandName, final String[] argsAry) {
"""
This method executes built in commands or builds a CommandDefinition to.
execute external commands (plugins). The methods also expands the $ARG?$
macros.
@param commandName
The name of the command, as configured in the server
... | java | public ReturnValue invoke(final String commandName, final String[] argsAry) {
if ("_NRPE_CHECK".equals(commandName)) {
return new ReturnValue(Status.OK, JNRPELIB.VERSION);
}
CommandDefinition cd = commandRepository.getCommand(commandName);
if (cd == null) {
retu... | [
"public",
"ReturnValue",
"invoke",
"(",
"final",
"String",
"commandName",
",",
"final",
"String",
"[",
"]",
"argsAry",
")",
"{",
"if",
"(",
"\"_NRPE_CHECK\"",
".",
"equals",
"(",
"commandName",
")",
")",
"{",
"return",
"new",
"ReturnValue",
"(",
"Status",
... | This method executes built in commands or builds a CommandDefinition to.
execute external commands (plugins). The methods also expands the $ARG?$
macros.
@param commandName
The name of the command, as configured in the server
configuration XML
@param argsAry
The arguments to pass to the command as configured in the
se... | [
"This",
"method",
"executes",
"built",
"in",
"commands",
"or",
"builds",
"a",
"CommandDefinition",
"to",
".",
"execute",
"external",
"commands",
"(",
"plugins",
")",
".",
"The",
"methods",
"also",
"expands",
"the",
"$ARG?$",
"macros",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/commands/CommandInvoker.java#L98-L110 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.isEqual | public static boolean isEqual(Object value1, Object value2) {
"""
Returns <code>true</code> if the provided Objects are either both <code>null</code>
or equal according to {@link Object#equals(Object)}.<p>
@param value1 the first object to compare
@param value2 the second object to compare
@return <code>tr... | java | public static boolean isEqual(Object value1, Object value2) {
if (value1 == null) {
return (value2 == null);
}
return value1.equals(value2);
} | [
"public",
"static",
"boolean",
"isEqual",
"(",
"Object",
"value1",
",",
"Object",
"value2",
")",
"{",
"if",
"(",
"value1",
"==",
"null",
")",
"{",
"return",
"(",
"value2",
"==",
"null",
")",
";",
"}",
"return",
"value1",
".",
"equals",
"(",
"value2",
... | Returns <code>true</code> if the provided Objects are either both <code>null</code>
or equal according to {@link Object#equals(Object)}.<p>
@param value1 the first object to compare
@param value2 the second object to compare
@return <code>true</code> if the provided Objects are either both <code>null</code>
or equal ... | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"provided",
"Objects",
"are",
"either",
"both",
"<code",
">",
"null<",
"/",
"code",
">",
"or",
"equal",
"according",
"to",
"{",
"@link",
"Object#equals",
"(",
"Object",
")",
"}",
".",
"<p... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L1049-L1055 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.createOrUpdate | public VirtualNetworkGatewayInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) {
"""
Creates or updates a virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkG... | java | public VirtualNetworkGatewayInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body();
} | [
"public",
"VirtualNetworkGatewayInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"VirtualNetworkGatewayInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Creates or updates a virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param parameters Parameters supplied to create or update virtual network gateway operation.
@throws IllegalAr... | [
"Creates",
"or",
"updates",
"a",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L209-L211 |
mgm-tp/jfunk | jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java | MailService.findMessages | public List<MailMessage> findMessages(final MailAccount mailAccount, final Predicate<MailMessage> condition) {
"""
<p>
Tries to find messages for the specified mail account applying the specified
{@code condition} until it times out using the default timeout (
{@link EmailConstants#MAIL_TIMEOUT_SECONDS} and {@l... | java | public List<MailMessage> findMessages(final MailAccount mailAccount, final Predicate<MailMessage> condition) {
return findMessages(mailAccount, condition, defaultTimeoutSeconds);
} | [
"public",
"List",
"<",
"MailMessage",
">",
"findMessages",
"(",
"final",
"MailAccount",
"mailAccount",
",",
"final",
"Predicate",
"<",
"MailMessage",
">",
"condition",
")",
"{",
"return",
"findMessages",
"(",
"mailAccount",
",",
"condition",
",",
"defaultTimeoutSe... | <p>
Tries to find messages for the specified mail account applying the specified
{@code condition} until it times out using the default timeout (
{@link EmailConstants#MAIL_TIMEOUT_SECONDS} and {@link EmailConstants#MAIL_SLEEP_MILLIS}).
</p>
<b>Note:</b><br />
This method uses the specified mail account independently w... | [
"<p",
">",
"Tries",
"to",
"find",
"messages",
"for",
"the",
"specified",
"mail",
"account",
"applying",
"the",
"specified",
"{",
"@code",
"condition",
"}",
"until",
"it",
"times",
"out",
"using",
"the",
"default",
"timeout",
"(",
"{",
"@link",
"EmailConstant... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java#L261-L263 |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java | TypeUtil.createParameterizedType | public static ParameterizedType createParameterizedType(Class<?> rawClass, Type... genericTypes) {
"""
Create a parameterized type from a raw class and its type arguments.
@param rawClass the raw class to construct the parameterized type
@param genericTypes the generic arguments
@return the parameterized type... | java | public static ParameterizedType createParameterizedType(Class<?> rawClass, Type... genericTypes) {
return new ParameterizedType() {
@Override
public Type[] getActualTypeArguments() {
return genericTypes;
}
@Override
public Type getRawT... | [
"public",
"static",
"ParameterizedType",
"createParameterizedType",
"(",
"Class",
"<",
"?",
">",
"rawClass",
",",
"Type",
"...",
"genericTypes",
")",
"{",
"return",
"new",
"ParameterizedType",
"(",
")",
"{",
"@",
"Override",
"public",
"Type",
"[",
"]",
"getAct... | Create a parameterized type from a raw class and its type arguments.
@param rawClass the raw class to construct the parameterized type
@param genericTypes the generic arguments
@return the parameterized type | [
"Create",
"a",
"parameterized",
"type",
"from",
"a",
"raw",
"class",
"and",
"its",
"type",
"arguments",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/TypeUtil.java#L154-L171 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_quotaHistory_GET | public ArrayList<Long> serviceName_quotaHistory_GET(String serviceName, Date historizedDate_from, Date historizedDate_to, String zone) throws IOException {
"""
Quota history informations, per month
REST: GET /ipLoadbalancing/{serviceName}/quotaHistory
@param zone [required] Filter the value of zone property (=... | java | public ArrayList<Long> serviceName_quotaHistory_GET(String serviceName, Date historizedDate_from, Date historizedDate_to, String zone) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/quotaHistory";
StringBuilder sb = path(qPath, serviceName);
query(sb, "historizedDate.from", historizedDate_fro... | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_quotaHistory_GET",
"(",
"String",
"serviceName",
",",
"Date",
"historizedDate_from",
",",
"Date",
"historizedDate_to",
",",
"String",
"zone",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadb... | Quota history informations, per month
REST: GET /ipLoadbalancing/{serviceName}/quotaHistory
@param zone [required] Filter the value of zone property (=)
@param historizedDate_to [required] Filter the value of historizedDate property (<=)
@param historizedDate_from [required] Filter the value of historizedDate property... | [
"Quota",
"history",
"informations",
"per",
"month"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L567-L575 |
zaproxy/zaproxy | src/org/zaproxy/zap/spider/filters/HttpPrefixFetchFilter.java | HttpPrefixFetchFilter.normalisedPort | private static int normalisedPort(String scheme, int port) {
"""
Returns the normalised form of the given {@code port}, based on the given {@code scheme}.
<p>
If the port is non-default (as given by {@link #DEFAULT_PORT}), it's immediately returned. Otherwise, for schemes HTTP
and HTTPS it's returned 80 and 443... | java | private static int normalisedPort(String scheme, int port) {
if (port != DEFAULT_PORT) {
return port;
}
if (isHttp(scheme)) {
return DEFAULT_HTTP_PORT;
}
if (isHttps(scheme)) {
return DEFAULT_HTTPS_PORT;
}
return UNKNOWN_PORT... | [
"private",
"static",
"int",
"normalisedPort",
"(",
"String",
"scheme",
",",
"int",
"port",
")",
"{",
"if",
"(",
"port",
"!=",
"DEFAULT_PORT",
")",
"{",
"return",
"port",
";",
"}",
"if",
"(",
"isHttp",
"(",
"scheme",
")",
")",
"{",
"return",
"DEFAULT_HT... | Returns the normalised form of the given {@code port}, based on the given {@code scheme}.
<p>
If the port is non-default (as given by {@link #DEFAULT_PORT}), it's immediately returned. Otherwise, for schemes HTTP
and HTTPS it's returned 80 and 443, respectively, for any other scheme it's returned {@link #UNKNOWN_PORT}.... | [
"Returns",
"the",
"normalised",
"form",
"of",
"the",
"given",
"{",
"@code",
"port",
"}",
"based",
"on",
"the",
"given",
"{",
"@code",
"scheme",
"}",
".",
"<p",
">",
"If",
"the",
"port",
"is",
"non",
"-",
"default",
"(",
"as",
"given",
"by",
"{",
"@... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/filters/HttpPrefixFetchFilter.java#L187-L201 |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/server/TransportChannelHandler.java | TransportChannelHandler.userEventTriggered | @Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
"""
Triggered based on events from an {@link io.netty.handler.timeout.IdleStateHandler}.
"""
if (evt instanceof IdleStateEvent) {
IdleStateEvent e = (IdleStateEvent) evt;
// See class comment fo... | java | @Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if (evt instanceof IdleStateEvent) {
IdleStateEvent e = (IdleStateEvent) evt;
// See class comment for timeout semantics. In addition to ensuring we only timeout while
// there are outstanding requ... | [
"@",
"Override",
"public",
"void",
"userEventTriggered",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Object",
"evt",
")",
"throws",
"Exception",
"{",
"if",
"(",
"evt",
"instanceof",
"IdleStateEvent",
")",
"{",
"IdleStateEvent",
"e",
"=",
"(",
"IdleStateEvent",
")... | Triggered based on events from an {@link io.netty.handler.timeout.IdleStateHandler}. | [
"Triggered",
"based",
"on",
"events",
"from",
"an",
"{"
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/server/TransportChannelHandler.java#L146-L178 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/ConsumerMonitorRegistrar.java | ConsumerMonitorRegistrar.registerCallbackOnNewExpression | public boolean registerCallbackOnNewExpression(
ConnectionImpl connection,
String topicExpression,
boolean isWildcarded,
ConsumerSetChangeCallback callback,
ArrayList matchingConsumers) {
"""
Method registerCallbackOnNewExpression
Adds a list of matching consumers in a new entry to the appro... | java | public boolean registerCallbackOnNewExpression(
ConnectionImpl connection,
String topicExpression,
boolean isWildcarded,
ConsumerSetChangeCallback callback,
ArrayList matchingConsumers)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
... | [
"public",
"boolean",
"registerCallbackOnNewExpression",
"(",
"ConnectionImpl",
"connection",
",",
"String",
"topicExpression",
",",
"boolean",
"isWildcarded",
",",
"ConsumerSetChangeCallback",
"callback",
",",
"ArrayList",
"matchingConsumers",
")",
"{",
"if",
"(",
"TraceC... | Method registerCallbackOnNewExpression
Adds a list of matching consumers in a new entry to the appropriate wildcard
or exact expression table.
@param topicExpression
@param isWildcarded
@param callback
@param matchingConsumers
@return | [
"Method",
"registerCallbackOnNewExpression"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/ConsumerMonitorRegistrar.java#L128-L167 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/WaitForFieldChangeHandler.java | WaitForFieldChangeHandler.fieldChanged | public int fieldChanged(boolean bDisplayOption, int iMoveMode) {
"""
The Field has Changed.
Don't need to call inherited.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay).
"""
if (m_... | java | public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{
if (m_bWaiting)
{
synchronized (this)
{
m_bWaiting = false;
this.notify();
}
}
return super.fieldChanged(bDisplayOption, iMoveMode);
} | [
"public",
"int",
"fieldChanged",
"(",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"if",
"(",
"m_bWaiting",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"m_bWaiting",
"=",
"false",
";",
"this",
".",
"notify",
"(",
")",
";",
"}",
... | The Field has Changed.
Don't need to call inherited.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay). | [
"The",
"Field",
"has",
"Changed",
".",
"Don",
"t",
"need",
"to",
"call",
"inherited",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/WaitForFieldChangeHandler.java#L108-L119 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/ProcessStore.java | ProcessStore.setProcess | public static synchronized void setProcess(String applicationName, String scopedInstancePath, Process process) {
"""
Stores a process (eg. a running script), so that the
process can be reached later (eg. to cancel it when blocked).
@param process The process to be stored
"""
PROCESS_MAP.put(toAgentId(appli... | java | public static synchronized void setProcess(String applicationName, String scopedInstancePath, Process process) {
PROCESS_MAP.put(toAgentId(applicationName, scopedInstancePath), process);
} | [
"public",
"static",
"synchronized",
"void",
"setProcess",
"(",
"String",
"applicationName",
",",
"String",
"scopedInstancePath",
",",
"Process",
"process",
")",
"{",
"PROCESS_MAP",
".",
"put",
"(",
"toAgentId",
"(",
"applicationName",
",",
"scopedInstancePath",
")",... | Stores a process (eg. a running script), so that the
process can be reached later (eg. to cancel it when blocked).
@param process The process to be stored | [
"Stores",
"a",
"process",
"(",
"eg",
".",
"a",
"running",
"script",
")",
"so",
"that",
"the",
"process",
"can",
"be",
"reached",
"later",
"(",
"eg",
".",
"to",
"cancel",
"it",
"when",
"blocked",
")",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/ProcessStore.java#L45-L47 |
Waikato/moa | moa/src/main/java/moa/gui/experimentertab/Stream.java | Stream.readBuffer | public void readBuffer(List<String> algPath, List<String> algNames, List<Measure> measures) {
"""
Read each algorithm file.
@param algPath
@param algNames
@param measures
"""
BufferedReader buffer = null;
for (int i = 0; i < algPath.size(); i++) {
try {
buffer = n... | java | public void readBuffer(List<String> algPath, List<String> algNames, List<Measure> measures) {
BufferedReader buffer = null;
for (int i = 0; i < algPath.size(); i++) {
try {
buffer = new BufferedReader(new FileReader(algPath.get(i)));
} catch (FileNotFoundException... | [
"public",
"void",
"readBuffer",
"(",
"List",
"<",
"String",
">",
"algPath",
",",
"List",
"<",
"String",
">",
"algNames",
",",
"List",
"<",
"Measure",
">",
"measures",
")",
"{",
"BufferedReader",
"buffer",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
... | Read each algorithm file.
@param algPath
@param algNames
@param measures | [
"Read",
"each",
"algorithm",
"file",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/gui/experimentertab/Stream.java#L65-L77 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java | UriUtils.encodePath | public static String encodePath(String path, String encoding) throws UnsupportedEncodingException {
"""
Encodes the given URI path with the given encoding.
@param path the path to be encoded
@param encoding the character encoding to encode to
@return the encoded path
@throws UnsupportedEncodingException when t... | java | public static String encodePath(String path, String encoding) throws UnsupportedEncodingException {
return HierarchicalUriComponents.encodeUriComponent(path, encoding, HierarchicalUriComponents.Type.PATH);
} | [
"public",
"static",
"String",
"encodePath",
"(",
"String",
"path",
",",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"HierarchicalUriComponents",
".",
"encodeUriComponent",
"(",
"path",
",",
"encoding",
",",
"HierarchicalUriCompone... | Encodes the given URI path with the given encoding.
@param path the path to be encoded
@param encoding the character encoding to encode to
@return the encoded path
@throws UnsupportedEncodingException when the given encoding parameter is not supported | [
"Encodes",
"the",
"given",
"URI",
"path",
"with",
"the",
"given",
"encoding",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java#L274-L276 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.getReader | public static BufferedReader getReader(Path path, Charset charset) throws IORuntimeException {
"""
获得一个文件读取器
@param path 文件Path
@param charset 字符集
@return BufferedReader对象
@throws IORuntimeException IO异常
@since 4.0.0
"""
return IoUtil.getReader(getInputStream(path), charset);
} | java | public static BufferedReader getReader(Path path, Charset charset) throws IORuntimeException {
return IoUtil.getReader(getInputStream(path), charset);
} | [
"public",
"static",
"BufferedReader",
"getReader",
"(",
"Path",
"path",
",",
"Charset",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"return",
"IoUtil",
".",
"getReader",
"(",
"getInputStream",
"(",
"path",
")",
",",
"charset",
")",
";",
"}"
] | 获得一个文件读取器
@param path 文件Path
@param charset 字符集
@return BufferedReader对象
@throws IORuntimeException IO异常
@since 4.0.0 | [
"获得一个文件读取器"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L1981-L1983 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/doc/DocClient.java | DocClient.readDocument | public ReadDocumentResponse readDocument(String documentId, long expireInSeconds) {
"""
read a Document, get document reader infomation.
@param documentId The document id.
@param expireInSeconds The expire time
@return A ReadDocumentResponse object containing the information returned by Document.
"""
... | java | public ReadDocumentResponse readDocument(String documentId, long expireInSeconds) {
ReadDocumentRequest request = new ReadDocumentRequest();
request.setDocumentId(documentId);
request.setExpireInSeconds(expireInSeconds);
return this.readDocument(request);
} | [
"public",
"ReadDocumentResponse",
"readDocument",
"(",
"String",
"documentId",
",",
"long",
"expireInSeconds",
")",
"{",
"ReadDocumentRequest",
"request",
"=",
"new",
"ReadDocumentRequest",
"(",
")",
";",
"request",
".",
"setDocumentId",
"(",
"documentId",
")",
";",... | read a Document, get document reader infomation.
@param documentId The document id.
@param expireInSeconds The expire time
@return A ReadDocumentResponse object containing the information returned by Document. | [
"read",
"a",
"Document",
"get",
"document",
"reader",
"infomation",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/doc/DocClient.java#L734-L739 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java | BiologicalAssemblyBuilder.orderTransformationsByChainId | private void orderTransformationsByChainId(Structure asymUnit, List<BiologicalAssemblyTransformation> transformations) {
"""
Orders model transformations by chain ids in the same order as in the asymmetric unit
@param asymUnit
@param transformations
"""
final List<String> chainIds = getChainIds(asymUnit);
... | java | private void orderTransformationsByChainId(Structure asymUnit, List<BiologicalAssemblyTransformation> transformations) {
final List<String> chainIds = getChainIds(asymUnit);
Collections.sort(transformations, new Comparator<BiologicalAssemblyTransformation>() {
@Override
public int compare(BiologicalAssemblyTr... | [
"private",
"void",
"orderTransformationsByChainId",
"(",
"Structure",
"asymUnit",
",",
"List",
"<",
"BiologicalAssemblyTransformation",
">",
"transformations",
")",
"{",
"final",
"List",
"<",
"String",
">",
"chainIds",
"=",
"getChainIds",
"(",
"asymUnit",
")",
";",
... | Orders model transformations by chain ids in the same order as in the asymmetric unit
@param asymUnit
@param transformations | [
"Orders",
"model",
"transformations",
"by",
"chain",
"ids",
"in",
"the",
"same",
"order",
"as",
"in",
"the",
"asymmetric",
"unit"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java#L165-L178 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/contextmenu/CmsContextMenuHandler.java | CmsContextMenuHandler.transformSingleEntry | protected I_CmsContextMenuEntry transformSingleEntry(CmsContextMenuEntryBean bean, CmsUUID structureId) {
"""
Creates a single context menu entry from a context menu entry bean.<p>
@param bean the menu entry bean
@param structureId the structure id
@return the context menu for the given entry
"""
... | java | protected I_CmsContextMenuEntry transformSingleEntry(CmsContextMenuEntryBean bean, CmsUUID structureId) {
String name = bean.getName();
I_CmsContextMenuCommand command = null;
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(name)) {
command = getContextMenuCommands().get(name);
... | [
"protected",
"I_CmsContextMenuEntry",
"transformSingleEntry",
"(",
"CmsContextMenuEntryBean",
"bean",
",",
"CmsUUID",
"structureId",
")",
"{",
"String",
"name",
"=",
"bean",
".",
"getName",
"(",
")",
";",
"I_CmsContextMenuCommand",
"command",
"=",
"null",
";",
"if",... | Creates a single context menu entry from a context menu entry bean.<p>
@param bean the menu entry bean
@param structureId the structure id
@return the context menu for the given entry | [
"Creates",
"a",
"single",
"context",
"menu",
"entry",
"from",
"a",
"context",
"menu",
"entry",
"bean",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/contextmenu/CmsContextMenuHandler.java#L210-L229 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupsImpl.java | PersonGroupsImpl.createWithServiceResponseAsync | public Observable<ServiceResponse<Void>> createWithServiceResponseAsync(String personGroupId, CreatePersonGroupsOptionalParameter createOptionalParameter) {
"""
Create a new person group with specified personGroupId, name and user-provided userData.
@param personGroupId Id referencing a particular person group.... | java | public Observable<ServiceResponse<Void>> createWithServiceResponseAsync(String personGroupId, CreatePersonGroupsOptionalParameter createOptionalParameter) {
if (this.client.azureRegion() == null) {
throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Void",
">",
">",
"createWithServiceResponseAsync",
"(",
"String",
"personGroupId",
",",
"CreatePersonGroupsOptionalParameter",
"createOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
"client",
".",
"azureRegion"... | Create a new person group with specified personGroupId, name and user-provided userData.
@param personGroupId Id referencing a particular person group.
@param createOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters ... | [
"Create",
"a",
"new",
"person",
"group",
"with",
"specified",
"personGroupId",
"name",
"and",
"user",
"-",
"provided",
"userData",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupsImpl.java#L150-L161 |
JCTools/JCTools | jctools-build/src/main/java/org/jctools/queues/atomic/JavaParsingAtomicQueueGenerator.java | JavaParsingAtomicQueueGenerator.fieldAssignment | protected BlockStmt fieldAssignment(String fieldName, String valueName) {
"""
Generates something like <code>field = newValue</code>
@param fieldName
@param valueName
@return
"""
BlockStmt body = new BlockStmt();
body.addStatement(
new ExpressionStmt(new AssignExpr(new Name... | java | protected BlockStmt fieldAssignment(String fieldName, String valueName) {
BlockStmt body = new BlockStmt();
body.addStatement(
new ExpressionStmt(new AssignExpr(new NameExpr(fieldName), new NameExpr(valueName), Operator.ASSIGN)));
return body;
} | [
"protected",
"BlockStmt",
"fieldAssignment",
"(",
"String",
"fieldName",
",",
"String",
"valueName",
")",
"{",
"BlockStmt",
"body",
"=",
"new",
"BlockStmt",
"(",
")",
";",
"body",
".",
"addStatement",
"(",
"new",
"ExpressionStmt",
"(",
"new",
"AssignExpr",
"("... | Generates something like <code>field = newValue</code>
@param fieldName
@param valueName
@return | [
"Generates",
"something",
"like",
"<code",
">",
"field",
"=",
"newValue<",
"/",
"code",
">"
] | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-build/src/main/java/org/jctools/queues/atomic/JavaParsingAtomicQueueGenerator.java#L212-L217 |
thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/locking/consistentkey/ExpectedValueCheckingStore.java | ExpectedValueCheckingStore.acquireLock | @Override
public void acquireLock(StaticBuffer key, StaticBuffer column, StaticBuffer expectedValue, StoreTransaction txh) throws BackendException {
"""
{@inheritDoc}
<p/>
This implementation supports locking when {@code lockStore} is non-null.
<p/>
Consider the following scenario. This method is called tw... | java | @Override
public void acquireLock(StaticBuffer key, StaticBuffer column, StaticBuffer expectedValue, StoreTransaction txh) throws BackendException {
if (locker != null) {
ExpectedValueCheckingTransaction tx = (ExpectedValueCheckingTransaction) txh;
if (tx.isMutationStarted())
... | [
"@",
"Override",
"public",
"void",
"acquireLock",
"(",
"StaticBuffer",
"key",
",",
"StaticBuffer",
"column",
",",
"StaticBuffer",
"expectedValue",
",",
"StoreTransaction",
"txh",
")",
"throws",
"BackendException",
"{",
"if",
"(",
"locker",
"!=",
"null",
")",
"{"... | {@inheritDoc}
<p/>
This implementation supports locking when {@code lockStore} is non-null.
<p/>
Consider the following scenario. This method is called twice with
identical key, column, and txh arguments, but with different
expectedValue arguments in each call. In testing, it seems titan's
graphdb requires that impleme... | [
"{"
] | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/locking/consistentkey/ExpectedValueCheckingStore.java#L81-L94 |
sdaschner/jaxrs-analyzer | src/main/java/com/sebastian_daschner/jaxrs_analyzer/model/rest/Resources.java | Resources.addMethod | public void addMethod(final String resource, final ResourceMethod method) {
"""
Adds the method to the resource's methods.
@param resource The resource path where to add
@param method The method to add
"""
resources.putIfAbsent(resource, new HashSet<>());
resources.get(resource).add(metho... | java | public void addMethod(final String resource, final ResourceMethod method) {
resources.putIfAbsent(resource, new HashSet<>());
resources.get(resource).add(method);
} | [
"public",
"void",
"addMethod",
"(",
"final",
"String",
"resource",
",",
"final",
"ResourceMethod",
"method",
")",
"{",
"resources",
".",
"putIfAbsent",
"(",
"resource",
",",
"new",
"HashSet",
"<>",
"(",
")",
")",
";",
"resources",
".",
"get",
"(",
"resourc... | Adds the method to the resource's methods.
@param resource The resource path where to add
@param method The method to add | [
"Adds",
"the",
"method",
"to",
"the",
"resource",
"s",
"methods",
"."
] | train | https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/model/rest/Resources.java#L39-L42 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.isAllocated | public boolean isAllocated(int index, JobID jobId, AllocationID allocationId) {
"""
Check whether the slot for the given index is allocated for the given job and allocation id.
@param index of the task slot
@param jobId for which the task slot should be allocated
@param allocationId which should match the tas... | java | public boolean isAllocated(int index, JobID jobId, AllocationID allocationId) {
TaskSlot taskSlot = taskSlots.get(index);
return taskSlot.isAllocated(jobId, allocationId);
} | [
"public",
"boolean",
"isAllocated",
"(",
"int",
"index",
",",
"JobID",
"jobId",
",",
"AllocationID",
"allocationId",
")",
"{",
"TaskSlot",
"taskSlot",
"=",
"taskSlots",
".",
"get",
"(",
"index",
")",
";",
"return",
"taskSlot",
".",
"isAllocated",
"(",
"jobId... | Check whether the slot for the given index is allocated for the given job and allocation id.
@param index of the task slot
@param jobId for which the task slot should be allocated
@param allocationId which should match the task slot's allocation id
@return True if the given task slot is allocated for the given job and... | [
"Check",
"whether",
"the",
"slot",
"for",
"the",
"given",
"index",
"is",
"allocated",
"for",
"the",
"given",
"job",
"and",
"allocation",
"id",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L375-L379 |
apache/groovy | subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java | NioGroovyMethods.withObjectInputStream | public static <T> T withObjectInputStream(Path self, ClassLoader classLoader, @ClosureParams(value = SimpleType.class, options = "java.io.ObjectInputStream") Closure<T> closure) throws IOException {
"""
Create a new ObjectInputStream for this file associated with the given class loader and pass it to the closure.
... | java | public static <T> T withObjectInputStream(Path self, ClassLoader classLoader, @ClosureParams(value = SimpleType.class, options = "java.io.ObjectInputStream") Closure<T> closure) throws IOException {
return IOGroovyMethods.withStream(newObjectInputStream(self, classLoader), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withObjectInputStream",
"(",
"Path",
"self",
",",
"ClassLoader",
"classLoader",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.ObjectInputStream\"",
")",
"Closure... | Create a new ObjectInputStream for this file associated with the given class loader and pass it to the closure.
This method ensures the stream is closed after the closure returns.
@param self a Path
@param classLoader the class loader to use when loading the class
@param closure a closure
@return the value ... | [
"Create",
"a",
"new",
"ObjectInputStream",
"for",
"this",
"file",
"associated",
"with",
"the",
"given",
"class",
"loader",
"and",
"pass",
"it",
"to",
"the",
"closure",
".",
"This",
"method",
"ensures",
"the",
"stream",
"is",
"closed",
"after",
"the",
"closur... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L191-L193 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.listStorageContainersAsync | public Observable<Page<BlobContainerInner>> listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName) {
"""
Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response i... | java | public Observable<Page<BlobContainerInner>> listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName) {
return listStorageContainersWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName)
.map(new Func1<ServiceResponse<... | [
"public",
"Observable",
"<",
"Page",
"<",
"BlobContainerInner",
">",
">",
"listStorageContainersAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
",",
"final",
"String",
"storageAccountName",
")",
"{",
"return",
"listStorageCo... | Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.
@param acco... | [
"Lists",
"the",
"Azure",
"Storage",
"containers",
"if",
"any",
"associated",
"with",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"and",
"Azure",
"Storage",
"account",
"combination",
".",
"The",
"response",
"includes",
"a",
"link",
"to",
"the",
"next",
"pa... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java#L718-L726 |
andrehertwig/admintool | admin-tools-security/admin-tools-security-dbuser/src/main/java/de/chandre/admintool/security/dbuser/service/validation/AbstractValidator.java | AbstractValidator.sortInterceptors | protected <I extends AdminToolValidationInterceptor<O>> void sortInterceptors(List<I> interceptors) {
"""
sorts the interceptors against its precedence
@param interceptors
"""
if (!CollectionUtils.isEmpty(interceptors)) {
int amount = interceptors != null ? interceptors.size() : 0;
LOGGER.debug... | java | protected <I extends AdminToolValidationInterceptor<O>> void sortInterceptors(List<I> interceptors) {
if (!CollectionUtils.isEmpty(interceptors)) {
int amount = interceptors != null ? interceptors.size() : 0;
LOGGER.debug(amount + " interceptors configured for " + getMessageArea());
Collections.sort(... | [
"protected",
"<",
"I",
"extends",
"AdminToolValidationInterceptor",
"<",
"O",
">",
">",
"void",
"sortInterceptors",
"(",
"List",
"<",
"I",
">",
"interceptors",
")",
"{",
"if",
"(",
"!",
"CollectionUtils",
".",
"isEmpty",
"(",
"interceptors",
")",
")",
"{",
... | sorts the interceptors against its precedence
@param interceptors | [
"sorts",
"the",
"interceptors",
"against",
"its",
"precedence"
] | train | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-security/admin-tools-security-dbuser/src/main/java/de/chandre/admintool/security/dbuser/service/validation/AbstractValidator.java#L59-L74 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskRunner.java | TaskRunner.addJobJarToClassPath | private void addJobJarToClassPath(String localJarFile, StringBuffer classPath) {
"""
Given the path to the localized job jar file, add it's constituents to
the classpath
"""
File jobCacheDir = new File
(new Path(localJarFile).getParent().toString());
File[] libs = new File(jobCacheDir, "lib").li... | java | private void addJobJarToClassPath(String localJarFile, StringBuffer classPath) {
File jobCacheDir = new File
(new Path(localJarFile).getParent().toString());
File[] libs = new File(jobCacheDir, "lib").listFiles();
String sep = System.getProperty("path.separator");
if (libs != null) {
for (i... | [
"private",
"void",
"addJobJarToClassPath",
"(",
"String",
"localJarFile",
",",
"StringBuffer",
"classPath",
")",
"{",
"File",
"jobCacheDir",
"=",
"new",
"File",
"(",
"new",
"Path",
"(",
"localJarFile",
")",
".",
"getParent",
"(",
")",
".",
"toString",
"(",
"... | Given the path to the localized job jar file, add it's constituents to
the classpath | [
"Given",
"the",
"path",
"to",
"the",
"localized",
"job",
"jar",
"file",
"add",
"it",
"s",
"constituents",
"to",
"the",
"classpath"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskRunner.java#L223-L239 |
kiegroup/drools | drools-model/drools-canonical-model/src/main/java/org/drools/model/bitmask/OpenBitSet.java | OpenBitSet.oversize | public static int oversize(int minTargetSize, int bytesPerElement) {
"""
Returns an array size >= minTargetSize, generally
over-allocating exponentially to achieve amortized
linear-time cost as the array grows.
NOTE: this was originally borrowed from Python 2.4.2
listobject.c sources (attribution in LICENSE.... | java | public static int oversize(int minTargetSize, int bytesPerElement) {
if (minTargetSize < 0) {
// catch usage that accidentally overflows int
throw new IllegalArgumentException("invalid array size " + minTargetSize);
}
if (minTargetSize == 0) {
// wait until ... | [
"public",
"static",
"int",
"oversize",
"(",
"int",
"minTargetSize",
",",
"int",
"bytesPerElement",
")",
"{",
"if",
"(",
"minTargetSize",
"<",
"0",
")",
"{",
"// catch usage that accidentally overflows int",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"invalid a... | Returns an array size >= minTargetSize, generally
over-allocating exponentially to achieve amortized
linear-time cost as the array grows.
NOTE: this was originally borrowed from Python 2.4.2
listobject.c sources (attribution in LICENSE.txt), but
has now been substantially changed based on
discussions from java-dev thr... | [
"Returns",
"an",
"array",
"size",
">",
"=",
"minTargetSize",
"generally",
"over",
"-",
"allocating",
"exponentially",
"to",
"achieve",
"amortized",
"linear",
"-",
"time",
"cost",
"as",
"the",
"array",
"grows",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-model/drools-canonical-model/src/main/java/org/drools/model/bitmask/OpenBitSet.java#L919-L986 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getAccountInfo | public void getAccountInfo(String API, Callback<Account> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on Account API go <a href="https://wiki.guildwars2.com/wiki/API:2/account">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#o... | java | public void getAccountInfo(String API, Callback<Account> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API));
gw2API.getAccount(API).enqueue(callback);
} | [
"public",
"void",
"getAccountInfo",
"(",
"String",
"API",
",",
"Callback",
"<",
"Account",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ParamType",
".",
"API",
",",
"AP... | For more info on Account API go <a href="https://wiki.guildwars2.com/wiki/API:2/account">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param API API key
@param callback callback that is going to be... | [
"For",
"more",
"info",
"on",
"Account",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"account",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user",
... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L164-L167 |
TakahikoKawasaki/nv-cipher | src/main/java/com/neovisionaries/security/CodecCipher.java | CodecCipher.setInit | public CodecCipher setInit(Certificate certificate, SecureRandom random) throws IllegalArgumentException {
"""
Set cipher initialization parameters.
<p>
If this method is used to set initialization parameters,
{@link Cipher#init(int, Certificate, SecureRandom)
Cipher.init(mode, (Certificate)certificate, (Sec... | java | public CodecCipher setInit(Certificate certificate, SecureRandom random) throws IllegalArgumentException
{
if (certificate == null)
{
throw new IllegalArgumentException("certificate is null.");
}
return setInit(null, null, null, certificate, random);
} | [
"public",
"CodecCipher",
"setInit",
"(",
"Certificate",
"certificate",
",",
"SecureRandom",
"random",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"certificate",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"certificate is n... | Set cipher initialization parameters.
<p>
If this method is used to set initialization parameters,
{@link Cipher#init(int, Certificate, SecureRandom)
Cipher.init(mode, (Certificate)certificate, (SecureRandom)random)}
is called later from within {@code encrypt}/{@code decrypt} methods.
</p>
@param certificate
@param ... | [
"Set",
"cipher",
"initialization",
"parameters",
"."
] | train | https://github.com/TakahikoKawasaki/nv-cipher/blob/d01aa4f53611e2724ae03633060f55bacf549175/src/main/java/com/neovisionaries/security/CodecCipher.java#L905-L913 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201902/cmsmetadataservice/GetAllCmsMetadataValues.java | GetAllCmsMetadataValues.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws ... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
// Get the CmsMetadataService.
CmsMetadataServiceInterface cmsMetadataService =
adManagerServices.get(session, CmsMetadataServiceInterface.class);
// Create a statement to sel... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"// Get the CmsMetadataService.",
"CmsMetadataServiceInterface",
"cmsMetadataService",
"=",
"adManagerServices",
"... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201902/cmsmetadataservice/GetAllCmsMetadataValues.java#L51-L88 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | StrBuilder.getChars | public void getChars(final int startIndex, final int endIndex, final char destination[], final int destinationIndex) {
"""
Copies the character array into the specified array.
@param startIndex first index to copy, inclusive, must be valid
@param endIndex last index, exclusive, must be valid
@param destinat... | java | public void getChars(final int startIndex, final int endIndex, final char destination[], final int destinationIndex) {
if (startIndex < 0) {
throw new StringIndexOutOfBoundsException(startIndex);
}
if (endIndex < 0 || endIndex > length()) {
throw new StringIndexOutOfBound... | [
"public",
"void",
"getChars",
"(",
"final",
"int",
"startIndex",
",",
"final",
"int",
"endIndex",
",",
"final",
"char",
"destination",
"[",
"]",
",",
"final",
"int",
"destinationIndex",
")",
"{",
"if",
"(",
"startIndex",
"<",
"0",
")",
"{",
"throw",
"new... | Copies the character array into the specified array.
@param startIndex first index to copy, inclusive, must be valid
@param endIndex last index, exclusive, must be valid
@param destination the destination array, must not be null or too small
@param destinationIndex the index to start copying in destination
@throws... | [
"Copies",
"the",
"character",
"array",
"into",
"the",
"specified",
"array",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L419-L430 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/query/parsing/impl/Neo4jPropertyHelper.java | Neo4jPropertyHelper.getPropertyIdentifier | public PropertyIdentifier getPropertyIdentifier(String entityType, List<String> propertyPath, int requiredDepth) {
"""
Returns the {@link PropertyIdentifier} for the given property path.
In passing, it creates all the necessary aliases for embedded/associations.
@param entityType the type of the entity
@par... | java | public PropertyIdentifier getPropertyIdentifier(String entityType, List<String> propertyPath, int requiredDepth) {
// we analyze the property path to find all the associations/embedded which are in the way and create proper
// aliases for them
String entityAlias = aliasResolver.findAliasForType( entityType );
... | [
"public",
"PropertyIdentifier",
"getPropertyIdentifier",
"(",
"String",
"entityType",
",",
"List",
"<",
"String",
">",
"propertyPath",
",",
"int",
"requiredDepth",
")",
"{",
"// we analyze the property path to find all the associations/embedded which are in the way and create prope... | Returns the {@link PropertyIdentifier} for the given property path.
In passing, it creates all the necessary aliases for embedded/associations.
@param entityType the type of the entity
@param propertyPath the path to the property without aliases
@param requiredDepth it defines until where the aliases will be consider... | [
"Returns",
"the",
"{",
"@link",
"PropertyIdentifier",
"}",
"for",
"the",
"given",
"property",
"path",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/query/parsing/impl/Neo4jPropertyHelper.java#L71-L131 |
JavaKoan/koan-annotations | src/main/java/com/javakoan/fixture/io/KoanReader.java | KoanReader.getProblemFromFile | public static String getProblemFromFile(Class<?> koanClass, String methodName) {
"""
Gets problem for a koan by method name.
@param koanClass the koan class
@param methodName the method name of the problem required
@return the problem content to be inserted between the koan start and end markers
"""
... | java | public static String getProblemFromFile(Class<?> koanClass, String methodName) {
return getSourceFromFile(koanClass, methodName, PROBLEM_EXTENSION);
} | [
"public",
"static",
"String",
"getProblemFromFile",
"(",
"Class",
"<",
"?",
">",
"koanClass",
",",
"String",
"methodName",
")",
"{",
"return",
"getSourceFromFile",
"(",
"koanClass",
",",
"methodName",
",",
"PROBLEM_EXTENSION",
")",
";",
"}"
] | Gets problem for a koan by method name.
@param koanClass the koan class
@param methodName the method name of the problem required
@return the problem content to be inserted between the koan start and end markers | [
"Gets",
"problem",
"for",
"a",
"koan",
"by",
"method",
"name",
"."
] | train | https://github.com/JavaKoan/koan-annotations/blob/e3c4872ae57051a0b74b2efa6f15f4ee9e37d263/src/main/java/com/javakoan/fixture/io/KoanReader.java#L114-L116 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.zone_zoneName_reset_POST | public void zone_zoneName_reset_POST(String zoneName, OvhResetRecord[] DnsRecords, Boolean minimized) throws IOException {
"""
Reset the DNS zone
REST: POST /domain/zone/{zoneName}/reset
@param minimized [required] Create only mandatory records
@param DnsRecords [required] Records that will be set after reset... | java | public void zone_zoneName_reset_POST(String zoneName, OvhResetRecord[] DnsRecords, Boolean minimized) throws IOException {
String qPath = "/domain/zone/{zoneName}/reset";
StringBuilder sb = path(qPath, zoneName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "DnsRecords", DnsRecords);
a... | [
"public",
"void",
"zone_zoneName_reset_POST",
"(",
"String",
"zoneName",
",",
"OvhResetRecord",
"[",
"]",
"DnsRecords",
",",
"Boolean",
"minimized",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/zone/{zoneName}/reset\"",
";",
"StringBuilder",
"... | Reset the DNS zone
REST: POST /domain/zone/{zoneName}/reset
@param minimized [required] Create only mandatory records
@param DnsRecords [required] Records that will be set after reset
@param zoneName [required] The internal name of your zone | [
"Reset",
"the",
"DNS",
"zone"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L790-L797 |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java | BasicBinder.registerBinding | public final <S, T> void registerBinding(ConverterKey<S,T> key, Binding<S, T> converter) {
"""
Register a Binding with the given source and target class.
A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
The source class is considered the owning class of the bi... | java | public final <S, T> void registerBinding(ConverterKey<S,T> key, Binding<S, T> converter) {
registerConverter(key.invert(), new FromUnmarshallerConverter<S,T>(converter));
registerConverter(key, new ToMarshallerConverter<S,T>(converter));
} | [
"public",
"final",
"<",
"S",
",",
"T",
">",
"void",
"registerBinding",
"(",
"ConverterKey",
"<",
"S",
",",
"T",
">",
"key",
",",
"Binding",
"<",
"S",
",",
"T",
">",
"converter",
")",
"{",
"registerConverter",
"(",
"key",
".",
"invert",
"(",
")",
",... | Register a Binding with the given source and target class.
A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
The source class is considered the owning class of the binding. The source can be marshalled
into the target class. Similarly, the target can be unmarshalled to... | [
"Register",
"a",
"Binding",
"with",
"the",
"given",
"source",
"and",
"target",
"class",
".",
"A",
"binding",
"unifies",
"a",
"marshaller",
"and",
"an",
"unmarshaller",
"and",
"both",
"must",
"be",
"available",
"to",
"resolve",
"a",
"binding",
"."
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L609-L612 |
andkulikov/Transitions-Everywhere | library(1.x)/src/main/java/com/transitionseverywhere/Scene.java | Scene.setCurrentScene | static void setCurrentScene(@NonNull View view, @Nullable Scene scene) {
"""
Set the scene that the given view is in. The current scene is set only
on the root view of a scene, not for every view in that hierarchy. This
information is used by Scene to determine whether there is a previous
scene which should be ... | java | static void setCurrentScene(@NonNull View view, @Nullable Scene scene) {
view.setTag(R.id.current_scene, scene);
} | [
"static",
"void",
"setCurrentScene",
"(",
"@",
"NonNull",
"View",
"view",
",",
"@",
"Nullable",
"Scene",
"scene",
")",
"{",
"view",
".",
"setTag",
"(",
"R",
".",
"id",
".",
"current_scene",
",",
"scene",
")",
";",
"}"
] | Set the scene that the given view is in. The current scene is set only
on the root view of a scene, not for every view in that hierarchy. This
information is used by Scene to determine whether there is a previous
scene which should be exited before the new scene is entered.
@param view The view on which the current sc... | [
"Set",
"the",
"scene",
"that",
"the",
"given",
"view",
"is",
"in",
".",
"The",
"current",
"scene",
"is",
"set",
"only",
"on",
"the",
"root",
"view",
"of",
"a",
"scene",
"not",
"for",
"every",
"view",
"in",
"that",
"hierarchy",
".",
"This",
"information... | train | https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/Scene.java#L203-L205 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/CmsEditorBase.java | CmsEditorBase.saveEntity | public void saveEntity(String entityId, boolean clearOnSuccess, Command callback) {
"""
Saves the given entity.<p>
@param entityId the entity id
@param clearOnSuccess <code>true</code> to clear all entities from entity back-end on success
@param callback the callback executed on success
"""
Cms... | java | public void saveEntity(String entityId, boolean clearOnSuccess, Command callback) {
CmsEntity entity = m_entityBackend.getEntity(entityId);
saveEntity(entity, clearOnSuccess, callback);
} | [
"public",
"void",
"saveEntity",
"(",
"String",
"entityId",
",",
"boolean",
"clearOnSuccess",
",",
"Command",
"callback",
")",
"{",
"CmsEntity",
"entity",
"=",
"m_entityBackend",
".",
"getEntity",
"(",
"entityId",
")",
";",
"saveEntity",
"(",
"entity",
",",
"cl... | Saves the given entity.<p>
@param entityId the entity id
@param clearOnSuccess <code>true</code> to clear all entities from entity back-end on success
@param callback the callback executed on success | [
"Saves",
"the",
"given",
"entity",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsEditorBase.java#L583-L587 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/util/MultimapJoiner.java | MultimapJoiner.appendTo | public <A extends Appendable> A appendTo(A appendable, Multimap<?, ?> map) throws IOException {
"""
Appends the string representation of each entry of {@code map}, using the previously configured separator and
key-value separator, to {@code appendable}.
"""
return appendTo(appendable, map.asMap().entrySet()... | java | public <A extends Appendable> A appendTo(A appendable, Multimap<?, ?> map) throws IOException {
return appendTo(appendable, map.asMap().entrySet());
} | [
"public",
"<",
"A",
"extends",
"Appendable",
">",
"A",
"appendTo",
"(",
"A",
"appendable",
",",
"Multimap",
"<",
"?",
",",
"?",
">",
"map",
")",
"throws",
"IOException",
"{",
"return",
"appendTo",
"(",
"appendable",
",",
"map",
".",
"asMap",
"(",
")",
... | Appends the string representation of each entry of {@code map}, using the previously configured separator and
key-value separator, to {@code appendable}. | [
"Appends",
"the",
"string",
"representation",
"of",
"each",
"entry",
"of",
"{"
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/util/MultimapJoiner.java#L45-L47 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/Layout.java | Layout.materializeChildren | private void materializeChildren(ElementBase parent, LayoutElement node, boolean ignoreInternal) {
"""
Materializes the layout, under the specified parent.
@param parent Parent UI element at this level of the hierarchy. May be null.
@param node The current layout element.
@param ignoreInternal Ignore internal... | java | private void materializeChildren(ElementBase parent, LayoutElement node, boolean ignoreInternal) {
for (LayoutNode child : node.getChildren()) {
PluginDefinition def = child.getDefinition();
ElementBase element = ignoreInternal && def.isInternal() ? null : createElement(parent, child);
... | [
"private",
"void",
"materializeChildren",
"(",
"ElementBase",
"parent",
",",
"LayoutElement",
"node",
",",
"boolean",
"ignoreInternal",
")",
"{",
"for",
"(",
"LayoutNode",
"child",
":",
"node",
".",
"getChildren",
"(",
")",
")",
"{",
"PluginDefinition",
"def",
... | Materializes the layout, under the specified parent.
@param parent Parent UI element at this level of the hierarchy. May be null.
@param node The current layout element.
@param ignoreInternal Ignore internal elements. | [
"Materializes",
"the",
"layout",
"under",
"the",
"specified",
"parent",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/Layout.java#L100-L117 |
apache/groovy | src/main/groovy/groovy/lang/ProxyMetaClass.java | ProxyMetaClass.setProperty | public void setProperty(Class aClass, Object object, String property, Object newValue, boolean b, boolean b1) {
"""
Interceptors the call to a property setter if a PropertyAccessInterceptor
is available
@param object The object to invoke the setter on
@param property The property name to set
@param newValu... | java | public void setProperty(Class aClass, Object object, String property, Object newValue, boolean b, boolean b1) {
if (null == interceptor) {
super.setProperty(aClass, object, property, newValue, b, b1);
}
if (interceptor instanceof PropertyAccessInterceptor) {
PropertyAcces... | [
"public",
"void",
"setProperty",
"(",
"Class",
"aClass",
",",
"Object",
"object",
",",
"String",
"property",
",",
"Object",
"newValue",
",",
"boolean",
"b",
",",
"boolean",
"b1",
")",
"{",
"if",
"(",
"null",
"==",
"interceptor",
")",
"{",
"super",
".",
... | Interceptors the call to a property setter if a PropertyAccessInterceptor
is available
@param object The object to invoke the setter on
@param property The property name to set
@param newValue The new value of the property | [
"Interceptors",
"the",
"call",
"to",
"a",
"property",
"setter",
"if",
"a",
"PropertyAccessInterceptor",
"is",
"available"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/ProxyMetaClass.java#L200-L214 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java | CloudStorageFileSystemProvider.newFileSystem | @Override
public CloudStorageFileSystem newFileSystem(URI uri, Map<String, ?> env) {
"""
Returns Cloud Storage file system, provided a URI, e.g. {@code gs://bucket}. The URI can
include a path component (that will be ignored).
@param uri bucket and current working directory, e.g. {@code gs://bucket}
@param ... | java | @Override
public CloudStorageFileSystem newFileSystem(URI uri, Map<String, ?> env) {
checkArgument(
uri.getScheme().equalsIgnoreCase(CloudStorageFileSystem.URI_SCHEME),
"Cloud Storage URIs must have '%s' scheme: %s",
CloudStorageFileSystem.URI_SCHEME,
uri);
checkArgument(
... | [
"@",
"Override",
"public",
"CloudStorageFileSystem",
"newFileSystem",
"(",
"URI",
"uri",
",",
"Map",
"<",
"String",
",",
"?",
">",
"env",
")",
"{",
"checkArgument",
"(",
"uri",
".",
"getScheme",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"CloudStorageFileSystem",... | Returns Cloud Storage file system, provided a URI, e.g. {@code gs://bucket}. The URI can
include a path component (that will be ignored).
@param uri bucket and current working directory, e.g. {@code gs://bucket}
@param env map of configuration options, whose keys correspond to the method names of {@link
CloudStorageCo... | [
"Returns",
"Cloud",
"Storage",
"file",
"system",
"provided",
"a",
"URI",
"e",
".",
"g",
".",
"{",
"@code",
"gs",
":",
"//",
"bucket",
"}",
".",
"The",
"URI",
"can",
"include",
"a",
"path",
"component",
"(",
"that",
"will",
"be",
"ignored",
")",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java#L243-L269 |
UrielCh/ovh-java-sdk | ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java | ApiOvhHorizonView.serviceName_domainTrust_domainTrustId_GET | public OvhDomainTrust serviceName_domainTrust_domainTrustId_GET(String serviceName, Long domainTrustId) throws IOException {
"""
Get this object properties
REST: GET /horizonView/{serviceName}/domainTrust/{domainTrustId}
@param serviceName [required] Domain of the service
@param domainTrustId [required] Domai... | java | public OvhDomainTrust serviceName_domainTrust_domainTrustId_GET(String serviceName, Long domainTrustId) throws IOException {
String qPath = "/horizonView/{serviceName}/domainTrust/{domainTrustId}";
StringBuilder sb = path(qPath, serviceName, domainTrustId);
String resp = exec(qPath, "GET", sb.toString(), null);
... | [
"public",
"OvhDomainTrust",
"serviceName_domainTrust_domainTrustId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"domainTrustId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/horizonView/{serviceName}/domainTrust/{domainTrustId}\"",
";",
"StringBuilder",
"s... | Get this object properties
REST: GET /horizonView/{serviceName}/domainTrust/{domainTrustId}
@param serviceName [required] Domain of the service
@param domainTrustId [required] Domain trust id | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java#L351-L356 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/streaming/ServerSentEvents.java | ServerSentEvents.fromStream | public static <T> HttpResponse fromStream(Stream<T> contentStream, Executor executor,
Function<? super T, ? extends ServerSentEvent> converter) {
"""
Creates a new Server-Sent Events stream from the specified {@link Stream} and {@code converter}.
@param contentStrea... | java | public static <T> HttpResponse fromStream(Stream<T> contentStream, Executor executor,
Function<? super T, ? extends ServerSentEvent> converter) {
return fromStream(defaultHttpHeaders, contentStream, HttpHeaders.EMPTY_HEADERS, executor, converter);
} | [
"public",
"static",
"<",
"T",
">",
"HttpResponse",
"fromStream",
"(",
"Stream",
"<",
"T",
">",
"contentStream",
",",
"Executor",
"executor",
",",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"ServerSentEvent",
">",
"converter",
")",
"{",
"retur... | Creates a new Server-Sent Events stream from the specified {@link Stream} and {@code converter}.
@param contentStream the {@link Stream} which publishes the objects supposed to send as contents
@param executor the executor which iterates the stream
@param converter the converter which converts published objects into {... | [
"Creates",
"a",
"new",
"Server",
"-",
"Sent",
"Events",
"stream",
"from",
"the",
"specified",
"{",
"@link",
"Stream",
"}",
"and",
"{",
"@code",
"converter",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/streaming/ServerSentEvents.java#L213-L216 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/PriceListUrl.java | PriceListUrl.getPriceListUrl | public static MozuUrl getPriceListUrl(String priceListCode, String responseFields) {
"""
Get Resource Url for GetPriceList
@param priceListCode The unique code of the price list for which you want to retrieve the details.
@param responseFields Filtering syntax appended to an API call to increase or decrease the ... | java | public static MozuUrl getPriceListUrl(String priceListCode, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/pricelists/{priceListCode}?responseFields={responseFields}");
formatter.formatUrl("priceListCode", priceListCode);
formatter.formatUrl("responseFiel... | [
"public",
"static",
"MozuUrl",
"getPriceListUrl",
"(",
"String",
"priceListCode",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/storefront/pricelists/{priceListCode}?responseFields={responseFields... | Get Resource Url for GetPriceList
@param priceListCode The unique code of the price list for which you want to retrieve the details.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve dat... | [
"Get",
"Resource",
"Url",
"for",
"GetPriceList"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/PriceListUrl.java#L22-L28 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java | AmazonSQSMessagingClientWrapper.logAndGetAmazonServiceException | private String logAndGetAmazonServiceException(AmazonServiceException ase, String action) {
"""
Create generic error message for <code>AmazonServiceException</code>. Message include
Action, RequestId, HTTPStatusCode, and AmazonErrorCode.
"""
String errorMessage = "AmazonServiceException: " + action + ... | java | private String logAndGetAmazonServiceException(AmazonServiceException ase, String action) {
String errorMessage = "AmazonServiceException: " + action + ". RequestId: " + ase.getRequestId() +
"\nHTTPStatusCode: " + ase.getStatusCode() + " AmazonErrorCode: " +
... | [
"private",
"String",
"logAndGetAmazonServiceException",
"(",
"AmazonServiceException",
"ase",
",",
"String",
"action",
")",
"{",
"String",
"errorMessage",
"=",
"\"AmazonServiceException: \"",
"+",
"action",
"+",
"\". RequestId: \"",
"+",
"ase",
".",
"getRequestId",
"(",... | Create generic error message for <code>AmazonServiceException</code>. Message include
Action, RequestId, HTTPStatusCode, and AmazonErrorCode. | [
"Create",
"generic",
"error",
"message",
"for",
"<code",
">",
"AmazonServiceException<",
"/",
"code",
">",
".",
"Message",
"include",
"Action",
"RequestId",
"HTTPStatusCode",
"and",
"AmazonErrorCode",
"."
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java#L401-L407 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/shared/BaseSharedTable.java | BaseSharedTable.addListener | public void addListener(Record record, FileListener listener) {
"""
Add a listener to the chain.
The listener must be cloned and added to all records on the list.
@param listener The listener to add.
"""
super.addListener(record, listener);
if (listener.getOwner() == this.getRecord()) // On... | java | public void addListener(Record record, FileListener listener)
{
super.addListener(record, listener);
if (listener.getOwner() == this.getRecord()) // Only replicate listeners added to base.
{
Iterator<BaseTable> iterator = this.getTables();
while (iterator.hasNext())... | [
"public",
"void",
"addListener",
"(",
"Record",
"record",
",",
"FileListener",
"listener",
")",
"{",
"super",
".",
"addListener",
"(",
"record",
",",
"listener",
")",
";",
"if",
"(",
"listener",
".",
"getOwner",
"(",
")",
"==",
"this",
".",
"getRecord",
... | Add a listener to the chain.
The listener must be cloned and added to all records on the list.
@param listener The listener to add. | [
"Add",
"a",
"listener",
"to",
"the",
"chain",
".",
"The",
"listener",
"must",
"be",
"cloned",
"and",
"added",
"to",
"all",
"records",
"on",
"the",
"list",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/shared/BaseSharedTable.java#L112-L135 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java | RingBuffer.tryPublishEvent | public <A> boolean tryPublishEvent(EventTranslatorOneArg<E, A> translator, A arg0) {
"""
Allows one user supplied argument.
@see #tryPublishEvent(EventTranslator)
@param translator The user specified translation for the event
@param arg0 A user supplied argument.
@return true if the value was published, fals... | java | public <A> boolean tryPublishEvent(EventTranslatorOneArg<E, A> translator, A arg0) {
try {
final long sequence = sequencer.tryNext();
translateAndPublish(translator, sequence, arg0);
return true;
} catch (InsufficientCapacityException e) {
return false;
... | [
"public",
"<",
"A",
">",
"boolean",
"tryPublishEvent",
"(",
"EventTranslatorOneArg",
"<",
"E",
",",
"A",
">",
"translator",
",",
"A",
"arg0",
")",
"{",
"try",
"{",
"final",
"long",
"sequence",
"=",
"sequencer",
".",
"tryNext",
"(",
")",
";",
"translateAn... | Allows one user supplied argument.
@see #tryPublishEvent(EventTranslator)
@param translator The user specified translation for the event
@param arg0 A user supplied argument.
@return true if the value was published, false if there was insufficient capacity. | [
"Allows",
"one",
"user",
"supplied",
"argument",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java#L403-L411 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java | ImageModerationsImpl.matchMethodWithServiceResponseAsync | public Observable<ServiceResponse<MatchResponse>> matchMethodWithServiceResponseAsync(MatchMethodOptionalParameter matchMethodOptionalParameter) {
"""
Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using <a href="/docs/services/578ff44d2703741568... | java | public Observable<ServiceResponse<MatchResponse>> matchMethodWithServiceResponseAsync(MatchMethodOptionalParameter matchMethodOptionalParameter) {
if (this.client.baseUrl() == null) {
throw new IllegalArgumentException("Parameter this.client.baseUrl() is required and cannot be null.");
}
... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"MatchResponse",
">",
">",
"matchMethodWithServiceResponseAsync",
"(",
"MatchMethodOptionalParameter",
"matchMethodOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
"client",
".",
"baseUrl",
"(",
")",
"==",
"nul... | Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using <a href="/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe">this</a> API.
Returns ID and tags of matching image.<br/>
<br/>
Note: Refresh Index must be... | [
"Fuzzily",
"match",
"an",
"image",
"against",
"one",
"of",
"your",
"custom",
"Image",
"Lists",
".",
"You",
"can",
"create",
"and",
"manage",
"your",
"custom",
"image",
"lists",
"using",
"<",
";",
"a",
"href",
"=",
"/",
"docs",
"/",
"services",
"/",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L615-L623 |
telly/groundy | library/src/main/java/com/telly/groundy/TaskResult.java | TaskResult.add | public TaskResult add(String key, Parcelable[] value) {
"""
Inserts an array of Parcelable values into the mapping of this Bundle, replacing any existing
value for the given key. Either key or value may be null.
@param key a String, or null
@param value an array of Parcelable objects, or null
"""
mBu... | java | public TaskResult add(String key, Parcelable[] value) {
mBundle.putParcelableArray(key, value);
return this;
} | [
"public",
"TaskResult",
"add",
"(",
"String",
"key",
",",
"Parcelable",
"[",
"]",
"value",
")",
"{",
"mBundle",
".",
"putParcelableArray",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts an array of Parcelable values into the mapping of this Bundle, replacing any existing
value for the given key. Either key or value may be null.
@param key a String, or null
@param value an array of Parcelable objects, or null | [
"Inserts",
"an",
"array",
"of",
"Parcelable",
"values",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/TaskResult.java#L191-L194 |
davidmoten/rxjava2-extras | src/main/java/com/github/davidmoten/rx2/flowable/Serialized.java | Serialized.read | public static <T extends Serializable> Flowable<T> read(final File file) {
"""
Returns the deserialized objects from the given {@link File} as a
{@link Flowable} stream. A buffer size of 8192 bytes is used by default.
@param file
the input file containing serialized java objects
@param <T>
the generic type ... | java | public static <T extends Serializable> Flowable<T> read(final File file) {
return read(file, DEFAULT_BUFFER_SIZE);
} | [
"public",
"static",
"<",
"T",
"extends",
"Serializable",
">",
"Flowable",
"<",
"T",
">",
"read",
"(",
"final",
"File",
"file",
")",
"{",
"return",
"read",
"(",
"file",
",",
"DEFAULT_BUFFER_SIZE",
")",
";",
"}"
] | Returns the deserialized objects from the given {@link File} as a
{@link Flowable} stream. A buffer size of 8192 bytes is used by default.
@param file
the input file containing serialized java objects
@param <T>
the generic type of the deserialized objects returned in the
stream
@return the stream of deserialized obje... | [
"Returns",
"the",
"deserialized",
"objects",
"from",
"the",
"given",
"{",
"@link",
"File",
"}",
"as",
"a",
"{",
"@link",
"Flowable",
"}",
"stream",
".",
"A",
"buffer",
"size",
"of",
"8192",
"bytes",
"is",
"used",
"by",
"default",
"."
] | train | https://github.com/davidmoten/rxjava2-extras/blob/bf5ece3f97191f29a81957a6529bc3cfa4d7b328/src/main/java/com/github/davidmoten/rx2/flowable/Serialized.java#L122-L124 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/application/Application.java | Application.getResourceBundle | public ResourceBundle getResourceBundle(FacesContext ctx, String name) {
"""
<p>Find a <code>ResourceBundle</code> as defined in the
application configuration resources under the specified name. If
a <code>ResourceBundle</code> was defined for the name, return an
instance that uses the locale of the current {@... | java | public ResourceBundle getResourceBundle(FacesContext ctx, String name) {
if (defaultApplication != null) {
return defaultApplication.getResourceBundle(ctx, name);
}
throw new UnsupportedOperationException();
} | [
"public",
"ResourceBundle",
"getResourceBundle",
"(",
"FacesContext",
"ctx",
",",
"String",
"name",
")",
"{",
"if",
"(",
"defaultApplication",
"!=",
"null",
")",
"{",
"return",
"defaultApplication",
".",
"getResourceBundle",
"(",
"ctx",
",",
"name",
")",
";",
... | <p>Find a <code>ResourceBundle</code> as defined in the
application configuration resources under the specified name. If
a <code>ResourceBundle</code> was defined for the name, return an
instance that uses the locale of the current {@link
javax.faces.component.UIViewRoot}.</p>
<p>The default implementation throws
<co... | [
"<p",
">",
"Find",
"a",
"<code",
">",
"ResourceBundle<",
"/",
"code",
">",
"as",
"defined",
"in",
"the",
"application",
"configuration",
"resources",
"under",
"the",
"specified",
"name",
".",
"If",
"a",
"<code",
">",
"ResourceBundle<",
"/",
"code",
">",
"w... | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/application/Application.java#L354-L362 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java | PageInBrowserStats.getDomLastLoadTime | public long getDomLastLoadTime(final String intervalName, final TimeUnit unit) {
"""
Returns DOM last load time for given interval and {@link TimeUnit}.
@param intervalName name of the interval
@param unit {@link TimeUnit}
@return DOM last load time
"""
return unit.transformMillis(domLastLoadTim... | java | public long getDomLastLoadTime(final String intervalName, final TimeUnit unit) {
return unit.transformMillis(domLastLoadTime.getValueAsLong(intervalName));
} | [
"public",
"long",
"getDomLastLoadTime",
"(",
"final",
"String",
"intervalName",
",",
"final",
"TimeUnit",
"unit",
")",
"{",
"return",
"unit",
".",
"transformMillis",
"(",
"domLastLoadTime",
".",
"getValueAsLong",
"(",
"intervalName",
")",
")",
";",
"}"
] | Returns DOM last load time for given interval and {@link TimeUnit}.
@param intervalName name of the interval
@param unit {@link TimeUnit}
@return DOM last load time | [
"Returns",
"DOM",
"last",
"load",
"time",
"for",
"given",
"interval",
"and",
"{",
"@link",
"TimeUnit",
"}",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java#L153-L155 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRAssetLoader.java | GVRAssetLoader.loadModel | public GVRSceneObject loadModel(final String filePath, final GVRScene scene) throws IOException {
"""
Loads a hierarchy of scene objects {@link GVRSceneObject} from a 3D model
and adds it to the specified scene.
IAssetEvents are emitted to event listener attached to the context.
This function blocks the current... | java | public GVRSceneObject loadModel(final String filePath, final GVRScene scene) throws IOException
{
GVRSceneObject model = new GVRSceneObject(mContext);
AssetRequest assetRequest = new AssetRequest(model, new GVRResourceVolume(mContext, filePath), scene, null, false);
String ext = filePath.sub... | [
"public",
"GVRSceneObject",
"loadModel",
"(",
"final",
"String",
"filePath",
",",
"final",
"GVRScene",
"scene",
")",
"throws",
"IOException",
"{",
"GVRSceneObject",
"model",
"=",
"new",
"GVRSceneObject",
"(",
"mContext",
")",
";",
"AssetRequest",
"assetRequest",
"... | Loads a hierarchy of scene objects {@link GVRSceneObject} from a 3D model
and adds it to the specified scene.
IAssetEvents are emitted to event listener attached to the context.
This function blocks the current thread while loading the model
but loads the textures asynchronously in the background.
<p>
If you are loadin... | [
"Loads",
"a",
"hierarchy",
"of",
"scene",
"objects",
"{",
"@link",
"GVRSceneObject",
"}",
"from",
"a",
"3D",
"model",
"and",
"adds",
"it",
"to",
"the",
"specified",
"scene",
".",
"IAssetEvents",
"are",
"emitted",
"to",
"event",
"listener",
"attached",
"to",
... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRAssetLoader.java#L1092-L1109 |
lucee/Lucee | core/src/main/java/lucee/runtime/schedule/StorageUtil.java | StorageUtil.loadFile | public void loadFile(File file, String resourcePath) throws IOException {
"""
create xml file from a resource definition
@param file
@param resourcePath
@throws IOException
"""
loadFile(ResourceUtil.toResource(file), resourcePath);
} | java | public void loadFile(File file, String resourcePath) throws IOException {
loadFile(ResourceUtil.toResource(file), resourcePath);
} | [
"public",
"void",
"loadFile",
"(",
"File",
"file",
",",
"String",
"resourcePath",
")",
"throws",
"IOException",
"{",
"loadFile",
"(",
"ResourceUtil",
".",
"toResource",
"(",
"file",
")",
",",
"resourcePath",
")",
";",
"}"
] | create xml file from a resource definition
@param file
@param resourcePath
@throws IOException | [
"create",
"xml",
"file",
"from",
"a",
"resource",
"definition"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/schedule/StorageUtil.java#L63-L65 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/FormulaFactory.java | FormulaFactory.pbc | public PBConstraint pbc(final CType comparator, final int rhs, final List<? extends Literal> literals, final List<Integer> coefficients) {
"""
Creates a new pseudo-Boolean constraint.
@param comparator the comparator of the constraint
@param rhs the right-hand side of the constraint
@param literals ... | java | public PBConstraint pbc(final CType comparator, final int rhs, final List<? extends Literal> literals, final List<Integer> coefficients) {
final int[] cfs = new int[coefficients.size()];
for (int i = 0; i < coefficients.size(); i++)
cfs[i] = coefficients.get(i);
return this.constructPBC(comparator, rh... | [
"public",
"PBConstraint",
"pbc",
"(",
"final",
"CType",
"comparator",
",",
"final",
"int",
"rhs",
",",
"final",
"List",
"<",
"?",
"extends",
"Literal",
">",
"literals",
",",
"final",
"List",
"<",
"Integer",
">",
"coefficients",
")",
"{",
"final",
"int",
... | Creates a new pseudo-Boolean constraint.
@param comparator the comparator of the constraint
@param rhs the right-hand side of the constraint
@param literals the literals of the constraint
@param coefficients the coefficients of the constraint
@return the pseudo-Boolean constraint
@throws IllegalArgumentE... | [
"Creates",
"a",
"new",
"pseudo",
"-",
"Boolean",
"constraint",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/FormulaFactory.java#L721-L726 |
CloudSlang/cs-actions | cs-database/src/main/java/io/cloudslang/content/database/services/dbconnection/DBConnectionManager.java | DBConnectionManager.getPropIntValue | protected int getPropIntValue(String aPropName, String aDefaultValue) {
"""
get int value based on the property name from property file
the property file is databasePooling.properties
@param aPropName a property name
@param aDefaultValue a default value for that property, if the property is not there.
@r... | java | protected int getPropIntValue(String aPropName, String aDefaultValue) {
int retValue;
String temp = dbPoolingProperties.getProperty(aPropName, aDefaultValue);
retValue = Integer.valueOf(temp);
return retValue;
} | [
"protected",
"int",
"getPropIntValue",
"(",
"String",
"aPropName",
",",
"String",
"aDefaultValue",
")",
"{",
"int",
"retValue",
";",
"String",
"temp",
"=",
"dbPoolingProperties",
".",
"getProperty",
"(",
"aPropName",
",",
"aDefaultValue",
")",
";",
"retValue",
"... | get int value based on the property name from property file
the property file is databasePooling.properties
@param aPropName a property name
@param aDefaultValue a default value for that property, if the property is not there.
@return int value of that property | [
"get",
"int",
"value",
"based",
"on",
"the",
"property",
"name",
"from",
"property",
"file",
"the",
"property",
"file",
"is",
"databasePooling",
".",
"properties"
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-database/src/main/java/io/cloudslang/content/database/services/dbconnection/DBConnectionManager.java#L358-L365 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Matrix.java | Matrix.plus | public Matrix plus(final Matrix B) {
"""
Returns C = A + B
@param B
@return new Matrix C
@throws GeometryException if the matrix dimensions don't match
"""
final Matrix A = this;
if ((B.m_rows != A.m_rows) || (B.m_columns != A.m_columns))
{
throw new GeometryExcep... | java | public Matrix plus(final Matrix B)
{
final Matrix A = this;
if ((B.m_rows != A.m_rows) || (B.m_columns != A.m_columns))
{
throw new GeometryException("Illegal matrix dimensions");
}
final Matrix C = new Matrix(m_rows, m_columns);
for (int i = 0... | [
"public",
"Matrix",
"plus",
"(",
"final",
"Matrix",
"B",
")",
"{",
"final",
"Matrix",
"A",
"=",
"this",
";",
"if",
"(",
"(",
"B",
".",
"m_rows",
"!=",
"A",
".",
"m_rows",
")",
"||",
"(",
"B",
".",
"m_columns",
"!=",
"A",
".",
"m_columns",
")",
... | Returns C = A + B
@param B
@return new Matrix C
@throws GeometryException if the matrix dimensions don't match | [
"Returns",
"C",
"=",
"A",
"+",
"B"
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Matrix.java#L136-L154 |
wcm-io/wcm-io-tooling | commons/crx-packmgr-helper/src/main/java/io/wcm/tooling/commons/packmgr/PackageManagerHelper.java | PackageManagerHelper.executePackageManagerMethodXml | public Document executePackageManagerMethodXml(CloseableHttpClient httpClient, HttpRequestBase method) {
"""
Execute CRX HTTP Package manager method and parse XML response.
@param httpClient Http client
@param method Get or Post method
@return XML document
"""
PackageManagerXmlCall call = new PackageMan... | java | public Document executePackageManagerMethodXml(CloseableHttpClient httpClient, HttpRequestBase method) {
PackageManagerXmlCall call = new PackageManagerXmlCall(httpClient, method, log);
return executeHttpCallWithRetry(call, 0);
} | [
"public",
"Document",
"executePackageManagerMethodXml",
"(",
"CloseableHttpClient",
"httpClient",
",",
"HttpRequestBase",
"method",
")",
"{",
"PackageManagerXmlCall",
"call",
"=",
"new",
"PackageManagerXmlCall",
"(",
"httpClient",
",",
"method",
",",
"log",
")",
";",
... | Execute CRX HTTP Package manager method and parse XML response.
@param httpClient Http client
@param method Get or Post method
@return XML document | [
"Execute",
"CRX",
"HTTP",
"Package",
"manager",
"method",
"and",
"parse",
"XML",
"response",
"."
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/commons/crx-packmgr-helper/src/main/java/io/wcm/tooling/commons/packmgr/PackageManagerHelper.java#L231-L234 |
uaihebert/uaiMockServer | src/main/java/com/uaihebert/uaimockserver/log/backend/Log.java | Log.warnFormatted | public static void warnFormatted(final String text, final Object... parameterArray) {
"""
Wil log a text with the WARN level. The text with be formatted using the String.format(...)
"""
final String formattedText = String.format(text, parameterArray);
logWriterInstance.warn(formattedText);
... | java | public static void warnFormatted(final String text, final Object... parameterArray) {
final String formattedText = String.format(text, parameterArray);
logWriterInstance.warn(formattedText);
UaiWebSocketLogManager.addLogText("[WARN] " + formattedText);
} | [
"public",
"static",
"void",
"warnFormatted",
"(",
"final",
"String",
"text",
",",
"final",
"Object",
"...",
"parameterArray",
")",
"{",
"final",
"String",
"formattedText",
"=",
"String",
".",
"format",
"(",
"text",
",",
"parameterArray",
")",
";",
"logWriterIn... | Wil log a text with the WARN level. The text with be formatted using the String.format(...) | [
"Wil",
"log",
"a",
"text",
"with",
"the",
"WARN",
"level",
".",
"The",
"text",
"with",
"be",
"formatted",
"using",
"the",
"String",
".",
"format",
"(",
"...",
")"
] | train | https://github.com/uaihebert/uaiMockServer/blob/8b0090d4018c2f430cfbbb3ae249347652802f2b/src/main/java/com/uaihebert/uaimockserver/log/backend/Log.java#L63-L69 |
petrbouda/joyrest | joyrest-core/src/main/java/org/joyrest/extractor/PathParamExtractor.java | PathParamExtractor.apply | @Override
public PathParam apply(RoutePart<?> routePart, String pathPart) {
"""
Compares the route part (part which is configured) and the path part (part which is gained from the client) and tries to
create a
path param.
<p>
If it is just string path, so this method will return @{code null}.
</p>
<p>
... | java | @Override
public PathParam apply(RoutePart<?> routePart, String pathPart) {
if (routePart.getType() == RoutePart.Type.PARAM) {
return new PathParam(routePart.getValue(), pathPart);
}
return null;
} | [
"@",
"Override",
"public",
"PathParam",
"apply",
"(",
"RoutePart",
"<",
"?",
">",
"routePart",
",",
"String",
"pathPart",
")",
"{",
"if",
"(",
"routePart",
".",
"getType",
"(",
")",
"==",
"RoutePart",
".",
"Type",
".",
"PARAM",
")",
"{",
"return",
"new... | Compares the route part (part which is configured) and the path part (part which is gained from the client) and tries to
create a
path param.
<p>
If it is just string path, so this method will return @{code null}.
</p>
<p>
If it is param path, so method will find out whether is possible to cast the object or not and t... | [
"Compares",
"the",
"route",
"part",
"(",
"part",
"which",
"is",
"configured",
")",
"and",
"the",
"path",
"part",
"(",
"part",
"which",
"is",
"gained",
"from",
"the",
"client",
")",
"and",
"tries",
"to",
"create",
"a",
"path",
"param",
"."
] | train | https://github.com/petrbouda/joyrest/blob/58903f06fb7f0b8fdf1ef91318fb48a88bf970e0/joyrest-core/src/main/java/org/joyrest/extractor/PathParamExtractor.java#L44-L51 |
gfk-ba/senbot | SenBotRunner/src/main/java/com/gfk/senbot/framework/services/selenium/ElementService.java | ElementService.dragElementTo | public void dragElementTo(String draggable, String droppable, int waitForMillies) throws InterruptedException {
"""
Drags an element some place else
@param draggable
The element to drag
@param droppable
The drop aim
@param waitForMillies
???
@throws InterruptedException
"""
WebElement draggableEl = ... | java | public void dragElementTo(String draggable, String droppable, int waitForMillies) throws InterruptedException {
WebElement draggableEl = translateLocatorToWebElement(draggable);
WebElement dragReceiver = translateLocatorToWebElement(droppable);
Actions clickAndDrag = new Actions(getWebDriver());
clickAndDrag.d... | [
"public",
"void",
"dragElementTo",
"(",
"String",
"draggable",
",",
"String",
"droppable",
",",
"int",
"waitForMillies",
")",
"throws",
"InterruptedException",
"{",
"WebElement",
"draggableEl",
"=",
"translateLocatorToWebElement",
"(",
"draggable",
")",
";",
"WebEleme... | Drags an element some place else
@param draggable
The element to drag
@param droppable
The drop aim
@param waitForMillies
???
@throws InterruptedException | [
"Drags",
"an",
"element",
"some",
"place",
"else"
] | train | https://github.com/gfk-ba/senbot/blob/e9a152aa67be48b1bb13a4691655caf6d873b553/SenBotRunner/src/main/java/com/gfk/senbot/framework/services/selenium/ElementService.java#L312-L321 |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/model/ObservationTree.java | ObservationTree.addState | public void addState(final S newState, final Word<I> accessSequence, final O output) {
"""
Registers a new hypothesis state at the observation tree. It is expected to register states in the order of their
discovery, meaning whenever a new state is added, information about all prefixes of its access sequence are
... | java | public void addState(final S newState, final Word<I> accessSequence, final O output) {
final Word<I> prefix = accessSequence.prefix(accessSequence.length() - 1);
final I sym = accessSequence.lastSymbol();
final FastMealyState<O> pred =
this.observationTree.getSuccessor(this.obse... | [
"public",
"void",
"addState",
"(",
"final",
"S",
"newState",
",",
"final",
"Word",
"<",
"I",
">",
"accessSequence",
",",
"final",
"O",
"output",
")",
"{",
"final",
"Word",
"<",
"I",
">",
"prefix",
"=",
"accessSequence",
".",
"prefix",
"(",
"accessSequenc... | Registers a new hypothesis state at the observation tree. It is expected to register states in the order of their
discovery, meaning whenever a new state is added, information about all prefixes of its access sequence are
already stored. Therefore providing only the output of the last symbol of its access sequence is s... | [
"Registers",
"a",
"new",
"hypothesis",
"state",
"at",
"the",
"observation",
"tree",
".",
"It",
"is",
"expected",
"to",
"register",
"states",
"in",
"the",
"order",
"of",
"their",
"discovery",
"meaning",
"whenever",
"a",
"new",
"state",
"is",
"added",
"informa... | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/model/ObservationTree.java#L181-L197 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DerInputBuffer.java | DerInputBuffer.getBigInteger | BigInteger getBigInteger(int len, boolean makePositive) throws IOException {
"""
Returns the integer which takes up the specified number
of bytes in this buffer as a BigInteger.
@param len the number of bytes to use.
@param makePositive whether to always return a positive value,
irrespective of actual encoding... | java | BigInteger getBigInteger(int len, boolean makePositive) throws IOException {
if (len > available())
throw new IOException("short read of integer");
if (len == 0) {
throw new IOException("Invalid encoding: zero length Int value");
}
byte[] bytes = new byte[len];
... | [
"BigInteger",
"getBigInteger",
"(",
"int",
"len",
",",
"boolean",
"makePositive",
")",
"throws",
"IOException",
"{",
"if",
"(",
"len",
">",
"available",
"(",
")",
")",
"throw",
"new",
"IOException",
"(",
"\"short read of integer\"",
")",
";",
"if",
"(",
"len... | Returns the integer which takes up the specified number
of bytes in this buffer as a BigInteger.
@param len the number of bytes to use.
@param makePositive whether to always return a positive value,
irrespective of actual encoding
@return the integer as a BigInteger. | [
"Returns",
"the",
"integer",
"which",
"takes",
"up",
"the",
"specified",
"number",
"of",
"bytes",
"in",
"this",
"buffer",
"as",
"a",
"BigInteger",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DerInputBuffer.java#L149-L172 |
sporniket/core | sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java | XmlStringTools.doAppendOpeningTag | private static StringBuffer doAppendOpeningTag(StringBuffer buffer, String tag, Map<String, String> attributes) {
"""
Add an opening tag with attributes to a StringBuffer.
@param buffer
StringBuffer to fill
@param tag
the tag to open
@param attributes
the attribute map
@return the buffer
"""
buffer.... | java | private static StringBuffer doAppendOpeningTag(StringBuffer buffer, String tag, Map<String, String> attributes)
{
buffer.append(SEQUENCE__TAG__BEGIN_OPENING_TAG).append(tag);
for (String _attributeName : attributes.keySet())
{
String _attributeValue = attributes.get(_attributeName);
_attributeValue = encod... | [
"private",
"static",
"StringBuffer",
"doAppendOpeningTag",
"(",
"StringBuffer",
"buffer",
",",
"String",
"tag",
",",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"buffer",
".",
"append",
"(",
"SEQUENCE__TAG__BEGIN_OPENING_TAG",
")",
".",
"ap... | Add an opening tag with attributes to a StringBuffer.
@param buffer
StringBuffer to fill
@param tag
the tag to open
@param attributes
the attribute map
@return the buffer | [
"Add",
"an",
"opening",
"tag",
"with",
"attributes",
"to",
"a",
"StringBuffer",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java#L487-L499 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsOuTree.java | CmsOuTree.getIconCaptionHTML | private String getIconCaptionHTML(Object item, I_CmsOuTreeType type) {
"""
Get HTML for icon and item caption.<p>
@param item item to get icon and caption for
@param type type
@return html
"""
CmsCssIcon icon = type.getIcon();
String caption = type.getName();
if (item instanceof C... | java | private String getIconCaptionHTML(Object item, I_CmsOuTreeType type) {
CmsCssIcon icon = type.getIcon();
String caption = type.getName();
if (item instanceof CmsOrganizationalUnit) {
CmsOrganizationalUnit ou = (CmsOrganizationalUnit)item;
if (ou.hasFlagWebuser()) {
... | [
"private",
"String",
"getIconCaptionHTML",
"(",
"Object",
"item",
",",
"I_CmsOuTreeType",
"type",
")",
"{",
"CmsCssIcon",
"icon",
"=",
"type",
".",
"getIcon",
"(",
")",
";",
"String",
"caption",
"=",
"type",
".",
"getName",
"(",
")",
";",
"if",
"(",
"ite... | Get HTML for icon and item caption.<p>
@param item item to get icon and caption for
@param type type
@return html | [
"Get",
"HTML",
"for",
"icon",
"and",
"item",
"caption",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsOuTree.java#L395-L427 |
ben-manes/caffeine | simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/membership/bloom/BloomFilter.java | BloomFilter.ensureCapacity | void ensureCapacity(@NonNegative long expectedInsertions, @NonNegative double fpp) {
"""
Initializes and increases the capacity of this <tt>BloomFilter</tt> instance, if necessary,
to ensure that it can accurately estimate the membership of elements given the expected
number of insertions. This operation forgets... | java | void ensureCapacity(@NonNegative long expectedInsertions, @NonNegative double fpp) {
checkArgument(expectedInsertions >= 0);
checkArgument(fpp > 0 && fpp < 1);
double optimalBitsFactor = -Math.log(fpp) / (Math.log(2) * Math.log(2));
int optimalNumberOfBits = (int) (expectedInsertions * optimalBitsFacto... | [
"void",
"ensureCapacity",
"(",
"@",
"NonNegative",
"long",
"expectedInsertions",
",",
"@",
"NonNegative",
"double",
"fpp",
")",
"{",
"checkArgument",
"(",
"expectedInsertions",
">=",
"0",
")",
";",
"checkArgument",
"(",
"fpp",
">",
"0",
"&&",
"fpp",
"<",
"1"... | Initializes and increases the capacity of this <tt>BloomFilter</tt> instance, if necessary,
to ensure that it can accurately estimate the membership of elements given the expected
number of insertions. This operation forgets all previous memberships when resizing.
@param expectedInsertions the number of expected inser... | [
"Initializes",
"and",
"increases",
"the",
"capacity",
"of",
"this",
"<tt",
">",
"BloomFilter<",
"/",
"tt",
">",
"instance",
"if",
"necessary",
"to",
"ensure",
"that",
"it",
"can",
"accurately",
"estimate",
"the",
"membership",
"of",
"elements",
"given",
"the",... | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/membership/bloom/BloomFilter.java#L63-L80 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/ClassNode.java | ClassNode.addMethod | public MethodNode addMethod(String name,
int modifiers,
ClassNode returnType,
Parameter[] parameters,
ClassNode[] exceptions,
Statement code) {
"""
If a me... | java | public MethodNode addMethod(String name,
int modifiers,
ClassNode returnType,
Parameter[] parameters,
ClassNode[] exceptions,
Statement code) {
MethodNo... | [
"public",
"MethodNode",
"addMethod",
"(",
"String",
"name",
",",
"int",
"modifiers",
",",
"ClassNode",
"returnType",
",",
"Parameter",
"[",
"]",
"parameters",
",",
"ClassNode",
"[",
"]",
"exceptions",
",",
"Statement",
"code",
")",
"{",
"MethodNode",
"other",
... | If a method with the given name and parameters is already defined then it is returned
otherwise the given method is added to this node. This method is useful for
default method adding like getProperty() or invokeMethod() where there may already
be a method defined in a class and so the default implementations should no... | [
"If",
"a",
"method",
"with",
"the",
"given",
"name",
"and",
"parameters",
"is",
"already",
"defined",
"then",
"it",
"is",
"returned",
"otherwise",
"the",
"given",
"method",
"is",
"added",
"to",
"this",
"node",
".",
"This",
"method",
"is",
"useful",
"for",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/ClassNode.java#L645-L659 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/builder/standard/AbstractNumberProcessorBuilder.java | AbstractNumberProcessorBuilder.createSimpleFormatter | @SuppressWarnings("unchecked")
protected SimpleNumberFormatter<N> createSimpleFormatter(final FieldAccessor field, final Configuration config) {
"""
アノテーション{@link CsvNumberFormat}の指定がないときなどの書式のない数値のフォーマッタの作成。
<p>{@link #createFormatter(FieldAccessor, Configuration)}で結果が空の時に使用する。</p>
@param field フィールド情報
... | java | @SuppressWarnings("unchecked")
protected SimpleNumberFormatter<N> createSimpleFormatter(final FieldAccessor field, final Configuration config) {
final Optional<CsvNumberFormat> formatAnno = field.getAnnotation(CsvNumberFormat.class);
if(!formatAnno.isPresent()) {
return new... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"SimpleNumberFormatter",
"<",
"N",
">",
"createSimpleFormatter",
"(",
"final",
"FieldAccessor",
"field",
",",
"final",
"Configuration",
"config",
")",
"{",
"final",
"Optional",
"<",
"CsvNumberFormat",
... | アノテーション{@link CsvNumberFormat}の指定がないときなどの書式のない数値のフォーマッタの作成。
<p>{@link #createFormatter(FieldAccessor, Configuration)}で結果が空の時に使用する。</p>
@param field フィールド情報
@param config システム設定
@return | [
"アノテーション",
"{",
"@link",
"CsvNumberFormat",
"}",
"の指定がないときなどの書式のない数値のフォーマッタの作成。",
"<p",
">",
"{",
"@link",
"#createFormatter",
"(",
"FieldAccessor",
"Configuration",
")",
"}",
"で結果が空の時に使用する。<",
"/",
"p",
">"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/builder/standard/AbstractNumberProcessorBuilder.java#L118-L143 |
TakahikoKawasaki/nv-bluetooth | src/main/java/com/neovisionaries/bluetooth/ble/util/Bytes.java | Bytes.toHexString | public static String toHexString(byte[] data, boolean upper) {
"""
Convert a byte array to a hex string.
@param data
An input byte array.
@param upper
{@code true} to generate a upper-case hex string.
{@code false} to generate a lower-case hex string.
@return
A hex string. if {@code data} is {@code nu... | java | public static String toHexString(byte[] data, boolean upper)
{
if (data == null)
{
return null;
}
char[] table = (upper ? UPPER_HEX_CHARS : LOWER_HEX_CHARS);
char[] chars = new char[data.length * 2];
for (int i = 0; i < data.length; ++i)
{
... | [
"public",
"static",
"String",
"toHexString",
"(",
"byte",
"[",
"]",
"data",
",",
"boolean",
"upper",
")",
"{",
"if",
"(",
"data",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"char",
"[",
"]",
"table",
"=",
"(",
"upper",
"?",
"UPPER_HEX_CHARS"... | Convert a byte array to a hex string.
@param data
An input byte array.
@param upper
{@code true} to generate a upper-case hex string.
{@code false} to generate a lower-case hex string.
@return
A hex string. if {@code data} is {@code null},
{@code null} is returned. | [
"Convert",
"a",
"byte",
"array",
"to",
"a",
"hex",
"string",
"."
] | train | https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/util/Bytes.java#L102-L119 |
op4j/op4j | src/main/java/org/op4j/Op.java | Op.onArrayFor | public static <T> Level0ArrayOperator<Short[],Short> onArrayFor(final Short... elements) {
"""
<p>
Creates an array with the specified elements and an <i>operation expression</i> on it.
</p>
@param elements the elements of the array being created
@return an operator, ready for chaining
"""
retur... | java | public static <T> Level0ArrayOperator<Short[],Short> onArrayFor(final Short... elements) {
return onArrayOf(Types.SHORT, VarArgsUtil.asRequiredObjectArray(elements));
} | [
"public",
"static",
"<",
"T",
">",
"Level0ArrayOperator",
"<",
"Short",
"[",
"]",
",",
"Short",
">",
"onArrayFor",
"(",
"final",
"Short",
"...",
"elements",
")",
"{",
"return",
"onArrayOf",
"(",
"Types",
".",
"SHORT",
",",
"VarArgsUtil",
".",
"asRequiredOb... | <p>
Creates an array with the specified elements and an <i>operation expression</i> on it.
</p>
@param elements the elements of the array being created
@return an operator, ready for chaining | [
"<p",
">",
"Creates",
"an",
"array",
"with",
"the",
"specified",
"elements",
"and",
"an",
"<i",
">",
"operation",
"expression<",
"/",
"i",
">",
"on",
"it",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/Op.java#L893-L895 |
vkostyukov/la4j | src/main/java/org/la4j/Matrix.java | Matrix.fromCSV | public static Matrix fromCSV(String csv) {
"""
Parses {@link Matrix} from the given CSV string.
@param csv the string in CSV format
@return a parsed matrix
"""
StringTokenizer lines = new StringTokenizer(csv, "\n");
Matrix result = DenseMatrix.zero(10, 10);
int rows = 0;
i... | java | public static Matrix fromCSV(String csv) {
StringTokenizer lines = new StringTokenizer(csv, "\n");
Matrix result = DenseMatrix.zero(10, 10);
int rows = 0;
int columns = 0;
while (lines.hasMoreTokens()) {
if (result.rows() == rows) {
result = result.co... | [
"public",
"static",
"Matrix",
"fromCSV",
"(",
"String",
"csv",
")",
"{",
"StringTokenizer",
"lines",
"=",
"new",
"StringTokenizer",
"(",
"csv",
",",
"\"\\n\"",
")",
";",
"Matrix",
"result",
"=",
"DenseMatrix",
".",
"zero",
"(",
"10",
",",
"10",
")",
";",... | Parses {@link Matrix} from the given CSV string.
@param csv the string in CSV format
@return a parsed matrix | [
"Parses",
"{",
"@link",
"Matrix",
"}",
"from",
"the",
"given",
"CSV",
"string",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrix.java#L194-L221 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/GuardedBySymbolResolver.java | GuardedBySymbolResolver.resolveType | private Symbol resolveType(String name, SearchSuperTypes searchSuperTypes) {
"""
Resolves a simple name as a type. Considers super classes, lexically enclosing classes, and
then arbitrary types available in the current environment.
"""
Symbol type = null;
if (searchSuperTypes == SearchSuperTypes.YES) ... | java | private Symbol resolveType(String name, SearchSuperTypes searchSuperTypes) {
Symbol type = null;
if (searchSuperTypes == SearchSuperTypes.YES) {
type = getSuperType(enclosingClass, name);
}
if (enclosingClass.getSimpleName().contentEquals(name)) {
type = enclosingClass;
}
if (type ==... | [
"private",
"Symbol",
"resolveType",
"(",
"String",
"name",
",",
"SearchSuperTypes",
"searchSuperTypes",
")",
"{",
"Symbol",
"type",
"=",
"null",
";",
"if",
"(",
"searchSuperTypes",
"==",
"SearchSuperTypes",
".",
"YES",
")",
"{",
"type",
"=",
"getSuperType",
"(... | Resolves a simple name as a type. Considers super classes, lexically enclosing classes, and
then arbitrary types available in the current environment. | [
"Resolves",
"a",
"simple",
"name",
"as",
"a",
"type",
".",
"Considers",
"super",
"classes",
"lexically",
"enclosing",
"classes",
"and",
"then",
"arbitrary",
"types",
"available",
"in",
"the",
"current",
"environment",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/GuardedBySymbolResolver.java#L197-L216 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.checkRatio | public static float checkRatio(AlluxioConfiguration conf, PropertyKey key) {
"""
Checks that the given property key is a ratio from 0.0 and 1.0, throwing an exception if it is
not.
@param conf the configuration for looking up the property key
@param key the property key
@return the property value
"""
... | java | public static float checkRatio(AlluxioConfiguration conf, PropertyKey key) {
float value = conf.getFloat(key);
Preconditions.checkState(value <= 1.0, "Property %s must not exceed 1, but it is set to %s",
key.getName(), value);
Preconditions.checkState(value >= 0.0, "Property %s must be non-negative,... | [
"public",
"static",
"float",
"checkRatio",
"(",
"AlluxioConfiguration",
"conf",
",",
"PropertyKey",
"key",
")",
"{",
"float",
"value",
"=",
"conf",
".",
"getFloat",
"(",
"key",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"value",
"<=",
"1.0",
",",
"... | Checks that the given property key is a ratio from 0.0 and 1.0, throwing an exception if it is
not.
@param conf the configuration for looking up the property key
@param key the property key
@return the property value | [
"Checks",
"that",
"the",
"given",
"property",
"key",
"is",
"a",
"ratio",
"from",
"0",
".",
"0",
"and",
"1",
".",
"0",
"throwing",
"an",
"exception",
"if",
"it",
"is",
"not",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L318-L325 |
sahan/ZombieLink | zombielink/src/main/java/com/lonepulse/zombielink/response/ResponseProcessorChain.java | ResponseProcessorChain.onTraverse | @Override
protected Object onTraverse(Object result, ProcessorChainLink<Object, ResponseProcessorException> successor, Object... args) {
"""
<p>Executed for each "link-crossing" from the root {@link HeaderProcessor} onwards. Takes the
<b>successor</b> and invokes it with the argument array which was provided in ... | java | @Override
protected Object onTraverse(Object result, ProcessorChainLink<Object, ResponseProcessorException> successor, Object... args) {
return successor.getProcessor().run(args[0], args[1], result); //allow any exceptions to elevate to a chain-wide failure
} | [
"@",
"Override",
"protected",
"Object",
"onTraverse",
"(",
"Object",
"result",
",",
"ProcessorChainLink",
"<",
"Object",
",",
"ResponseProcessorException",
">",
"successor",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"successor",
".",
"getProcessor",
"(",
... | <p>Executed for each "link-crossing" from the root {@link HeaderProcessor} onwards. Takes the
<b>successor</b> and invokes it with the argument array which was provided in {@link #run(Object...)}
and returns the deserialized response content (if any).</p>
<p>See {@link AbstractResponseProcessor}.</p>
{@inheritDoc} | [
"<p",
">",
"Executed",
"for",
"each",
"link",
"-",
"crossing",
"from",
"the",
"root",
"{",
"@link",
"HeaderProcessor",
"}",
"onwards",
".",
"Takes",
"the",
"<b",
">",
"successor<",
"/",
"b",
">",
"and",
"invokes",
"it",
"with",
"the",
"argument",
"array"... | train | https://github.com/sahan/ZombieLink/blob/a9971add56d4f6919a4a5e84c78e9220011d8982/zombielink/src/main/java/com/lonepulse/zombielink/response/ResponseProcessorChain.java#L101-L105 |
samskivert/samskivert | src/main/java/com/samskivert/swing/Controller.java | Controller.postAction | public static void postAction (
Component source, String command, Object argument) {
"""
Like {@link #postAction(ActionEvent)} except that it constructs a
{@link CommandEvent} with the supplied source component, string
command and argument.
"""
// slip things onto the event queue for later
... | java | public static void postAction (
Component source, String command, Object argument)
{
// slip things onto the event queue for later
CommandEvent event = new CommandEvent(source, command, argument);
EventQueue.invokeLater(new ActionInvoker(event));
} | [
"public",
"static",
"void",
"postAction",
"(",
"Component",
"source",
",",
"String",
"command",
",",
"Object",
"argument",
")",
"{",
"// slip things onto the event queue for later",
"CommandEvent",
"event",
"=",
"new",
"CommandEvent",
"(",
"source",
",",
"command",
... | Like {@link #postAction(ActionEvent)} except that it constructs a
{@link CommandEvent} with the supplied source component, string
command and argument. | [
"Like",
"{"
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/Controller.java#L123-L129 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.setSasDefinitionAsync | public Observable<SasDefinitionBundle> setSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod) {
"""
Creates or updates a new SAS definition for the specified storage account. This operation requires the storag... | java | public Observable<SasDefinitionBundle> setSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod) {
return setSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName, templateU... | [
"public",
"Observable",
"<",
"SasDefinitionBundle",
">",
"setSasDefinitionAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"String",
"sasDefinitionName",
",",
"String",
"templateUri",
",",
"SasTokenType",
"sasType",
",",
"String",
"validi... | Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.
@param sasDefinitionName The name of the SAS defi... | [
"Creates",
"or",
"updates",
"a",
"new",
"SAS",
"definition",
"for",
"the",
"specified",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"setsas",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L11287-L11294 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcher.java | ConsumerDispatcher.newReadyConsumer | @Override
public long newReadyConsumer(JSConsumerKey consumerKey, boolean bSelector) {
"""
Add a ready consumer into our ready 'lists'
@param consumerKey - handle to the ready consumer
@param bSelector - consumer has a selector or not
@return readyConsumerVersion
"""
if (TraceComponent.isAnyTr... | java | @Override
public long newReadyConsumer(JSConsumerKey consumerKey, boolean bSelector)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "newReadyConsumer",
new Object[] { consumerKey, Boolean.valueOf(bSelector) });
// If this is... | [
"@",
"Override",
"public",
"long",
"newReadyConsumer",
"(",
"JSConsumerKey",
"consumerKey",
",",
"boolean",
"bSelector",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
"."... | Add a ready consumer into our ready 'lists'
@param consumerKey - handle to the ready consumer
@param bSelector - consumer has a selector or not
@return readyConsumerVersion | [
"Add",
"a",
"ready",
"consumer",
"into",
"our",
"ready",
"lists"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcher.java#L1428-L1464 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/waiters/AcceptorPathMatcher.java | AcceptorPathMatcher.pathAll | public static boolean pathAll(JsonNode expectedResult, JsonNode finalResult) {
"""
PathAll matcher that checks if each element of the final
result matches the expected result
@param expectedResult Expected result given by the waiter definition
@param finalResult Final result of the resource got by the exec... | java | public static boolean pathAll(JsonNode expectedResult, JsonNode finalResult) {
if (finalResult.isNull()) {
return false;
}
if (!finalResult.isArray()) {
throw new RuntimeException("Expected an array");
}
for (JsonNode element : finalResult) {
i... | [
"public",
"static",
"boolean",
"pathAll",
"(",
"JsonNode",
"expectedResult",
",",
"JsonNode",
"finalResult",
")",
"{",
"if",
"(",
"finalResult",
".",
"isNull",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"finalResult",
".",
"isArray",
... | PathAll matcher that checks if each element of the final
result matches the expected result
@param expectedResult Expected result given by the waiter definition
@param finalResult Final result of the resource got by the execution
of the JmesPath expression given by the waiter
definition
@return True if all elements... | [
"PathAll",
"matcher",
"that",
"checks",
"if",
"each",
"element",
"of",
"the",
"final",
"result",
"matches",
"the",
"expected",
"result"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/waiters/AcceptorPathMatcher.java#L35-L48 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/N1qlParams.java | N1qlParams.scanWait | public N1qlParams scanWait(long wait, TimeUnit unit) {
"""
If the {@link ScanConsistency#NOT_BOUNDED NOT_BOUNDED scan consistency} has been chosen, does nothing.
Otherwise, sets the maximum time the client is willing to wait for an index to catch up to the
vector timestamp in the request.
@param wait the du... | java | public N1qlParams scanWait(long wait, TimeUnit unit) {
if (this.consistency == ScanConsistency.NOT_BOUNDED) {
this.scanWait = null;
} else {
this.scanWait = durationToN1qlFormat(wait, unit);
}
return this;
} | [
"public",
"N1qlParams",
"scanWait",
"(",
"long",
"wait",
",",
"TimeUnit",
"unit",
")",
"{",
"if",
"(",
"this",
".",
"consistency",
"==",
"ScanConsistency",
".",
"NOT_BOUNDED",
")",
"{",
"this",
".",
"scanWait",
"=",
"null",
";",
"}",
"else",
"{",
"this",... | If the {@link ScanConsistency#NOT_BOUNDED NOT_BOUNDED scan consistency} has been chosen, does nothing.
Otherwise, sets the maximum time the client is willing to wait for an index to catch up to the
vector timestamp in the request.
@param wait the duration.
@param unit the unit for the duration.
@return this {@link N1... | [
"If",
"the",
"{",
"@link",
"ScanConsistency#NOT_BOUNDED",
"NOT_BOUNDED",
"scan",
"consistency",
"}",
"has",
"been",
"chosen",
"does",
"nothing",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/N1qlParams.java#L289-L296 |
SeleniumJT/seleniumjt-core | src/main/java/com/jt/selenium/SeleniumJT.java | SeleniumJT.verifyElementContains | @LogExecTime
public void verifyElementContains(String locator, String value) {
"""
Looks for a substring within the element
@param locator
@param value
"""
jtCore.verifyElementContains(locator, value);
} | java | @LogExecTime
public void verifyElementContains(String locator, String value)
{
jtCore.verifyElementContains(locator, value);
} | [
"@",
"LogExecTime",
"public",
"void",
"verifyElementContains",
"(",
"String",
"locator",
",",
"String",
"value",
")",
"{",
"jtCore",
".",
"verifyElementContains",
"(",
"locator",
",",
"value",
")",
";",
"}"
] | Looks for a substring within the element
@param locator
@param value | [
"Looks",
"for",
"a",
"substring",
"within",
"the",
"element"
] | train | https://github.com/SeleniumJT/seleniumjt-core/blob/8e972f69adc4846a3f1d7b8ca9c3f8d953a2d0f3/src/main/java/com/jt/selenium/SeleniumJT.java#L253-L257 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PlacesApi.java | PlacesApi.getPlacesForBoundingBox | public Places getPlacesForBoundingBox(String boundingBox, JinxConstants.PlaceTypeId placeTypeId) throws JinxException {
"""
Return all the locations of a matching place type for a bounding box.
<p>The maximum allowable size of a bounding box (the distance between the SW and NE corners)
is governed by the place... | java | public Places getPlacesForBoundingBox(String boundingBox, JinxConstants.PlaceTypeId placeTypeId) throws JinxException {
JinxUtils.validateParams(boundingBox, placeTypeId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.places.placesForBoundingBox");
params.put("bbox", boundin... | [
"public",
"Places",
"getPlacesForBoundingBox",
"(",
"String",
"boundingBox",
",",
"JinxConstants",
".",
"PlaceTypeId",
"placeTypeId",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"boundingBox",
",",
"placeTypeId",
")",
";",
"Map",
"<... | Return all the locations of a matching place type for a bounding box.
<p>The maximum allowable size of a bounding box (the distance between the SW and NE corners)
is governed by the place type you are requesting. Allowable sizes are as follows:</p>
<ul>
<li>neighbourhood: 3km (1.8mi)</li>
<li>locality: 7km (4.3mi)</li... | [
"Return",
"all",
"the",
"locations",
"of",
"a",
"matching",
"place",
"type",
"for",
"a",
"bounding",
"box",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PlacesApi.java#L294-L301 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/tiled/TiledMap.java | TiledMap.getTileProperty | public String getTileProperty(int tileID, String propertyName, String def) {
"""
Get a propety given to a particular tile. Note that this method will not
perform well and should not be used as part of the default code path in
the game loop.
@param tileID
The global ID of the tile to retrieve
@param property... | java | public String getTileProperty(int tileID, String propertyName, String def) {
if (tileID == 0) {
return def;
}
TileSet set = findTileSet(tileID);
Properties props = set.getProperties(tileID);
if (props == null) {
return def;
}
return props.getProperty(propertyName, def);
} | [
"public",
"String",
"getTileProperty",
"(",
"int",
"tileID",
",",
"String",
"propertyName",
",",
"String",
"def",
")",
"{",
"if",
"(",
"tileID",
"==",
"0",
")",
"{",
"return",
"def",
";",
"}",
"TileSet",
"set",
"=",
"findTileSet",
"(",
"tileID",
")",
"... | Get a propety given to a particular tile. Note that this method will not
perform well and should not be used as part of the default code path in
the game loop.
@param tileID
The global ID of the tile to retrieve
@param propertyName
The name of the property to retireve
@param def
The default value to return
@return The... | [
"Get",
"a",
"propety",
"given",
"to",
"a",
"particular",
"tile",
".",
"Note",
"that",
"this",
"method",
"will",
"not",
"perform",
"well",
"and",
"should",
"not",
"be",
"used",
"as",
"part",
"of",
"the",
"default",
"code",
"path",
"in",
"the",
"game",
"... | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/tiled/TiledMap.java#L335-L347 |
mike10004/common-helper | imnetio-helper/src/main/java/com/github/mike10004/common/image/ImageInfo.java | ImageInfo.run | private static void run(String sourceName, InputStream in, ImageInfo imageInfo, boolean verbose) {
"""
/* private String readLine(int firstChar) throws IOException {
StringBuffer result = new StringBuffer();
result.append((char)firstChar);
return readLine(result);
}
"""
imageInfo.setInput(in);
imageInf... | java | private static void run(String sourceName, InputStream in, ImageInfo imageInfo, boolean verbose) {
imageInfo.setInput(in);
imageInfo.setDetermineImageNumber(true);
imageInfo.setCollectComments(verbose);
if (imageInfo.check()) {
print(sourceName, imageInfo, verbose);
}
} | [
"private",
"static",
"void",
"run",
"(",
"String",
"sourceName",
",",
"InputStream",
"in",
",",
"ImageInfo",
"imageInfo",
",",
"boolean",
"verbose",
")",
"{",
"imageInfo",
".",
"setInput",
"(",
"in",
")",
";",
"imageInfo",
".",
"setDetermineImageNumber",
"(",
... | /* private String readLine(int firstChar) throws IOException {
StringBuffer result = new StringBuffer();
result.append((char)firstChar);
return readLine(result);
} | [
"/",
"*",
"private",
"String",
"readLine",
"(",
"int",
"firstChar",
")",
"throws",
"IOException",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"()",
";",
"result",
".",
"append",
"((",
"char",
")",
"firstChar",
")",
";",
"return",
"readLine",
... | train | https://github.com/mike10004/common-helper/blob/744f82d9b0768a9ad9c63a57a37ab2c93bf408f4/imnetio-helper/src/main/java/com/github/mike10004/common/image/ImageInfo.java#L1248-L1255 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java | CATMainConsumer.unlockSet | public void unlockSet(int requestNumber, SIMessageHandle[] msgHandles, boolean reply) // f199593, F219476.2 {
"""
Unlocks a set of messages locked by this consumer. This call
is delegated to the sub consumer if one exists or the
<code>CATConsumer</code> version is used.
@param requestNumber T... | java | public void unlockSet(int requestNumber, SIMessageHandle[] msgHandles, boolean reply) // f199593, F219476.2
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "unlockSet",
new Object[]
... | [
"public",
"void",
"unlockSet",
"(",
"int",
"requestNumber",
",",
"SIMessageHandle",
"[",
"]",
"msgHandles",
",",
"boolean",
"reply",
")",
"// f199593, F219476.2",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEn... | Unlocks a set of messages locked by this consumer. This call
is delegated to the sub consumer if one exists or the
<code>CATConsumer</code> version is used.
@param requestNumber The request number which replies should be sent to.
@param msgHandles
@param reply | [
"Unlocks",
"a",
"set",
"of",
"messages",
"locked",
"by",
"this",
"consumer",
".",
"This",
"call",
"is",
"delegated",
"to",
"the",
"sub",
"consumer",
"if",
"one",
"exists",
"or",
"the",
"<code",
">",
"CATConsumer<",
"/",
"code",
">",
"version",
"is",
"use... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java#L824-L846 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_service_serviceName_offerChange_POST | public void billingAccount_service_serviceName_offerChange_POST(String billingAccount, String serviceName, String offer) throws IOException {
"""
Add a new offer change
REST: POST /telephony/{billingAccount}/service/{serviceName}/offerChange
@param offer [required] The future offer
@param billingAccount [requ... | java | public void billingAccount_service_serviceName_offerChange_POST(String billingAccount, String serviceName, String offer) throws IOException {
String qPath = "/telephony/{billingAccount}/service/{serviceName}/offerChange";
StringBuilder sb = path(qPath, billingAccount, serviceName);
HashMap<String, Object>o = new ... | [
"public",
"void",
"billingAccount_service_serviceName_offerChange_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"offer",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/service/{serviceName}/offerC... | Add a new offer change
REST: POST /telephony/{billingAccount}/service/{serviceName}/offerChange
@param offer [required] The future offer
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Add",
"a",
"new",
"offer",
"change"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4135-L4141 |
neo4j/license-maven-plugin | src/main/java/com/google/code/mojo/license/util/resource/ResourceFinder.java | ResourceFinder.findResource | public URL findResource(String resource) throws MojoFailureException {
"""
Find a resource by searching:<br/>
1. In the filesystem, relative to basedir<br/>
2. In the filesystem, as an absolute path (or relative to current execution directory)<br/>
3. In project classpath<br/>
4. In plugin classpath<br/>
5. A... | java | public URL findResource(String resource) throws MojoFailureException {
// first search relatively to the base directory
URL res = toURL(new File(basedir, resource));
if (res != null) {
return res;
}
// if not found, search for absolute location on file system,... | [
"public",
"URL",
"findResource",
"(",
"String",
"resource",
")",
"throws",
"MojoFailureException",
"{",
"// first search relatively to the base directory\r",
"URL",
"res",
"=",
"toURL",
"(",
"new",
"File",
"(",
"basedir",
",",
"resource",
")",
")",
";",
"if",
"(",... | Find a resource by searching:<br/>
1. In the filesystem, relative to basedir<br/>
2. In the filesystem, as an absolute path (or relative to current execution directory)<br/>
3. In project classpath<br/>
4. In plugin classpath<br/>
5. As a URL
@param resource The resource to get
@return A valid URL
@throws MojoFailureE... | [
"Find",
"a",
"resource",
"by",
"searching",
":",
"<br",
"/",
">",
"1",
".",
"In",
"the",
"filesystem",
"relative",
"to",
"basedir<br",
"/",
">",
"2",
".",
"In",
"the",
"filesystem",
"as",
"an",
"absolute",
"path",
"(",
"or",
"relative",
"to",
"current"... | train | https://github.com/neo4j/license-maven-plugin/blob/2850cc6809820f15458400e687de2c84099a49c2/src/main/java/com/google/code/mojo/license/util/resource/ResourceFinder.java#L64-L101 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java | ListManagementTermsImpl.deleteAllTerms | public String deleteAllTerms(String listId, String language) {
"""
Deletes all terms from the list with list Id equal to the list Id passed.
@param listId List Id of the image list.
@param language Language of the terms.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws APIErr... | java | public String deleteAllTerms(String listId, String language) {
return deleteAllTermsWithServiceResponseAsync(listId, language).toBlocking().single().body();
} | [
"public",
"String",
"deleteAllTerms",
"(",
"String",
"listId",
",",
"String",
"language",
")",
"{",
"return",
"deleteAllTermsWithServiceResponseAsync",
"(",
"listId",
",",
"language",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"(",... | Deletes all terms from the list with list Id equal to the list Id passed.
@param listId List Id of the image list.
@param language Language of the terms.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws APIErrorException thrown if the request is rejected by server
@throws RuntimeExcept... | [
"Deletes",
"all",
"terms",
"from",
"the",
"list",
"with",
"list",
"Id",
"equal",
"to",
"the",
"list",
"Id",
"passed",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java#L448-L450 |
kite-sdk/kite | kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/avro/io/MemcmpEncoder.java | MemcmpEncoder.writeBytes | @Override
public void writeBytes(byte[] bytes, int start, int len) throws IOException {
"""
Bytes are encoded by writing all bytes out as themselves, except for bytes
of value 0x00. Bytes of value 0x00 are encoded as two bytes, 0x00 0x01. The
end marker is signified by two 0x00 bytes. This guarantees that the ... | java | @Override
public void writeBytes(byte[] bytes, int start, int len) throws IOException {
for (int i = start; i < start + len; ++i) {
if (bytes[i] == 0x00) {
out.write(0);
out.write(1);
} else {
out.write((int) bytes[i]);
}
}
out.write(0);
out.write(0);
} | [
"@",
"Override",
"public",
"void",
"writeBytes",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"start",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"start",
"+",
"len",
";",
"++",
"i",
... | Bytes are encoded by writing all bytes out as themselves, except for bytes
of value 0x00. Bytes of value 0x00 are encoded as two bytes, 0x00 0x01. The
end marker is signified by two 0x00 bytes. This guarantees that the end
marker is the least possible value.
@param bytes
The bytes to encode.
@param start
The start of ... | [
"Bytes",
"are",
"encoded",
"by",
"writing",
"all",
"bytes",
"out",
"as",
"themselves",
"except",
"for",
"bytes",
"of",
"value",
"0x00",
".",
"Bytes",
"of",
"value",
"0x00",
"are",
"encoded",
"as",
"two",
"bytes",
"0x00",
"0x01",
".",
"The",
"end",
"marke... | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/avro/io/MemcmpEncoder.java#L176-L188 |
buschmais/jqa-maven3-plugin | src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenPomFileScannerPlugin.java | MavenPomFileScannerPlugin.getModel | private Model getModel(FileResource item, Scanner scanner) throws IOException {
"""
Build the POM model from the given file resource (i.e. a pom.xml).
@param item
The file resource.
@param scanner
The scanner.
@return The model.
@throws IOException
If the model cannot be read.
"""
PomModelBuil... | java | private Model getModel(FileResource item, Scanner scanner) throws IOException {
PomModelBuilder pomModelBuilder = scanner.getContext().peekOrDefault(PomModelBuilder.class, null);
if (pomModelBuilder != null) {
return pomModelBuilder.getModel(item.getFile());
}
Model model = n... | [
"private",
"Model",
"getModel",
"(",
"FileResource",
"item",
",",
"Scanner",
"scanner",
")",
"throws",
"IOException",
"{",
"PomModelBuilder",
"pomModelBuilder",
"=",
"scanner",
".",
"getContext",
"(",
")",
".",
"peekOrDefault",
"(",
"PomModelBuilder",
".",
"class"... | Build the POM model from the given file resource (i.e. a pom.xml).
@param item
The file resource.
@param scanner
The scanner.
@return The model.
@throws IOException
If the model cannot be read. | [
"Build",
"the",
"POM",
"model",
"from",
"the",
"given",
"file",
"resource",
"(",
"i",
".",
"e",
".",
"a",
"pom",
".",
"xml",
")",
"."
] | train | https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenPomFileScannerPlugin.java#L85-L99 |
OpenTSDB/opentsdb | src/query/filter/TagVFilter.java | TagVFilter.getFilter | public static TagVFilter getFilter(final String tagk, final String filter) {
"""
Parses the tag value and determines if it's a group by, a literal or a filter.
@param tagk The tag key associated with this value
@param filter The tag value, possibly a filter
@return Null if the value was a group by or a literal,... | java | public static TagVFilter getFilter(final String tagk, final String filter) {
if (tagk == null || tagk.isEmpty()) {
throw new IllegalArgumentException("Tagk cannot be null or empty");
}
if (filter == null || filter.isEmpty()) {
throw new IllegalArgumentException("Filter cannot be null or empty");... | [
"public",
"static",
"TagVFilter",
"getFilter",
"(",
"final",
"String",
"tagk",
",",
"final",
"String",
"filter",
")",
"{",
"if",
"(",
"tagk",
"==",
"null",
"||",
"tagk",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
... | Parses the tag value and determines if it's a group by, a literal or a filter.
@param tagk The tag key associated with this value
@param filter The tag value, possibly a filter
@return Null if the value was a group by or a literal, a valid filter object
if it looked to be a filter.
@throws IllegalArgumentException if t... | [
"Parses",
"the",
"tag",
"value",
"and",
"determines",
"if",
"it",
"s",
"a",
"group",
"by",
"a",
"literal",
"or",
"a",
"filter",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/filter/TagVFilter.java#L199-L224 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/ThemeUtil.java | ThemeUtil.getTextArray | public static CharSequence[] getTextArray(@NonNull final Context context,
@AttrRes final int resourceId) {
"""
Obtains the text array, which corresponds to a specific resource id, from a context's theme.
If the given resource id is invalid, a {@link NotFoundException}... | java | public static CharSequence[] getTextArray(@NonNull final Context context,
@AttrRes final int resourceId) {
return getTextArray(context, -1, resourceId);
} | [
"public",
"static",
"CharSequence",
"[",
"]",
"getTextArray",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"AttrRes",
"final",
"int",
"resourceId",
")",
"{",
"return",
"getTextArray",
"(",
"context",
",",
"-",
"1",
",",
"resourceId",
")",
... | Obtains the text array, which corresponds to a specific resource id, from a context's theme.
If the given resource id is invalid, a {@link NotFoundException} will be thrown.
@param context
The context, which should be used, as an instance of the class {@link Context}. The
context may not be null
@param resourceId
The ... | [
"Obtains",
"the",
"text",
"array",
"which",
"corresponds",
"to",
"a",
"specific",
"resource",
"id",
"from",
"a",
"context",
"s",
"theme",
".",
"If",
"the",
"given",
"resource",
"id",
"is",
"invalid",
"a",
"{",
"@link",
"NotFoundException",
"}",
"will",
"be... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L313-L316 |
alkacon/opencms-core | src/org/opencms/importexport/CmsExportHelper.java | CmsExportHelper.writeFile2Zip | protected void writeFile2Zip(CmsFile file, String name) throws IOException {
"""
Writes a single OpenCms VFS file to the ZIP export.<p>
@param file the OpenCms VFS file to write
@param name the name of the file in the export
@throws IOException in case of file access issues
"""
ZipEntry entry =... | java | protected void writeFile2Zip(CmsFile file, String name) throws IOException {
ZipEntry entry = new ZipEntry(name);
// save the time of the last modification in the zip
entry.setTime(file.getDateLastModified());
m_exportZipStream.putNextEntry(entry);
m_exportZipStream.write(file.g... | [
"protected",
"void",
"writeFile2Zip",
"(",
"CmsFile",
"file",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"ZipEntry",
"entry",
"=",
"new",
"ZipEntry",
"(",
"name",
")",
";",
"// save the time of the last modification in the zip",
"entry",
".",
"setTime... | Writes a single OpenCms VFS file to the ZIP export.<p>
@param file the OpenCms VFS file to write
@param name the name of the file in the export
@throws IOException in case of file access issues | [
"Writes",
"a",
"single",
"OpenCms",
"VFS",
"file",
"to",
"the",
"ZIP",
"export",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsExportHelper.java#L235-L243 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInfo.java | NetworkInfo.of | public static NetworkInfo of(NetworkId networkId, NetworkConfiguration configuration) {
"""
Returns a {@code NetworkInfo} object given the network identity. Use {@link
StandardNetworkConfiguration} to create a standard network with associated address range. Use
{@link SubnetNetworkConfiguration} to create a netw... | java | public static NetworkInfo of(NetworkId networkId, NetworkConfiguration configuration) {
return newBuilder(networkId, configuration).build();
} | [
"public",
"static",
"NetworkInfo",
"of",
"(",
"NetworkId",
"networkId",
",",
"NetworkConfiguration",
"configuration",
")",
"{",
"return",
"newBuilder",
"(",
"networkId",
",",
"configuration",
")",
".",
"build",
"(",
")",
";",
"}"
] | Returns a {@code NetworkInfo} object given the network identity. Use {@link
StandardNetworkConfiguration} to create a standard network with associated address range. Use
{@link SubnetNetworkConfiguration} to create a network that supports subnetworks, up to one per
region, each with its own address range. | [
"Returns",
"a",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInfo.java#L268-L270 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/NetUtils.java | NetUtils.unresolvedHostAndPortToNormalizedString | public static String unresolvedHostAndPortToNormalizedString(String host, int port) {
"""
Returns a valid address for Akka. It returns a String of format 'host:port'.
When an IPv6 address is specified, it normalizes the IPv6 address to avoid
complications with the exact URL match policy of Akka.
@param host The... | java | public static String unresolvedHostAndPortToNormalizedString(String host, int port) {
Preconditions.checkArgument(port >= 0 && port < 65536,
"Port is not within the valid range,");
return unresolvedHostToNormalizedString(host) + ":" + port;
} | [
"public",
"static",
"String",
"unresolvedHostAndPortToNormalizedString",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"port",
">=",
"0",
"&&",
"port",
"<",
"65536",
",",
"\"Port is not within the valid range,\"",
"... | Returns a valid address for Akka. It returns a String of format 'host:port'.
When an IPv6 address is specified, it normalizes the IPv6 address to avoid
complications with the exact URL match policy of Akka.
@param host The hostname, IPv4 or IPv6 address
@param port The port
@return host:port where host will be normaliz... | [
"Returns",
"a",
"valid",
"address",
"for",
"Akka",
".",
"It",
"returns",
"a",
"String",
"of",
"format",
"host",
":",
"port",
".",
"When",
"an",
"IPv6",
"address",
"is",
"specified",
"it",
"normalizes",
"the",
"IPv6",
"address",
"to",
"avoid",
"complication... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/NetUtils.java#L165-L169 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/partition/impl/InternalPartitionServiceImpl.java | InternalPartitionServiceImpl.createPartitionStateInternal | public PartitionRuntimeState createPartitionStateInternal() {
"""
Returns a copy of the partition table or {@code null} if not initialized. This method will acquire the partition service
lock.
"""
lock.lock();
try {
if (!partitionStateManager.isInitialized()) {
retu... | java | public PartitionRuntimeState createPartitionStateInternal() {
lock.lock();
try {
if (!partitionStateManager.isInitialized()) {
return null;
}
List<MigrationInfo> completedMigrations = migrationManager.getCompletedMigrationsCopy();
Internal... | [
"public",
"PartitionRuntimeState",
"createPartitionStateInternal",
"(",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!",
"partitionStateManager",
".",
"isInitialized",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"M... | Returns a copy of the partition table or {@code null} if not initialized. This method will acquire the partition service
lock. | [
"Returns",
"a",
"copy",
"of",
"the",
"partition",
"table",
"or",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/impl/InternalPartitionServiceImpl.java#L421-L437 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/RecordTypeBuilder.java | RecordTypeBuilder.addProperty | public RecordTypeBuilder addProperty(String name, JSType type, Node propertyNode) {
"""
Adds a property with the given name and type to the record type.
If you add a property that has already been added, then {@link #build}
will fail.
@param name the name of the new property
@param type the JSType of the new... | java | public RecordTypeBuilder addProperty(String name, JSType type, Node propertyNode) {
isEmpty = false;
properties.put(name, new RecordProperty(type, propertyNode));
return this;
} | [
"public",
"RecordTypeBuilder",
"addProperty",
"(",
"String",
"name",
",",
"JSType",
"type",
",",
"Node",
"propertyNode",
")",
"{",
"isEmpty",
"=",
"false",
";",
"properties",
".",
"put",
"(",
"name",
",",
"new",
"RecordProperty",
"(",
"type",
",",
"propertyN... | Adds a property with the given name and type to the record type.
If you add a property that has already been added, then {@link #build}
will fail.
@param name the name of the new property
@param type the JSType of the new property
@param propertyNode the node that holds this property definition
@return The builder its... | [
"Adds",
"a",
"property",
"with",
"the",
"given",
"name",
"and",
"type",
"to",
"the",
"record",
"type",
".",
"If",
"you",
"add",
"a",
"property",
"that",
"has",
"already",
"been",
"added",
"then",
"{",
"@link",
"#build",
"}",
"will",
"fail",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/RecordTypeBuilder.java#L75-L79 |
jaxio/javaee-lab | javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java | GenericRepository.findCount | @Transactional
public int findCount(E entity, SearchParameters sp) {
"""
Count the number of E instances.
@param entity a sample entity whose non-null properties may be used as search hint
@param sp carries additional search information
@return the number of entities matching the search.
"""
... | java | @Transactional
public int findCount(E entity, SearchParameters sp) {
checkNotNull(entity, "The entity cannot be null");
checkNotNull(sp, "The searchParameters cannot be null");
if (sp.hasNamedQuery()) {
return byNamedQueryUtil.numberByNamedQuery(sp).intValue();
}
... | [
"@",
"Transactional",
"public",
"int",
"findCount",
"(",
"E",
"entity",
",",
"SearchParameters",
"sp",
")",
"{",
"checkNotNull",
"(",
"entity",
",",
"\"The entity cannot be null\"",
")",
";",
"checkNotNull",
"(",
"sp",
",",
"\"The searchParameters cannot be null\"",
... | Count the number of E instances.
@param entity a sample entity whose non-null properties may be used as search hint
@param sp carries additional search information
@return the number of entities matching the search. | [
"Count",
"the",
"number",
"of",
"E",
"instances",
"."
] | train | https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java#L337-L369 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerSnapshot.java | PojoSerializerSnapshot.newPojoSerializerIsCompatibleAfterMigration | private static <T> boolean newPojoSerializerIsCompatibleAfterMigration(
PojoSerializer<T> newPojoSerializer,
IntermediateCompatibilityResult<T> fieldSerializerCompatibility,
IntermediateCompatibilityResult<T> preExistingRegistrationsCompatibility,
LinkedOptionalMap<Field, TypeSerializerSnapshot<?>> fieldSer... | java | private static <T> boolean newPojoSerializerIsCompatibleAfterMigration(
PojoSerializer<T> newPojoSerializer,
IntermediateCompatibilityResult<T> fieldSerializerCompatibility,
IntermediateCompatibilityResult<T> preExistingRegistrationsCompatibility,
LinkedOptionalMap<Field, TypeSerializerSnapshot<?>> fieldSer... | [
"private",
"static",
"<",
"T",
">",
"boolean",
"newPojoSerializerIsCompatibleAfterMigration",
"(",
"PojoSerializer",
"<",
"T",
">",
"newPojoSerializer",
",",
"IntermediateCompatibilityResult",
"<",
"T",
">",
"fieldSerializerCompatibility",
",",
"IntermediateCompatibilityResul... | Checks if the new {@link PojoSerializer} is compatible after migration. | [
"Checks",
"if",
"the",
"new",
"{"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerSnapshot.java#L345-L353 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsEmbeddedDialogHandler.java | CmsEmbeddedDialogHandler.onSiteOrProjectChange | public void onSiteOrProjectChange(String sitePath, String serverLink) {
"""
Called when site and or project have been changed.<p>
@param sitePath the site path to the resource to display
@param serverLink the server link to the resource to display
"""
if (m_frame != null) {
m_frame.rem... | java | public void onSiteOrProjectChange(String sitePath, String serverLink) {
if (m_frame != null) {
m_frame.removeFromParent();
m_frame = null;
}
if (m_handler != null) {
m_handler.onSiteOrProjectChange(sitePath, serverLink);
} else {
Window.Lo... | [
"public",
"void",
"onSiteOrProjectChange",
"(",
"String",
"sitePath",
",",
"String",
"serverLink",
")",
"{",
"if",
"(",
"m_frame",
"!=",
"null",
")",
"{",
"m_frame",
".",
"removeFromParent",
"(",
")",
";",
"m_frame",
"=",
"null",
";",
"}",
"if",
"(",
"m_... | Called when site and or project have been changed.<p>
@param sitePath the site path to the resource to display
@param serverLink the server link to the resource to display | [
"Called",
"when",
"site",
"and",
"or",
"project",
"have",
"been",
"changed",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsEmbeddedDialogHandler.java#L138-L149 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/util/ClassUtils.java | ClassUtils.findBestTypedConstructor | @SuppressWarnings("unchecked")
public static <T> Constructor<T> findBestTypedConstructor( Class<T> klass, Object... args ) throws NoSuchMethodException {
"""
<p>findBestTypedConstructor.</p>
@param klass a {@link java.lang.Class} object.
@param args a {@link java.lang.Object} object.
@param <T> a T object... | java | @SuppressWarnings("unchecked")
public static <T> Constructor<T> findBestTypedConstructor( Class<T> klass, Object... args ) throws NoSuchMethodException
{
for (Constructor constructor : klass.getConstructors())
{
if (typesMatch( constructor, args )) return constructor;
}
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Constructor",
"<",
"T",
">",
"findBestTypedConstructor",
"(",
"Class",
"<",
"T",
">",
"klass",
",",
"Object",
"...",
"args",
")",
"throws",
"NoSuchMethodException",
"{",
... | <p>findBestTypedConstructor.</p>
@param klass a {@link java.lang.Class} object.
@param args a {@link java.lang.Object} object.
@param <T> a T object.
@return a {@link java.lang.reflect.Constructor} object.
@throws java.lang.NoSuchMethodException if any. | [
"<p",
">",
"findBestTypedConstructor",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/util/ClassUtils.java#L58-L67 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.